News for hackers. Stuff that matters.
Re:ESPHome – Connect ESP32 with Sensors to HomeAssistant by thedanbob on Thursday May 26, 2022 @05:39PM (#31523669)
> ESPHome just automates all the super tedious parts of working with esp32s (stuff like connecting to wifi, MQTT, OTA upgrades, logging to mqtt, etc), without sacrificing any power.

I write my own firmware for all of my ESP devices and I can confirm, those definitely are the bulk of the work. The latest one (for a relay to power cycle my modem if the internet goes down) took less than an hour to write since I was able to copy-paste all of that boilerplate from a previous project.

Re:ESPHome – Connect ESP32 with Sensors to HomeAssistant by cptskippy on Thursday May 26, 2022 @06:03PM (#31523872)
> I write my own firmware for all of my ESP devices and I can confirm, those definitely are the bulk of the work.

I was doing that too for all of my projects. I was developing them as if they were products I could potentially sell. When I accepted that I wasn't ever going to do that, I gave ESPHome a try.

> took less than an hour to write since I was able to copy-paste all of that boilerplate from a previous project.

It would probably take 5 minutes to configure from scratch ESPHome, less time if you're copying from an existing config. In addition to that, you get automatic logging into Home Assistant and deep integration for free.

Using Hypfer's discovery[1] that you could read the raw values from Ikea's Vindriktning using an ESP, I wrote an ESPHome script for an ESP01 that pipes the data into Home Assistant. Now when I'm cooking and the air quality gets too bad my HVAC fan kicks on to clear the air. It took longer to solder everything up than it did to "code".

YAML:

    esphome:
      name: air-quality-sensor-1

    esp8266:
      board: esp01_1m

    # Enable logging
    logger:
    # Disable logging
      baud_rate: 0

    # Enable Home Assistant API
    api:

    ota:
      password: !secret aqs_ota_password

    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password

      # Enable fallback hotspot (captive portal) in case wifi connection fails
      ap:
        ssid: "Air-Quality-Sensor-1"
        password: !secret aqs_hotspot_password

    captive_portal:

    # Setup Ikea Vindriktning PM2.5 sensor
    uart:
      rx_pin: GPIO3
      baud_rate: 9600

    sensor:
      - platform: pm1006
        pm_2_5:
          name: "Ikea Vindriktning PM25"
          filters:
            - sliding_window_moving_average:
                window_size: 10
                send_every: 10







[1] https://github.com/Hypfer/esp8266-vindriktning-particle-sens...
Re:ESPHome – Connect ESP32 with Sensors to HomeAssistant by thedanbob on Thursday May 26, 2022 @06:39PM (#31524147)
That’s pretty cool! If I had know about ESPHome when I first got into home automation I’d probably have gone with it. Although I’m kind of glad I didn’t because I actually really enjoy programming in C++.
Re:ESPHome – Connect ESP32 with Sensors to HomeAssistant by kelvie on Thursday May 26, 2022 @07:14PM (#31524436)
FYI this could have been done really easily in esphome:

  switch:
    - platform: gpio
      pin: 25
      name: "Modem relay"
      restore_state: ALWAYS_ON
      id: modem_relay

  interval:
    - interval: 1min
      if:
        condition:
          not:
            wifi.connected
      then:
        - switch.turn_off: modem_relay
        - delay: 1s
        - switch.turn_on: modem_relay
Re:ESPHome – Connect ESP32 with Sensors to HomeAssistant by thedanbob on Friday May 27, 2022 @06:52AM (#31528068)
Mostly I write my own firmware to improve my C++ skills :)