Can't update ESPHome devices using service from HA

Hi!
I’m trying to automate my device updates, but no success.
First, tryied to call update.install using Area (“Telhado”, where some of my devices are assigned)). No succes…no error in logs, but no update at all.

Then, tryied to apply updated using Labels. Testes assigning label to “Device” and to “update.<device_name>_firmware” entities…no success and no error (or any message) in logs.

service: update.install
data: {}
target:
  label_id: esphome_device

But if I call with entity id directly, it works!

service: update.install
data: {}
target:
  entity_id: update.caixa_receptores_firmware

That am I missing?
ESPHome 2024.6.1 (device is using 2024.5.5)
HA 2024.6.3
Supervisor 2024.06.0
OS 12.3
Frontend 20240610.1

Using home assistant Yellow.

That’s a quite dangerous idea and you are going to brick your ESP faster than normal, flash doesn’t have an unlimited number of write cycles :wink:

Why? Are they not working?

How do you plan to handle breaking changes that need re-coding?

1 Like

Tks for the replies, i appreciate the concerns about this automation.

But, if possible, let’s keep on topic with the real problem (or what am I doing wrong): the automation of update for ESPHome devices, that doesn’t work as expected, using a service call and Labels (or areas).

So what logs are shown?

The docs don’t say that anything other than one or more entity IDs is supported in the target:

In that case, this might work:

service: update.install
data: {}
target:
  entity_id: "{{ label_entities('esphome_device') }}"

Nops, didnt worked :frowning:

Failed to call service update.install. template value should be a string @ data['label_id'][0]. Got None

This should Works, right?
Doing {{ label_entities('esphome_device') }} at template section retuns all my entities taged with this label:

['update.caixa_receptores_firmware', 'update.sensores_01_firmware', 'update.medidor_de_agua_firmware', 'update.sensor_uv_firmware', 'update.sensores_03_firmware', 'update.esp32_s3_box_lite_e82328_firmware']

Apologies, I meant to change it to entity_id. Corrected above — try that?

Yep, worked! TKS a Lot!

1 Like