I currently have several automations to notify when a persons zone is updated.
This then updates a boolean if the person enters the ‘Home Zone’ (user is home)
I’m trying to make the automations a little more dynamic…
So ONE automation that will push a notification when a user enters/leaves a zone?
A nice to have would be…
JJ left ZoneA after 1hour 42Minutes
Is this possible?
Thread Updated...
I’ve changed the thread content to be more aligned to what I’m after
I started an integration of this style with 2 people leaving a defined area.
The message is dynamic.
- id: '1580114122019'
alias: Zone - Entrée
description: ''
trigger:
- entity_id: person.joan
event: enter
platform: zone
zone: zone.home
- entity_id: person.jessica
event: enter
platform: zone
zone: zone.home
- platform: zone
entity_id: person.joan
zone: zone.ecole
event: enter
- platform: zone
entity_id: person.jessica
zone: zone.ecole
event: enter
condition: []
action:
- data:
message: '{{ trigger.to_state.attributes.friendly_name }} est entré dans la
zone {{ trigger.to_state.state }} à {{ now().strftime("%H:%M") }}'
title: Entrée de zone
service: notify.push
mode: single
In my case, the message is dynamically composed with the name of the trigger as well as the name of the zone detected.
Just bumping this thread as I’m looking to revisit this.
I’m hoping to have a dynamic automation whereby I can have multiple people as the trigger.
If a person’s zone changes, a notification is sent similar to below
I’m a HA noob and I’m scratching my head trying to understand whether the code in red should be adjusted or not?
I understood that I have to replace the person.A etc…
But is there something else to change?
1- Do I have to specify the Home zone or is the ‘not_home’ enough?
2- Does the notify mobile app send a notification to all people? If I leave Home zone, would HA notify me on my phone? I don’t want that.
Thanks. So I need to setup two automations, one for each device if I don’t want people to get notifications about themselves leaving/entering home?
I was hoping I could do this in one automation to reduce the overall number of automations, but if it’s not possible then I’ll go with that.
I’m guessing under action I should add the following? - device_id: *id of the device that is supposed to receive the notification*
That’s right, each automation will require each device to receive the notification (service: notify.xxx)
I’m sure once you’re a little familiar you could add a clause to only trigger if:
A: entering/leaving a specific zone
Or
B: ignore if entering/leaving home