2021-04-12 15:32:28 +00:00
|
|
|
- id: phone-sleep-as-android
|
|
|
|
alias: '[Phone] Sleep as Android'
|
2021-01-11 00:33:27 +00:00
|
|
|
mode: single
|
|
|
|
trigger:
|
|
|
|
- platform: webhook
|
|
|
|
webhook_id: 56af98df-9477-431d-a38c-9cd42bc1c512
|
|
|
|
action:
|
2021-04-12 15:32:28 +00:00
|
|
|
- choose:
|
|
|
|
- conditions:
|
|
|
|
- condition: device
|
|
|
|
device_id: c76e890aeaf8b90472ce178076298aad
|
|
|
|
domain: device_tracker
|
|
|
|
entity_id: device_tracker.sm_g965f
|
|
|
|
type: is_home
|
|
|
|
- condition: template
|
2021-04-17 10:35:50 +00:00
|
|
|
value_template: '{{ trigger.json.event == ''sleep_tracking_started'' }}'
|
2021-04-12 15:32:28 +00:00
|
|
|
sequence:
|
|
|
|
- service: notify.mobile_app_sm_g965f
|
|
|
|
data:
|
|
|
|
message: Sleep automation
|
|
|
|
- service: script.good_night
|
|
|
|
- conditions:
|
|
|
|
- condition: device
|
|
|
|
device_id: c76e890aeaf8b90472ce178076298aad
|
|
|
|
domain: device_tracker
|
|
|
|
entity_id: device_tracker.sm_g965f
|
|
|
|
type: is_home
|
|
|
|
- condition: template
|
2021-04-17 10:35:50 +00:00
|
|
|
value_template: '{{ trigger.json.event == ''sleep_tracking_stopped'' }}'
|
2021-04-12 15:32:28 +00:00
|
|
|
sequence:
|
|
|
|
- service: notify.mobile_app_sm_g965f
|
|
|
|
data:
|
|
|
|
message: Sleep automation
|
|
|
|
- service: script.good_morning
|
|
|
|
default:
|
|
|
|
- service: notify.mobile_app_sm_g965f
|
|
|
|
data:
|
2021-04-17 10:35:50 +00:00
|
|
|
title: 'Sleep As Android automation'
|
|
|
|
message: 'Unknown event: {{ trigger.json }} '
|
2021-01-11 00:33:27 +00:00
|
|
|
|