Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - id: 'test_anybody_home'
- alias: 'Test: Somebody returns home'
- description: ''
- trigger:
- event_type: state_changed
- platform: event
- condition:
- - condition: template
- # Only look at persons who changes state from 'not_home' to 'home'
- value_template: >
- {{ trigger.event.data.entity_id.startswith('person.')
- and trigger.event.data.old_state is not none
- and trigger.event.data.old_state.state == 'not_home'
- and trigger.event.data.new_state is not none
- and trigger.event.data.new_state.state == 'home' }}
- action:
- - data:
- message: Somebody is now home
- service: notify.notify
- mode: single
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement