Trigger for multiple zones (shopping list notification)

I have found a cumbersome solution to a problem, but I think there must be a better way.

Here is what I’m trying to do:

  • I have 10 zones that all mark different shopping centers and stores in my area.
  • There are two people/mobile phones.

I would like to create an automation that sends a persistent notification with a link to my google shopping list to the person that enters one of the 10 zones for more than 5 minutes. Once they leave the zone for 5 minutes, the persistent notification should be cleared.

I can do this by creating a separate trigger for each zone. However, I assume there must be a better way. One option I can think about, but don’t know how to execute on it would be to create a template sensor that changes from false to true as soon as it detects a person entering one of the 10 zones. I could then use this template sensor as the trigger for sending the notification. Not sure if that is the proper way to do it or if there is an even better/simpler way. Any suggestions?

1 Like

I made some partial progress… is a list of locations as seen in the code officially supported? I’m asking because it appears that the code works but is not supported by the visual editor. Not sure if I’m on the right track…

alias: Notification Shopping List
trigger:
    - platform: state
    entity_id:
      - person.john
    to:
      - location1 #is a list like this officially supported?
      - location2
      - location3
    for:
      hours: 0
      minutes: 5
      seconds: 0

Any progress on this automation?

I’m trying to make almost exact automation!
Right now I’m thinking about which approach I should use.
@cordvision , did you make it work somehow?