Automation to react to entering ANY zone, is multiple triggers my only option?

I’m making some automation that I want to react to entering ANY zone except for home. As far as I’ve understood it, my only option is to have as many triggers as zones, is it really that (cough!) dumb? example below on what I have to do, only about 15 more zones to go, isn’t there a way to just trigger on ANY zone entered?

alias: Shopping List Location Based Notification
description: >-
  Sends out a notification to Tasker when entering a zone where an associated
  shopping list has unchecked items
triggers:
  - trigger: zone
    entity_id: person.kristian_tigersjal
    zone: zone.ica_ekershallen
    event: enter
  - trigger: zone
    entity_id: person.kristian_tigersjal
    zone: zone.ica_city
    event: enter
  - trigger: zone
    entity_id: person.kristian_tigersjal
    zone: zone.willys_hemma_stortorget
    event: enter

Why not just use this? The state of person is the current zone they are in or not_home (Away) if they are not in a zone. So this will trigger any time person.kristian_tigersjal zone changes to anything other than home or no zone.

trigger: state
entity_id: person.kristian_tigersjal
not_to: 
  - home
  - not_home

Edit: I just read the description of your automation. This will trigger only on specific zones.

trigger: state
entity_id: person.kristian_tigersjal
to: 
  - ica_ekershallen
  - ica_city
  - willys_hemma_stortorget
  - etc

@tigersoul check the edit!

1 Like

Oh heck! I was under the impression that person objects only had the state of home or not_home and a i need to react to zones outside home, that wouldn’t work. Will definitely test this! :+1:

Hi tigersoul,

Here’s some code I wrote. Use as a blueprint, borrow code, or take it over and make it your own.,.,.,

1 Like

That’s some seriously extensive stuff, wow!! thanks! If I need a more elaborate solution later on, I’ll definitely have a look at this. At the time being, I’m only using this to notify a user (me) when entering a store area when there are items on a shopping list for said store.