|
@@ -72,19 +72,37 @@ sensor:
|
|
|
script:
|
|
script:
|
|
|
lights_off:
|
|
lights_off:
|
|
|
sequence:
|
|
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
|
|
- service: homeassistant.turn_off
|
|
|
entity_id: switch.wenzhou_tkb_0
|
|
entity_id: switch.wenzhou_tkb_0
|
|
|
- service: homeassistant.turn_off
|
|
- service: homeassistant.turn_off
|
|
|
entity_id: switch.wenzhou_tkb_1
|
|
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:
|
|
lights_on:
|
|
|
sequence:
|
|
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
|
|
- service: homeassistant.turn_on
|
|
|
entity_id: switch.wenzhou_tkb_0
|
|
entity_id: switch.wenzhou_tkb_0
|
|
|
- service: homeassistant.turn_on
|
|
- service: homeassistant.turn_on
|
|
@@ -99,66 +117,75 @@ automation:
|
|
|
action:
|
|
action:
|
|
|
- service: script.lights_off
|
|
- service: script.lights_off
|
|
|
|
|
|
|
|
- - alias: Turn on lights (time)
|
|
|
|
|
|
|
+ - alias: Turn on lights (solar)
|
|
|
|
|
+ # 30 min past sunset
|
|
|
trigger:
|
|
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:
|
|
action:
|
|
|
- service: script.lights_on
|
|
- service: script.lights_on
|
|
|
|
|
|
|
|
- # - alias: Log motion detection status
|
|
|
|
|
- # initial_state: false
|
|
|
|
|
- # trigger:
|
|
|
|
|
- # platform: event
|
|
|
|
|
- # event_type: time_changed
|
|
|
|
|
- # condition:
|
|
|
|
|
- # condition: template
|
|
|
|
|
- # value_template: "{{ now().second % 10 == 0 }}"
|
|
|
|
|
- # action:
|
|
|
|
|
- # - service: system_log.write
|
|
|
|
|
- # data_template:
|
|
|
|
|
- # message: "sensor.aeotec_multisensor_6_burglar state: {{ states('sensor.aeotec_multisensor_6_burglar') }}"
|
|
|
|
|
|
|
+ - alias: Log motion detection status
|
|
|
|
|
+ initial_state: false
|
|
|
|
|
+ trigger:
|
|
|
|
|
+ platform: event
|
|
|
|
|
+ event_type: time_changed
|
|
|
|
|
+ condition:
|
|
|
|
|
+ condition: template
|
|
|
|
|
+ value_template: "{{ now().second % 10 == 0 }}"
|
|
|
|
|
+ action:
|
|
|
|
|
+ - service: system_log.write
|
|
|
|
|
+ data_template:
|
|
|
|
|
+ message: "sensor.aeon_labs_zw100_multisensor_6_burglar state: {{ states('sensor.aeon_labs_zw100_multisensor_6_burglar') }}"
|
|
|
|
|
|
|
|
- # - alias: Turn on lights (motion)
|
|
|
|
|
- # initial_state: true
|
|
|
|
|
- # trigger:
|
|
|
|
|
- # - platform: state
|
|
|
|
|
- # entity_id: sensor.aeotec_multisensor_6_burglar
|
|
|
|
|
- # from: "0"
|
|
|
|
|
- # to: "8"
|
|
|
|
|
- # - platform: state
|
|
|
|
|
- # entity_id: sensor.aeotec_multisensor_6_burglar
|
|
|
|
|
- # from: "3"
|
|
|
|
|
- # to: "8"
|
|
|
|
|
- # condition:
|
|
|
|
|
- # - condition: numeric_state
|
|
|
|
|
- # entity_id: sensor.solar_angle
|
|
|
|
|
- # below: 0
|
|
|
|
|
- # action:
|
|
|
|
|
- # - service: script.lights_on
|
|
|
|
|
|
|
+ - alias: Turn on lights (motion)
|
|
|
|
|
+ initial_state: true
|
|
|
|
|
+ trigger:
|
|
|
|
|
+ - platform: state
|
|
|
|
|
+ entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
|
|
|
|
|
+ from: "0"
|
|
|
|
|
+ to: "8"
|
|
|
|
|
+ - platform: state
|
|
|
|
|
+ entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
|
|
|
|
|
+ from: "3"
|
|
|
|
|
+ to: "8"
|
|
|
|
|
+ condition:
|
|
|
|
|
+ - condition: numeric_state
|
|
|
|
|
+ entity_id: sensor.solar_angle
|
|
|
|
|
+ below: 0
|
|
|
|
|
+ action:
|
|
|
|
|
+ - service: script.lights_on_partial
|
|
|
|
|
|
|
|
- # - alias: Turn off lights (no motion)
|
|
|
|
|
- # initial_state: true
|
|
|
|
|
- # trigger:
|
|
|
|
|
- # - platform: state
|
|
|
|
|
- # entity_id: sensor.aeotec_multisensor_6_burglar
|
|
|
|
|
- # from: "8"
|
|
|
|
|
- # to: "0"
|
|
|
|
|
- # for:
|
|
|
|
|
- # minutes: 1
|
|
|
|
|
- # - platform: state
|
|
|
|
|
- # entity_id: sensor.aeotec_multisensor_6_burglar
|
|
|
|
|
- # from: "3"
|
|
|
|
|
- # to: "0"
|
|
|
|
|
- # for:
|
|
|
|
|
- # minutes: 1
|
|
|
|
|
- # condition:
|
|
|
|
|
- # - condition: time
|
|
|
|
|
- # after: '23:30:00'
|
|
|
|
|
- # before: '19:00:00'
|
|
|
|
|
- # action:
|
|
|
|
|
- # - service: script.lights_off
|
|
|
|
|
|
|
+ - alias: Turn off lights (no motion)
|
|
|
|
|
+ initial_state: true
|
|
|
|
|
+ trigger:
|
|
|
|
|
+ - platform: state
|
|
|
|
|
+ entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
|
|
|
|
|
+ from: "8"
|
|
|
|
|
+ to: "0"
|
|
|
|
|
+ for:
|
|
|
|
|
+ minutes: 3
|
|
|
|
|
+ - platform: state
|
|
|
|
|
+ entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
|
|
|
|
|
+ from: "3"
|
|
|
|
|
+ to: "0"
|
|
|
|
|
+ for:
|
|
|
|
|
+ minutes: 3
|
|
|
|
|
+ condition:
|
|
|
|
|
+ - condition: time
|
|
|
|
|
+ after: '00:30:00'
|
|
|
|
|
+ before: '08:00:00'
|
|
|
|
|
+ action:
|
|
|
|
|
+ - service: script.lights_off
|
|
|
|
|
|
|
|
|
|
|
|
|
# - alias: water immersion (weekdays)
|
|
# - alias: water immersion (weekdays)
|
|
@@ -183,11 +210,11 @@ automation:
|
|
|
# initial_state: true
|
|
# initial_state: true
|
|
|
# trigger:
|
|
# trigger:
|
|
|
# - platform: state
|
|
# - platform: state
|
|
|
- # entity_id: sensor.aeotec_multisensor_6_burglar
|
|
|
|
|
|
|
+ # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
|
|
|
# from: "0"
|
|
# from: "0"
|
|
|
# to: "8"
|
|
# to: "8"
|
|
|
# - platform: state
|
|
# - platform: state
|
|
|
- # entity_id: sensor.aeotec_multisensor_6_burglar
|
|
|
|
|
|
|
+ # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
|
|
|
# from: "3"
|
|
# from: "3"
|
|
|
# to: "8"
|
|
# to: "8"
|
|
|
# action:
|
|
# action:
|
|
@@ -202,13 +229,13 @@ automation:
|
|
|
# initial_state: true
|
|
# initial_state: true
|
|
|
# trigger:
|
|
# trigger:
|
|
|
# - platform: state
|
|
# - platform: state
|
|
|
- # entity_id: sensor.aeotec_multisensor_6_burglar
|
|
|
|
|
|
|
+ # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
|
|
|
# from: "8"
|
|
# from: "8"
|
|
|
# to: "0"
|
|
# to: "0"
|
|
|
# for:
|
|
# for:
|
|
|
# minutes: 2
|
|
# minutes: 2
|
|
|
# - platform: state
|
|
# - platform: state
|
|
|
- # entity_id: sensor.aeotec_multisensor_6_burglar
|
|
|
|
|
|
|
+ # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
|
|
|
# from: "3"
|
|
# from: "3"
|
|
|
# to: "0"
|
|
# to: "0"
|
|
|
# for:
|
|
# for:
|