From f1c6d7a48c9fb99d847490585acdda4eacbbec2f Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Thu, 5 Mar 2020 11:49:11 +0200 Subject: [PATCH] Initial version of presence detection automation --- automation/presence.yaml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/automation/presence.yaml b/automation/presence.yaml index 5975f52..de478a0 100644 --- a/automation/presence.yaml +++ b/automation/presence.yaml @@ -1,20 +1,27 @@ +# When my state changes to "home", wait for 15 minutes for the door to be opened, and then mark me as home - id: arrival_detecion alias: Presence - Arrival Detection trigger: - - platform: state - entity_id: binary_sensor.front_door_on_off - to: "on" + platform: state + entity_id: person.georgi + to: "home" condition: - - condition: state - entity_id: input_boolean.georgi_home - state: "off" + condition: state + entity_id: input_boolean.georgi_home + state: "off" action: - service: script.telegram_say data: - message: "Georgi is home" + message: "Device marked as home. Waiting for door to open!" + - wait_template: "{{ is_state('binary_sensor.front_door_on_off', 'on') }}" + continue_on_timeout: false + timeout: 00:15:00 - service: input_boolean.turn_on entity_id: input_boolean.georgi_home + - service: script.telegram_say + data: + message: "Hey, I've marked you as home now!" - id: leaving_home alias: Presence - Leaving home