From zone 'x' to zone 'y' automation

Hello,

i’m trying to figure out how I can detect i’m coming from work to home.
I cannot simply rely on a zone enter event since it will trigger everytime i’m coming home.

i’m trying to setup a “zone to zone” automation, but it doesn’t work.

I tried something like that:

- id: 'trigger_xxx'
  alias: "Triger xxx"
  trigger:
  - platform: state
    entity_id: device_tracker.thomas_phone
    from: 'work'
    to: 'home'
  action:
...

But of course it doesn’t work since my device tracker is doing work -> not_home -> home.

So i’m wondering if I can achieve that with a “zone to zone” automation or something else ?

Thanks for your help !

Thomas

I’d do this with two automations

The first automation is triggered when you leave the work zone, and it turns on the second automation:

action:
  service: homeassistant.turn_on
  automation.THE_OTHER_ONE

The second automation is then triggered when you arrive at the home zone, and as the last action, turns itself off.

The proximity component was designed for this use case.

Thanks !

i’m gonna try both solutions. I wasn’t aware proximity does actually a bit more than proximity;