Updated with more logic to prevent multiple runs of light on/off.

This commit is contained in:
ccostan 2018-10-06 17:57:58 -04:00
parent e1090c46a5
commit 37342edfdf
1 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,11 @@
entity_id: binary_sensor.mcu1_gpio12 entity_id: binary_sensor.mcu1_gpio12
to: 'on' to: 'on'
condition:
- condition: state
entity_id: light.garage_hallway
state: 'off'
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: entity_id:
@ -26,9 +31,13 @@
- platform: state - platform: state
entity_id: binary_sensor.mcu1_gpio12 entity_id: binary_sensor.mcu1_gpio12
to: 'off' to: 'off'
for:
seconds: 15
- platform: state - platform: state
entity_id: binary_sensor.kitchen_door_opened entity_id: binary_sensor.kitchen_door_opened
to: 'off' to: 'off'
for:
seconds: 15
condition: condition:
- condition: state - condition: state
@ -37,6 +46,9 @@
- condition: state - condition: state
entity_id: binary_sensor.kitchen_door_opened entity_id: binary_sensor.kitchen_door_opened
state: 'off' state: 'off'
- condition: state
entity_id: light.garage_hallway
state: 'on'
action: action:
service: light.turn_off service: light.turn_off