]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Limited door light automation no early that 3pm.
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 21 Feb 2022 20:44:56 +0000 (21:44 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 21 Feb 2022 20:53:26 +0000 (21:53 +0100)
automations/doors.yaml

index 91064b827a1c6ecbcf428b69448ad2f6d437d8ab..7bc373fda4702bbabe212684ee3b7b7d045a6aa0 100644 (file)
       entity_id: binary_sensor.porta_casa_contact
       to: 'on'
 
-  condition: "{{ (state_attr('sun.sun', 'elevation') | int) < 1 }}"
+  condition:
+    condition: and
+    conditions:
+      - condition: numeric_state
+        entity_id: sun.sun
+        value_template: "{{ state.attributes.elevation }}"
+        below: 1
+      - condition: time
+        after: "15:00:00"
+        before: "05:00:00"
+
 
   action:
     - delay: 00:00:01