From bcc3a5a15a31097e43b3e7ee6e752074652ca35e Mon Sep 17 00:00:00 2001 From: ChNussbaum Date: Sun, 9 Feb 2020 15:06:10 -0600 Subject: [PATCH] Fix off trigger for basement bathroom fan Try to speed up on trigger for basement bathroom light --- basement_bathroom_sensor.yaml | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/basement_bathroom_sensor.yaml b/basement_bathroom_sensor.yaml index ecf3c6f..f88fdc4 100644 --- a/basement_bathroom_sensor.yaml +++ b/basement_bathroom_sensor.yaml @@ -40,28 +40,6 @@ binary_sensor: pin: number: D0 mode: INPUT_PULLDOWN_16 - - - platform: template - id: motion_delay_30s - lambda: return id(motion).state; - filters: - - delayed_off: 30s - - - platform: template - id: motion_delay_20m - lambda: return id(motion).state; - filters: - - delayed_off: 20min - - - platform: template - id: trigger_motion - lambda: |- - if (id(door).state) { - return id(motion_delay_30s).state; - } - else { - return id(motion_delay_20m).state; - } on_press: then: - if: @@ -84,6 +62,28 @@ binary_sensor: service: homeassistant.turn_on data: entity_id: switch.basement_shower_light + + - platform: template + id: motion_delay_30s + lambda: return id(motion).state; + filters: + - delayed_off: 30s + + - platform: template + id: motion_delay_20m + lambda: return id(motion).state; + filters: + - delayed_off: 20min + + - platform: template + id: trigger_motion + lambda: |- + if (id(door).state) { + return id(motion_delay_30s).state; + } + else { + return id(motion_delay_20m).state; + } on_release: then: - homeassistant.service: @@ -127,7 +127,7 @@ binary_sensor: - homeassistant.service: service: homeassistant.turn_off data: - entity_id: switch.basement_bathroom_fan + entity_id: fan.basement_bathroom_fan - platform: homeassistant id: day_night