]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Added shelly lora integration for garage
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 27 Oct 2026 10:23:46 +0000 (11:23 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 27 Oct 2026 10:42:43 +0000 (11:42 +0100)
.storage/lovelace.lovelace
.storage/lovelace.lovelace_devices
README.md
automations/lights.yaml
components/google_assistant/lights.yaml
configuration.yaml

index de559ee3ae084f5e0cc7b6c302ddcc769db28620..8210c50614cec0924380d7dca9b42c633d3cc480 100644 (file)
                   ]
                 }
               ]
+            },
+            {
+              "type": "grid",
+              "cards": [
+                {
+                  "type": "heading",
+                  "heading": "Garage",
+                  "heading_style": "title",
+                  "icon": "mdi:garage"
+                },
+                {
+                  "features": [
+                    {
+                      "type": "toggle"
+                    }
+                  ],
+                  "entity": "light.garage_lora_luce_garage",
+                  "name": "Luce Garage",
+                  "type": "tile",
+                  "features_position": "bottom",
+                  "vertical": false,
+                  "hide_state": true
+                }
+              ]
             }
           ],
           "max_columns": 3
index 06b6cd00a5be9f43456458ac731269baf9ae59f5..5868fc6dd7fcf4db97bc33e43875b4cf065b22f4 100644 (file)
                   ]
                 }
               ]
+            },
+            {
+              "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,
index 64df82f4afb068cf3104dfcb06a9768f44497f8b..321dead0e974f0568238c196789c3932545ba01a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ My server is an Intel NUC (NUC10i5FNH) with [Proxmox Virtual Environment](https:
 * Mitsubishi Air Conditioning (MSZ-LN25VG2V, MSZ-LN35VG2V)
 * Proxmox
 * QNAP NAS (TS-228A)
-* Shelly (ShellyEM Gen4)
+* Shelly (ShellyEM Gen4 & Shelly 2PM Gen4)
 * Sony Android TV (KD-55XF8596)
 * Xiaomi (MiJia door & window contact sensor, MiJia temperature & humidity sensor)
 
index 550c529249ea71309eebb76fa5f832fd76dc2a0b..02b2ad732db895ce50e3054dba23d065feff2268 100644 (file)
     #    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
index afdb14ee94b131b3d73199532f30ed5430e5a5eb..319f28c01b59da05c856f2a2c56f6ae615ed0cfe 100644 (file)
@@ -44,3 +44,7 @@ light.luce_camera:
 light.luce_balcone:
   expose: true
   room: Balcone
+light.garage_lora_luce_garage:
+  name: Luce Garage
+  expose: true
+  room: Garage
index 657e4f80ac90bba2585eab887fd78ba365319f18..3db97bed40edc0d2aa626079d44c4b285acbf0ea 100644 (file)
@@ -53,7 +53,7 @@ usage_prediction:
 
 # Enables the frontend
 frontend:
-  themes: !include_dir_merge_named themes
+  themes: !include_dir_merge_named themes/
 
 # File integration to read from and write to text files in support of system sensors, scripts, and automations.
 # file: