]
}
]
+ },
+ {
+ "type": "grid",
+ "cards": [
+ {
+ "type": "heading",
+ "heading": "Garage LoRa",
+ "heading_style": "title",
+ "icon": "mdi:garage"
+ },
+ {
+ "type": "vertical-stack",
+ "cards": [
+ {
+ "type": "custom:mushroom-template-card",
+ "primary": "Garage LoRa",
+ "secondary": "{% set online = states('binary_sensor.garage_lora_garage_online') %}\n{% set porta = states('binary_sensor.garage_lora_serranda_garage') %}\n{% set luce = states('light.garage_lora_luce_garage') %}\n\n{% if online != 'on' %}\n Dispositivo Offline\n{% else %}\n Online •\n {% if porta == 'on' %}\n Serranda Aperta •\n {% elif porta == 'off' %}\n Serranda Chiusa •\n {% else %}\n Serranda Sconosciuta •\n {% endif %}\n {% if luce == 'on' %}\n Luce Accesa\n {% elif luce == 'off' %}\n Luce Spenta\n {% else %}\n Luce Sconosciuta\n {% endif %}\n{% endif %}\n",
+ "icon": "mdi:home-import-outline",
+ "icon_color": "{% if is_state('binary_sensor.garage_lora_garage_online','on') %}\n green\n{% else %}\n red\n{% endif %}\n"
+ },
+ {
+ "type": "grid",
+ "columns": 2,
+ "square": false,
+ "cards": [
+ {
+ "type": "tile",
+ "entity": "binary_sensor.garage_lora_garage_online",
+ "name": "Garage Online"
+ },
+ {
+ "type": "tile",
+ "entity": "sensor.garage_lora_garage_last_seen",
+ "name": "Ultimo update"
+ },
+ {
+ "type": "custom:mushroom-template-card",
+ "primary": "Stato Serranda",
+ "secondary": "{% if is_state('binary_sensor.garage_lora_serranda_garage', 'on') %}\n Serranda Aperta\n{% elif is_state('binary_sensor.garage_lora_serranda_garage', 'off') %}\n Serranda Chiusa\n{% else %}\n Stato non disponibile\n{% endif %}\n",
+ "icon": "{% if is_state('binary_sensor.garage_lora_serranda_garage', 'on') %}\n mdi:garage-open\n{% elif is_state('binary_sensor.garage_lora_serranda_garage', 'off') %}\n mdi:garage\n{% else %}\n mdi:garage-alert\n{% endif %}\n",
+ "icon_color": "{% if is_state('binary_sensor.garage_lora_serranda_garage', 'on') %}\n orange\n{% elif is_state('binary_sensor.garage_lora_serranda_garage', 'off') %}\n green\n{% else %}\n red\n{% endif %}\n",
+ "tap_action": {
+ "action": "none"
+ }
+ },
+ {
+ "type": "tile",
+ "entity": "sensor.garage_lora_batteria_sensore_porta",
+ "name": "Batteria Sensore"
+ },
+ {
+ "type": "tile",
+ "entity": "light.garage_lora_luce_garage",
+ "name": "Luce Garage",
+ "tap_action": {
+ "action": "toggle"
+ },
+ "features_position": "bottom"
+ },
+ {
+ "type": "tile",
+ "entity": "button.garage_lora_pulsante_serranda_garage",
+ "name": "Serranda Garage",
+ "icon": "mdi:garage",
+ "tap_action": {
+ "action": "call-service",
+ "service": "button.press",
+ "target": {
+ "entity_id": "button.garage_lora_pulsante_serranda_garage"
+ }
+ },
+ "features_position": "bottom"
+ }
+ ]
+ },
+ {
+ "type": "custom:mushroom-template-card",
+ "primary": "Manutenzione",
+ "icon": "mdi:cog",
+ "tap_action": {
+ "action": "none"
+ }
+ },
+ {
+ "type": "horizontal-stack",
+ "cards": [
+ {
+ "type": "custom:mushroom-template-card",
+ "primary": "Riavvia Bridge",
+ "icon": "mdi:restart",
+ "tap_action": {
+ "action": "call-service",
+ "service": "button.press",
+ "target": {
+ "entity_id": "button.garage_lora_riavvia_bridge_lora"
+ }
+ }
+ },
+ {
+ "type": "custom:mushroom-template-card",
+ "primary": "Riavvia Garage",
+ "icon": "mdi:restart",
+ "tap_action": {
+ "action": "call-service",
+ "service": "button.press",
+ "target": {
+ "entity_id": "button.garage_lora_riavvia_garage"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "custom:mushroom-template-card",
+ "primary": "Shelly EM",
+ "secondary": "Apri interfaccia web",
+ "icon": "mdi:web",
+ "icon_color": "blue",
+ "tap_action": {
+ "action": "url",
+ "url_path": "https://shellyem.giorgioravera.it"
+ }
+ }
+ ]
+ }
+ ]
}
],
"max_columns": 3,
# entity_id: light.luce_trono
mode: restart
+
+######################################################################
+# Bathroom Light: Switch on Lights
+#
+# Actions:
+# - light.turn_on
+######################################################################
+- alias: "Accendi luce studio se occupato e casa non vuota"
+ id: "accendi_luci_presenza_studio"
+
+ description: >
+ If someone is at home, the office is occupied,
+ the sun is low, and it is between 3:00 p.m. and 5:00 a.m.,
+ turn on the light in the large bathroom and turn it off after a while.
+
+ triggers:
+ - trigger: state
+ entity_id: binary_sensor.sensore_presenza_studio_occupancy
+ to: "on"
+
+ conditions:
+ - condition: state
+ entity_id: group.residents
+ state: "home"
+ - condition: state
+ entity_id: light.luce_studio
+ state: "off"
+ - condition: numeric_state
+ entity_id: sun.sun
+ attribute: elevation
+ below: 1
+
+ actions:
+ - service: light.turn_on
+ target:
+ entity_id: light.luce_studio
+
+ # Wait 10 minutes before checking if the light should be turned off
+ - delay: "00:10:00"
+
+ # Turn off only if there is no more presence in the bathroom
+ - condition: state
+ entity_id: binary_sensor.sensore_presenza_studio_occupancy
+ state: "off"
+
+ - service: light.turn_off
+ target:
+ entity_id: light.luce_studio
+
+ mode: restart