I have created an automation which should notify when people are entering different zones.
The gist of the automation is:
trigger:
- platform: state
entity_id:
- person.mrX
to: home
id: mrX-Home
- platform: state
entity_id:
- person.mrX
id: mrX-work
to: zone.work
...
action:
- choose:
- conditions:
- condition: trigger
id:
- mrX-work
sequence:
- service: tts.speak
target:
entity_id: tts.google_en_com
data:
cache: true
media_player_entity_id: media_player.kodi
message: mrX is back home
language: en
- conditions:
- condition: trigger
id:
- mrX-work
sequence:
- service: tts.speak
target:
entity_id: tts.google_en_com
data:
cache: true
media_player_entity_id: media_player.kodi
message: mrX is at work
language: en
The trigger with home works fine but triggers like zone. don’t get fired.
mrX has the companion app and I can track his whereabouts with fairly accurate precision.
If I check the map when mrX is at work it show he is … at work and when I use the Developer Tools the state shows as “work”.
Here’s a working blueprint where I do this stuff.
You are welcome to use it or use the code to get your stuff running. Community link for my Person blueprint
Hey @Troon thanks! It turns out that using the state without zone. and matching exactly the case for the name of the zone solves the problem.
My question is then what is the difference in using work and zone.work?
The main issue for me was that the autocompletion in the GUI, when creating automations, only shows a few states, namely:
home
away
unavailable
unknown
but none of the custom zone names. When checking the documentation I understood that for those I had to prefix them with zone. which in my understanding was sort of implicit in the predefined ones; home == zone.home
I get what you say but home also has a friendly name, I called my HA “terra” so in the developer tools I have: zone.homefriendly_name: terra
but when I use it in automations I only specify home
for work I have: zone.workfriendly_name: work
and then I need to use the friendly name …