I recently started working more with Zones and I must say it is pretty basic and lacks functionality other entities have.
For example, I want to create zones for several hardware stores nearby, and when I’m there, I want a notification that opens hardware store shopping list. Same thing with groceries.
The thing is - Zone trigger does not support multiple zones. Other entities doesn’t support it in GUI, but when you switch to yaml, you can trigger when input_select.mode changes to Morning or Day - as one trigger. However, with Zones, this doesn’t work:
trigger: zone
entity_id: device_tracker.***
zone:
- zone.tesco
- zone.globus
- zone.kaufland
event: enter
Currently, you have to make 3 triggers. Ugly. Can we please get multiple zones in trigger supported? Also, can we have option to trigger on ANY zone and have tags supported on Zones? Basically it would work same way as “entity changes from unknown/unavailable”.
Then I can mark zone.tesco, zone.globus and zone.kaufland with “groceries” tag, and zone.hornbach, zone.obi as “hardware store” tag. Then I’d trigger on ANY zone, and in condition check whether it is “hardware store” to send correct notification. Much cleaner than to repeat all zones of the same type in all automations.
That is exactly what I said. You currently have to create multiple triggers. While othe entities support trigger on multiple values. One trigger, multiple values:
trigger: state
entity_id:
- input_select.mode
to:
- Night
- Away
- Holiday
So it would be great if there is the same possibility for Zones.
did you consider templating the notification itself?
my presence notifications only use the person entities I need to track, and in the template for the notification you can set any group of zones you like in a list , and check whether the trackers state is in that list of zones
message_en: >
{% set tostate = trigger.to_state.state %}
{% set fromstate = trigger.from_state.state %}
{% set zones = label_entities('zone')
|map('state_attr','friendly_name')|list %}
{% set name = trigger.to_state.name %}
Hi, at {{now().strftime('%X')~' '}},
{%- if tostate == 'not_home' and fromstate in zones and fromstate != 'home' %}
{{name}} left {{fromstate}}
{%- elif tostate == 'not_home' and fromstate not in zones and
fromstate == 'home' -%}
{{name}} left {{fromstate}}
{%- elif tostate == 'not_home' and fromstate == 'driving'-%}
{{name}} stopped {{fromstate}}
{%- elif tostate == 'home' and fromstate == 'driving' -%}
{{name}} stopped driving and arrived home.
{% elif fromstate == 'not_home' and tostate == 'driving' -%}
-{{name}} left and started {{tostate}}
{%- elif tostate == 'driving' -%}
{{name}} left {{fromstate}} and started {{tostate}}
{%- elif fromstate == 'not_home' -%}
{{name}} arrived at {{tostate}}
{%- elif fromstate == 'driving' and tostate in zones -%}
{{name}} stopped {{fromstate}} and arrived at {{tostate}}
{%- else -%}
{{name}} left {{fromstate}} and arrived at {{tostate}}
{%- endif %}
this is without grouped zones but you get the idea