From e5bab238874d2e5130ff0affa14a08e7f0afa739 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Tue, 29 Dec 2020 19:33:16 +0100 Subject: [PATCH] Add Bathroom motion automations --- automations/files/bathroom-motion.yaml | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 automations/files/bathroom-motion.yaml diff --git a/automations/files/bathroom-motion.yaml b/automations/files/bathroom-motion.yaml new file mode 100644 index 0000000..0929dfa --- /dev/null +++ b/automations/files/bathroom-motion.yaml @@ -0,0 +1,31 @@ +- id: bathroom-motion-on + alias: Bathroom Motion On + mode: restart + trigger: + - platform: state + entity_id: binary_sensor.bathroom_motion_sensor + from: 'off' + to: 'on' + action: + - service: light.turn_on + entity_id: + - light.bathroom_1 + - light.bathroom_2 + - light.bathroom_3 + - light.bathroom_4 +- id: bathroom-motion-off + alias: Bathroom Motion Off + mode: restart + trigger: + - platform: state + entity_id: binary_sensor.bathroom_motion_sensor + for: '0:01:00' + from: 'on' + to: 'off' + action: + - service: light.turn_off + entity_id: + - light.bathroom_1 + - light.bathroom_2 + - light.bathroom_3 + - light.bathroom_4