ESPHome 2024.6.x (and later) and Managed Updates

Hi,

i test the new “Managed Updates” Feature, so automate the updates for my ESPHome devices.
I have a json File with the md5 and the binary. Accessable through http and https.

This works, the device (inkplate6 in my case as a start) on boot loads the json file or pulls it through http, but then nothing happens, no update.

I think, i miss something, thats unclear in the docs (for me)

The json is:

{
    "name": "ESPHome-inkplate6",
    "version": "2024.6.3",
    "builds": [
        {
            "chipFamily": "ESP32",
            "ota": {
                "md5": "78f4405e297f8c8f00f1e06ea5f9887d",
                "path": "http://<url>/inkplate6/firmware-2024-6-3.ota.bin",
                "release_url": "https://esphome.io/",
                "summary": "ESPHome Update -> 2024.6.3"
            }
        }
    ]
}

Webserver-Log (slightly redacted (paths)

192.168.6.90 - - [26/Jun/2024:18:14:32 +0200] "GET /inkplate6.json HTTP/1.1" 200 369 .../htdocs/inkplate6.json

Does anyone does could point me to the right direction ? Do i need to have more builds in the json (the old and the new one or so) ?

Many Thanks,
Ronny

Hi Ronny
I’m about to start playing around with Managed Updates via HTTP Request and saw your post. Have you been able to get yours working?

Hi ,
no, sorry, i did not get it working. The json gets loaded, but nothing happens then.

Same here. I set up my files and changed my yaml. I can see that it “reads” the json and/or bin file (I think - I see an http request), but then nothing happens. Yes, the documentation is not clear enough.

It is a pity, as this will help me a lot if I can get it working as I have some yamls that won’t compile on my old Raspberry Pi 3 and I am not close to it - so I have to compile and update remotely. I created a python script that handles nearly everything (update esphome cli, compile selected yamls, create new json and md5 files for compiled yamls, and then uploads bin, json and md5 files to GitHub).

I’ll keep trying for a while.

I could not get managed updates via http request to work. I read through all online documentation on the topic and related topics. I even tried to look through the source code etc.

As a last resort I forced it to update, but then it kept telling me, “[E][http_request.ota:262]: URL is invalid and/or must be prefixed with ‘http://’ or ‘https://’ and [E][http_request.ota:047]: URL not set; cannot start update”

This was bogus, as I checked all my URLs (paths etc) multiple times and even tested the links manually - all were correct and working and accessible.

I ended up using “ota.http_request.flash” that I manually trigger by a pin set up as a binary switch. So, I can still remotely compile my yaml file, but the update on the node has to be triggered by me as it never could pick up from the manifest.json file that there was a new version available.

Good day, thank you for sharing your solution.

I added the following to the yaml, but I get an error of …Unable to find action with the name ‘ota.http_request.flash’.

binary_sensor:
- platform: homeassistant
  id: esphomeupdate
  entity_id: input_boolean.esphomeupdate
  on_press:
    then:
      - ota.http_request.flash:
          url: https://example.com/firmware.ota.bin

Any guidance is much appreciated

Mine (a “software” button) looks like this:

ota:
  - platform: esphome
    password: ....
  - platform: http_request #required for remote firmware updating

http_request:  #required for remote firmware updating
  verify_ssl: false

#Software button to trigger the remote firmware update
button:
  - platform: template
    name: Update Firmware Button
    on_press:
      - logger.log: Update triggered, initiating OTA firmware update.
      - ota.http_request.flash:  #required for remote firmware updating
          md5_url: https://myURL/myMD5.md5
          url: https://myURL/firmware.ota.bin

*I removed my real url…

Hi @ynnor666
I got mine to work, but only on my esp32 node and not on my esp8266 node.

New firmware is picked up and Home Assistant shows it. I can then update it like any other updates via HA, but then the firmware version that is displayed is the ESPHome version number and not my firmware version number. So not perfect, but at least I can update it.

Here is my json that works:

{
    "name": "oslo-stoep-camera",
    "version": "2024.10.29",
    "builds": [
        {
            "chipFamily": "ESP8266",
            "ota": {
                "md5": "myMD5...",
                "path": "https://myURL/esphome-updates/oslo-stoep-camera/firmware.ota.bin"
            }
        },
        {
            "chipFamily": "ESP32",
            "ota": {
                "md5": "myMD5...",
                "path": "https://myURL/esphome-updates/oslo-stoep-camera/firmware.ota.bin"
            }
        }
    ]
}