Occupants State Change Alert

With the latest syntax (introduced in 0.19), I manage to shrink down my automation to alert me when someone is back or away to this…

- alias: 'Occupants State Change Alert'
  trigger:
    platform: state
    entity_id: device_tracker.ben, device_tracker.leia, device_tracker.luke, device_tracker.han, device_tracker.chewy
  action:
    service: notify.notify
    data_template:
      message: >
        {{ trigger.entity_id|replace('device_tracker.', '')|capitalize }} is {% if trigger.to_state.state == 'home' %}back{% else %}away{% endif %}.
      title: ""
6 Likes

can you use the Group.all.devices in place of your entity_id?

Thanks for sharing, I hope to try your example soon.

Calvin