From ccf646b7b7979d49f121c3d9469ee0b731f67eb4 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Mon, 11 Jan 2021 01:33:27 +0100 Subject: [PATCH] Add phone automations --- automations/files/phone-automations.yaml | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 automations/files/phone-automations.yaml diff --git a/automations/files/phone-automations.yaml b/automations/files/phone-automations.yaml new file mode 100644 index 0000000..9aca129 --- /dev/null +++ b/automations/files/phone-automations.yaml @@ -0,0 +1,39 @@ +- id: phone-sleep-start + alias: '[Phone] Sleep start' + mode: single + trigger: + - platform: webhook + webhook_id: 56af98df-9477-431d-a38c-9cd42bc1c512 + condition: + - condition: template + value_template: '{{ trigger.event.data.event == ''SLEEP_TRACKING_STARTED'' }}' + - condition: device + device_id: c76e890aeaf8b90472ce178076298aad + domain: device_tracker + entity_id: device_tracker.sm_g965f + type: is_home + action: + - service: script.goodnight + - service: notify.mobile_app_sm_g965f + data: + message: Sleep automation + +- id: phone-sleep-end + alias: '[Phone] Sleep end' + mode: single + trigger: + - platform: webhook + webhook_id: 56af98df-9477-431d-a38c-9cd42bc1c512 + condition: + - condition: template + value_template: '{{ trigger.event.data.event == ''SLEEP_TRACKING_STOPPED'' }}' + - condition: device + device_id: c76e890aeaf8b90472ce178076298aad + domain: device_tracker + entity_id: device_tracker.sm_g965f + type: is_home + action: + - service: script.goodmorning + - service: notify.mobile_app_sm_g965f + data: + message: Sleep automation