ESPHome 2024.6 has been released and with it the new option to poll new firmware OTA instead of pushing it from the ESPHome dashboard in HA:
ota.http_request.flash
While this is surely interesting to update devices in foreign networks (i.e. commercial devices with an option to update), my personal interest is mainly to improve my own update procedures for my deep sleep devices. Such devices are usually sleeping when you try to push a new firmware to them and so the update fails. The usual solution is to set some special flag (like an input_boolean or some persistent MQTT message) and then wait until all sleeping devices are awake and waiting for you to push. This is a tedious manual process with each single update and it generally defies the reason for putting MCUs to sleep, like reducing power consumption or avoiding heat to build up.
ota.http_request.flash
now allows us to deposit the new firmware instead of pushing it. The sleeping MCU can then poll the new firmware whenever it wakes up and sees fit to do so.
I open this thread to discuss with you any best in breed solutions to …
- Compile all your ESP nodes’ YAMLs on the HA side, create MD5 hashes, and copy the resulting binaries and checksum files to some location that can be reached through HTTP(S) requests (like /homeassistant/www/)
- Poll the firmware regularly from the ESP side, but not too often to reduce power consumption
- Do any other ingenious tricks that you came up with to distribute ESPHome firmware updates to your MCUs through the new polling mechanism.