Hi,
with the new button entity it’s quite easy to show all shelly devices which need an update, and display the button to click.
Prerequisites:
Installed auto-entities
Naming of the button entity and binary_sensor entity which is on whenever a firmware update is available is similar (e.g. button.devicename_ota_update → binary_sensor.devicename_firmware_update)
Native Shelly integration (not tested with Shelly4Hass)
Code:
card:
show_header_toggle: false
title: Shelly need update
type: entities
filter:
template: |-
{%- for state in states.binary_sensor -%}
{%- if state.entity_id | regex_match("binary_sensor.*firmware", ignorecase=False) -%}
{%- if is_state(state.entity_id,"on") -%}
{{
{
'entity': state.entity_id|replace("binary_sensor","button")|replace("firmware","ota"),
'name': "Update "~state.attributes.friendly_name.split('Firmware')[0]
}
}},
{%- endif -%}
{%- endif -%}
{%- endfor -%}
type: custom:auto-entities
(Credits also to @Ildar_Gabdullin who helped me with this code snippet in a different problem. I adjusted it to this purpose.)
It just replaces the binary_sensor prefix with button, and firmware with ota.
It’s not the best code, but maybe somebody finds it useful
Thanks a lot @Ramblurr it works perfectly !
I now have a list of my Shelly devices that need to be updated
I’m now just wondering if it’s possible to also add a single button to launch every update on each Shelly automatically, based on this list?