"type": "tile",
"entity": "script.shelly_upgrade",
"name": "Aggiorna Tutto",
- "icon": "mdi:package-up",
"tap_action": {
"action": "call-service",
"service": "script.shelly_upgrade"
"type": "tile",
"entity": "script.shelly_reboot",
"name": "Riavvia tutto",
- "icon": "mdi:restart",
"tap_action": {
"action": "call-service",
"service": "script.shelly_reboot"
}
+ },
+ {
+ "type": "tile",
+ "entity": "script.shelly_force_state_update",
+ "name": "Aggiorna Stato Dispositivi",
+ "tap_action": {
+ "action": "call-service",
+ "service": "script.shelly_force_state_update"
+ }
}
]
}
-######################################################################\r
-# Update Notification: Shelly\r
-######################################################################\r
-\r
-- alias: "Update Notification: Shelly"\r
-\r
- trigger:\r
- - platform: state\r
- entity_id: group.shelly\r
- to: 'on'\r
-\r
- - platform: homeassistant\r
- event: start\r
-\r
- condition:\r
- condition: state\r
- entity_id: group.shelly\r
- state: 'on'\r
-\r
- action:\r
- - delay: '00:00:10'\r
- - service: script.notify_text\r
- data_template:\r
- title: "Shelly - Aggiornamento"\r
- message: >\r
- Sono disponibili aggiornamenti per i dispositivi Shelly:\r
- {%- for entity_id in states.group.shelly.attributes.entity_id -%}\r
- {% if is_state(entity_id, 'on') %}\r
- -> {{ state_attr(entity_id, 'friendly_name')|replace(" - Aggiornamento Firmware", "") }}: {{ state_attr(entity_id, 'latest_version') }}\r
- {%- endif -%}\r
- {%- endfor -%}\r
- notification_id: "update"\r
- enable_persistent: true\r
-\r
- - service: input_boolean.turn_on\r
- entity_id: input_boolean.update_shelly\r
-\r
######################################################################\r
# Update Notification: HACS\r
######################################################################\r
######################################################################\r
-# Update: Home Assistant \r
+# Update: Home Assistant\r
######################################################################\r
\r
update_homeassistant:\r
icon: mdi:cellphone-arrow-down\r
\r
######################################################################\r
-# Update: Shelly \r
+# Update: Shelly\r
######################################################################\r
\r
update_shelly:\r
icon: mdi:cellphone-arrow-down\r
\r
######################################################################\r
-# Update: HACS \r
+# Update: HACS\r
######################################################################\r
\r
update_hacs:\r
icon: mdi:package-up
script.shelly_reboot:
icon: mdi:restart
+ script.shelly_force_state_update:
+ icon: mdi:update
# Shelly 1 - Tapparella Cucina (shellyswitch_55980f)
sensor.tapparella_cucina_energy:
shelly_upgrade:
alias: "Shelly: Aggiornamento Firmware Collettivo"
sequence:
- # - service: mqtt.publish
- # data:
- # topic: 'shellies/command'
- # payload: 'update_fw'
- # qos: 0
- # retain: false
- - service: update.install
- target:
- entity_id:
- - group.shelly
+ - service: mqtt.publish
+ data:
+ topic: 'shellies/command'
+ payload: 'update_fw'
+ qos: 0
+ retain: false
+ # - service: update.install
+ # target:
+ # entity_id:
+ # - group.shelly
######################################################################
# Shelly: Reboot
sequence:
- service: shell_command.shelly_reboot
+ ######################################################################
+ # Shelly: Force State Update
+ ######################################################################
+ shelly_force_state_update:
+ alias: "Shelly: Aggiornamento stato dispositivi"
+ sequence:
+ - service: mqtt.publish
+ data:
+ payload: update
+ topic: shellies/command
+
+automation:
+ ######################################################################
+ # Shelly: Update Notification
+ ######################################################################
+ - alias: "Shelly: Update Notification"
+
+ trigger:
+ - platform: state
+ entity_id: group.shelly
+ to: 'on'
+ - platform: homeassistant
+ event: start
+
+ condition:
+ condition: state
+ entity_id: group.shelly
+ state: 'on'
+
+ action:
+ - delay: '00:00:10'
+ - service: script.notify_text
+ data_template:
+ title: "Shelly - Aggiornamento"
+ message: >
+ Sono disponibili aggiornamenti per i dispositivi Shelly:
+ {%- for entity_id in states.group.shelly.attributes.entity_id -%}
+ {% if is_state(entity_id, 'on') %}
+ -> {{ state_attr(entity_id, 'friendly_name')|replace(" - Aggiornamento Firmware", "") }}: {{ state_attr(entity_id, 'latest_version') }}
+ {%- endif -%}
+ {%- endfor -%}
+ notification_id: "update"
+ enable_persistent: true
+ - service: input_boolean.turn_on
+ entity_id: input_boolean.update_shelly
+
+ ######################################################################
+ # Shelly: Force State Update at Startup
+ ######################################################################
+ - alias: "Shelly - Startup: Aggiornamento stati"
+
+ trigger:
+ - event: start
+ platform: homeassistant
+
+ action:
+ service: script.shelly_force_state_update
+
######################################################################
# Shelly Package - Operations Shell Command
######################################################################