Home-AssistantConfig/automation/announcements.yaml

40 lines
1.2 KiB
YAML
Raw Normal View History

######################################################################
## Announce when people come or go.
## Announce over all Chromecast Audios
######################################################################
- alias: 'State Announcements'
trigger:
- platform: state
entity_id:
- device_tracker.carlo
- device_tracker.stacey
- device_tracker.franco
- device_tracker.yolanda
- device_tracker.joyce_ipad
from: 'home'
to: 'not_home'
- platform: state
entity_id:
- device_tracker.carlo
- device_tracker.stacey
- device_tracker.franco
- device_tracker.yolanda
- device_tracker.joyce_ipad
from: 'not_home'
to: 'home'
2017-02-04 22:52:11 +00:00
for: '00:02:00'
- platform: state
entity_id:
- cover.garadget_large
- cover.garadget_small
from: 'closed'
to: 'open'
2017-02-04 22:52:11 +00:00
for: '00:02:00'
action:
- service: script.Voice_notify
2017-02-04 22:52:11 +00:00
data_template:
value1: "{{ trigger.entity_id.split('.')[1]|replace('_', ' ')|replace('garadget large', 'The large garage ')|replace('garadget small', 'The small garage ') }} is {{ (trigger.to_state.state)|replace('_', ' ') }}"