ESPHome: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
What is ESPHome? Use it to set up ESP8266 and ESP32 devices to work with Home Assistant.
== Overview ==
It requires a configuration file to load firmware into your device. That's it.
Use ESPHome to set up ESP8266 and ESP32 devices to work with Home Assistant.
See the README but basically set up is
It requires a configuration file to load firmware into your device. That's it. See the README but basically set up.
 
I gave up on installing it on my Windows laptop; it wanted some extra component installed, so I run it on Linux only now.
 
Once a device has been set up with OTA, it no longer needs a direct serial connection, additional updates are done Over The Air.
 
This creates a fresh esphome set up, I found I needed to delete the old one first yesterday to get all updates.


  conda create -n esphome
  conda create -n esphome
Line 7: Line 13:
  pip install esphome
  pip install esphome


Then build a yaml file, possibly with
I keep my files in ~/Documents/source/esphome/
 
Build an initial yaml file, possibly with


  esphome wizard esp12e.yaml
  esphome wizard esp12e.yaml


and install
and install onto a device


  esphome run esp12e.yaml
  esphome run esp12e.yaml
Line 17: Line 25:
To use it in Home Assistant, install the ESPHome integration. Once you do, it will find your ESPHome devices. This is slick.
To use it in Home Assistant, install the ESPHome integration. Once you do, it will find your ESPHome devices. This is slick.


My yaml file includes "ota:" which adds the "over-the-air" updates capability.
My yaml file includes "ota:" which adds the "over-the-air" updates capability. After the first successful upload over USB, it is faster to use OTA subsquently,
After the first successful upload over USB, it is faster to use OTA subsquently,
and it is no longer necessary to pull the (for example) [[Martin Jerry]] S-01 switch out of the wall to update it, it can happen over-the-air and in-the-wall.
and it is no longer necessary to pull the (for example) Martin Jerry S-01 switch
out of the wall to update it, it can happen over-the-air and in-the-wall.


Check /etc/hosts on Bellman to find the correct IP address; this is for wemos02
Check /etc/hosts on Bellman to find the correct IP address; this is for wemos02
Line 29: Line 35:
When leftover entries clog up Home Assistant due to changes during development, run this
When leftover entries clog up Home Assistant due to changes during development, run this


  esphome configuration.yaml clean-mqtt
  esphome clean-mqtt config.yaml


== Motion sensor ==
== Motion sensor ==
Line 44: Line 50:
According to Adafruit, the pixels will dim out after 1000 hours of use so
According to Adafruit, the pixels will dim out after 1000 hours of use so
I need to switch it off when it's not needed.
I need to switch it off when it's not needed.
== Cree Connected Max remote ==
I picked up a remote at Lowe's clearance table for $8. No idea if I can use it. So far I have learned it's a Tuya device built on a CBU mcu.
In theory I can put ESPHome on it, see https://community.home-assistant.io/t/detailed-guide-on-how-to-flash-the-new-tuya-beken-chips-with-openbk7231t/437276
Not working on it today, though.


== Resources ==
== Resources ==
Line 49: Line 62:
[https://esphome.io ESPHome page]
[https://esphome.io ESPHome page]
[https://esphome.io/guides/automations.html Automations]
[https://esphome.io/guides/automations.html Automations]
[[Category:IoT]][[Category:Embedded]]

Latest revision as of 00:31, 20 December 2024

Overview

Use ESPHome to set up ESP8266 and ESP32 devices to work with Home Assistant. It requires a configuration file to load firmware into your device. That's it. See the README but basically set up.

I gave up on installing it on my Windows laptop; it wanted some extra component installed, so I run it on Linux only now.

Once a device has been set up with OTA, it no longer needs a direct serial connection, additional updates are done Over The Air.

This creates a fresh esphome set up, I found I needed to delete the old one first yesterday to get all updates.

conda create -n esphome
conda activate esphome
pip install esphome

I keep my files in ~/Documents/source/esphome/

Build an initial yaml file, possibly with

esphome wizard esp12e.yaml

and install onto a device

esphome run esp12e.yaml

To use it in Home Assistant, install the ESPHome integration. Once you do, it will find your ESPHome devices. This is slick.

My yaml file includes "ota:" which adds the "over-the-air" updates capability. After the first successful upload over USB, it is faster to use OTA subsquently, and it is no longer necessary to pull the (for example) Martin Jerry S-01 switch out of the wall to update it, it can happen over-the-air and in-the-wall.

Check /etc/hosts on Bellman to find the correct IP address; this is for wemos02

esphome --device 192.168.123.204 --client-id wemos02 --verbose run wemos02.yaml

Clean MQTT

When leftover entries clog up Home Assistant due to changes during development, run this

esphome clean-mqtt config.yaml

Motion sensor

I built up a protoboard with a Wemos D1 Mini, an OLED display (ssd1306_i2c), two push buttons, an LED, and a RADAR motion sensor.

Everything is exposed in Home Assistant via the integration, so for example, when I push a button, "wemos02 button 1" in Home Assistant changes state from OFF to ON.

Communication runs both directions, so in Home Assistant I can adjust the brightness of the LEDs on my little board.

According to Adafruit, the pixels will dim out after 1000 hours of use so I need to switch it off when it's not needed.

Cree Connected Max remote

I picked up a remote at Lowe's clearance table for $8. No idea if I can use it. So far I have learned it's a Tuya device built on a CBU mcu.

In theory I can put ESPHome on it, see https://community.home-assistant.io/t/detailed-guide-on-how-to-flash-the-new-tuya-beken-chips-with-openbk7231t/437276

Not working on it today, though.

Resources

ESPHome page Automations