Parcourir la source

add new lights; shift motion-detection action to partial lights-on

Martin il y a 5 ans
Parent
commit
51a67d618d
1 fichiers modifiés avec 41 ajouts et 14 suppressions
  1. 41 14
      hass/confs/configuration.yaml

+ 41 - 14
hass/confs/configuration.yaml

@@ -72,19 +72,37 @@ sensor:
 script:
   lights_off:
     sequence:
-      - service: system_log.write
-        data:
-          message: "***** Turning off the lights"
+      # - service: system_log.write
+      #   data:
+      #     message: "***** Turning off the lights"
       - service: homeassistant.turn_off
         entity_id: switch.wenzhou_tkb_0
       - service: homeassistant.turn_off
         entity_id: switch.wenzhou_tkb_1
+      - service: homeassistant.turn_off
+        entity_id: switch.wenzhou_tkb_2
+      - service: homeassistant.turn_off
+        entity_id: switch.wenzhou_tkb_3
 
   lights_on:
     sequence:
-      - service: system_log.write
-        data:
-          message: "***** Turning on the lights"
+      # - service: system_log.write
+      #   data:
+      #     message: "***** Turning on the lights"
+      - service: homeassistant.turn_on
+        entity_id: switch.wenzhou_tkb_0
+      - service: homeassistant.turn_on
+        entity_id: switch.wenzhou_tkb_1
+      - service: homeassistant.turn_on
+        entity_id: switch.wenzhou_tkb_2
+      - service: homeassistant.turn_on
+        entity_id: switch.wenzhou_tkb_3
+
+  lights_on_partial:
+    sequence:
+      # - service: system_log.write
+      #   data:
+      #     message: "***** Turning on the lights"
       - service: homeassistant.turn_on
         entity_id: switch.wenzhou_tkb_0
       - service: homeassistant.turn_on
@@ -99,11 +117,20 @@ automation:
     action:
       - service: script.lights_off
 
-  - alias: Turn on lights (time)
+  - alias: Turn on lights (solar)
+    # 30 min past sunset
     trigger:
-      platform: time_pattern
-      hours: '16'
-      minutes: '00'
+      platform: sun
+      event: sunset
+      offset: "00:30:00"
+    # trigger:
+    #   platform: time_pattern
+    #   hours: '16'
+    #   minutes: '00'
+    # condition:
+    #   - condition: numeric_state
+    #     entity_id: sensor.solar_angle
+    #     below: 0
     action:
       - service: script.lights_on
 
@@ -136,7 +163,7 @@ automation:
         entity_id: sensor.solar_angle
         below: 0
     action:
-      - service: script.lights_on
+      - service: script.lights_on_partial
 
   - alias: Turn off lights (no motion)
     initial_state: true
@@ -146,17 +173,17 @@ automation:
         from: "8"
         to: "0"
         for:
-          minutes: 1
+          minutes: 3
       - platform: state
         entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
         from: "3"
         to: "0"
         for:
-          minutes: 1
+          minutes: 3
     condition:
       - condition: time
         after: '00:30:00'
-        before: '19:00:00'
+        before: '08:00:00'
     action:
       - service: script.lights_off