I have a setup with 8 different zones, and 5 persons.
But the difficulty is, I have to make an automation for each zone and each person entering or leaving each zones.
How could I make one automation with the different zones, all in one?
An example for the automations I have now:
`alias: j arrives at sportclub
trigger:
platform: zone
entity_id: device_tracker.j_gps
zone: zone.sportclub # Event is either enter or leave
event: enter # or “leave”
action:
service: notify.telegram_f
data:
message: 'j arrived at his sportsclub`
It’ll be something like this, but you’ll need to see what data you actually need to extract from the trigger, I don’t use zone triggers. I’m presuming that trigger.to_state.friendly_name will give you the friendly_name of the device tracker and trigger.to_state will give you ‘enter’ or ‘leave’ which we just add an ‘s’ to the end of. No idea what the template will be to get the name of the zone but a punt through your logs will probably work it out…
alias: people going places
trigger:
platform: zone
entity_id:
- device_tracker.j_gps
- NEXT DEVICE
- ETC
action:
service: notify.telegram_f
data_template:
message: "{{ trigger.to_state.friendly_name }} {{ trigger.to_state }}s {{ TEMPLATE FOR NAME OF ZONE }}"