Trying to create a zone notification where only the not in the zone gets the notification

I am new to home assistant and trying to setup an automation when family members enter/leave certain zones it triggers a dynamic message to announce that the user has entered/left the zone. This works great but with one problem. I want to further enhance this automation to only send a notification if both users arent in the specific zone. for example. If me and my wife are both in the car together going to the grocery store, then i dont want us to get a notification at all. Only the person that is not at the store gets the notification. Im trying to add a NOT clause to basically say if either of my family members are NOT in the trigger zone then proceed with the automation. Image below of my YAML.

Please follow the Community Guidelines regarding posting configuration and screenshots.

The basic answer is… You can’t just use templates where ever you want, you will need to use a Template condition instead of the Zone conditions.

Also, FWIW your Not condition would not work properly for “enter” type events since one of the people will be in the trigger zone… you would need to do Not ( Or (Zone Condition, Zone Condition))… but all of that can be done in a single Template condition.

Someone here gave me the idea to create a template sensor that’s a true/false if my wife and I are in the same zone. I then use that as a condition , with a time constraint (not in the same zone for 2 minutes to allow for device tracker update delays), in my notification automations.

It’s not elegant, and there’s probably a more efficient way to code it, but it been working so far!

{{ states('person.wife') == states('person.me') and states('person.wife') != 'away' }}

Thanks! this is what i was looking for. adding time delay was my thought as well.

Your second clause (states('person.wife') != 'away') will always be true… the correct “Away” state is not_home.

I’m not smart enough to know. The users who helped me in the first place wrote it out that way, so that’s what I used. LOL

It seems to be working the way I need it to using “away”. But maybe this weekend I’ll see what happens if I change it…