From 37342edfdf6a87d1788eff680c04fd731e612064 Mon Sep 17 00:00:00 2001 From: ccostan Date: Sat, 6 Oct 2018 17:57:58 -0400 Subject: [PATCH] Updated with more logic to prevent multiple runs of light on/off. --- config/automation/garage_entry_light.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/automation/garage_entry_light.yaml b/config/automation/garage_entry_light.yaml index dd651582..1fa1b4bb 100755 --- a/config/automation/garage_entry_light.yaml +++ b/config/automation/garage_entry_light.yaml @@ -14,6 +14,11 @@ entity_id: binary_sensor.mcu1_gpio12 to: 'on' + condition: + - condition: state + entity_id: light.garage_hallway + state: 'off' + action: - service: light.turn_on entity_id: @@ -26,9 +31,13 @@ - platform: state entity_id: binary_sensor.mcu1_gpio12 to: 'off' + for: + seconds: 15 - platform: state entity_id: binary_sensor.kitchen_door_opened to: 'off' + for: + seconds: 15 condition: - condition: state @@ -37,6 +46,9 @@ - condition: state entity_id: binary_sensor.kitchen_door_opened state: 'off' + - condition: state + entity_id: light.garage_hallway + state: 'on' action: service: light.turn_off