Trigger temlate question

Hey there everyone.
How can I have trigger like this:
If I enter “pre_home” from any other zone but “home”

So I need to trigger it when I get close to home. But I do not want to trigger it when I leave home.

before we can help, you need to tell us more about your zones as apparently there are many different options available that may be important to know.
generally, you’ll most likely need a template trigger.

Actually, I need to do this:

  trigger:
    platform: state
    entity_id: person.argo
    to: pre_home
    from: != home

But I can not write “from: !=” without template and I can not find right way to do it with template

I could just use “from: not_home”, but it would not work perfectly, because in some case I can get from work to pre_home without being in “not_home”, because gps would not work as fast.
I also can not use my work zone as a trigger (when I leave) because I am not always coming home from work and there are other members who also can come home from any other location.

The only option I can see - write more triggers like (if I come from work, if I come from not_home …)
But it seems to me, that the right way is “from: != home”

if your state is the current zone, it can be

trigger:
 platform: state
 to: 'pre_home'
condition:
 condition: template
 value_template: "{{ trigger.from_state.state != 'home' }}"

p.s format it correctly, it may not have correct indentations as I just typed it in here

1 Like

Seems I was looking for something like that. Will try it out, thank you!