1
0
ansible-home-assistant/automations/phone-automations.yaml
2021-05-24 20:26:03 +02:00

41 lines
1.4 KiB
YAML

- id: phone-sleep-as-android
alias: '[Phone] Sleep as Android'
mode: single
trigger:
- platform: webhook
webhook_id: 56af98df-9477-431d-a38c-9cd42bc1c512
action:
- choose:
- conditions:
- condition: device
device_id: c76e890aeaf8b90472ce178076298aad
domain: device_tracker
entity_id: device_tracker.sm_g965f
type: is_home
- condition: template
value_template: '{{ trigger.json.event == ''sleep_tracking_started'' }}'
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
value_template: '{{ trigger.json.event == ''sleep_tracking_stopped'' }}'
sequence:
- service: notify.mobile_app_sm_g965f
data:
message: Sleep automation
- service: script.good_morning
default:
- service: notify.mobile_app_sm_g965f
data:
title: 'Sleep As Android automation'
message: 'Unknown event: {{ trigger.json }} '