1
0
ansible-home-assistant/automations/files/phone-automations.yaml

40 lines
1.1 KiB
YAML
Raw Normal View History

2021-01-11 00:33:27 +00:00
- 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