Zone as trigger with the new iOS tracker

I am using the new iOs app and I absolutely love it, I have enabled the tracking function and it work great. Now I want to build som automation when I arrive at work, leaving work etc.

I fist tried with this for a notify when I got home and it works perfect

- alias: Arriving home
  trigger:
    platform: state
    entity_id: device_tracker.iphone_7_plus
    from: 'not_home'
    to: 'home'
  action:
    - service: notify.ios_iphone_7_plus
      data_template:
        message: >
              Arrived {{now().strftime("%H:%M den %d %B")}}

Now I want a notify when I leave work, I build in the same way but changed from and to but I won’t work

    - alias: Leaving work
      trigger:
        platform: state
        entity_id: device_tracker.iphone_7_plus
        from: 'sjofartsverket'
        to: 'not_home'
      action:
        - service: notify.ios_iphone_7_plus
          data_template:
            message: >
                  Left work {{now().strftime("%H:%M den %d %B")}}

The zone config for “sjofartsverket” is

zone 2:
    name: Sjofartsverket
    latitude: 57.XXXXXX
    longitude: 11.XXXXX
    radius: 150
    icon: mdi:home-modern

Can anyone help me, what am I doing wrong?

I started out using from & to but had better luck with zone ‘enter’ and ‘leave’ events. Worth trying out.
Ex:

...
- platform: zone
  entity_id: device_tracker.iphone_7_plus
  zone: zone.Sjofartsverket
  event: leave
action:...

I read about that that trigger on the ha page but it say it only works with two trackers (iOS I none) But many that webpage isn’t updated. I will give it a try tomorrow. Have you got it to work with the iOS tracker @azeroth12 ?

Ah, you might be right. I have OwnTracks and the iOS app both doing location (might not be based on what you’re saying). I’ll try disabling OwnTracks and see if it triggers when I leave work.

I didn’t realize according to the documentation zone is just for OwnTracks and iCloud.

I did a quick test with zone config instead using from not_home to home (went for a walk) but it didn’t work for me. Let me know if you can get it to work @azeroth12

You’re right, I was switched to away but my ‘left work’ automation message didn’t trigger. Would be nice if zone was added to the iOS presence detection.

It is, I use it all the time…

Can you show your automation? We both just tried getting an automation to trigger using zone.leave with the iOS location with no luck. My device was set to away but no trigger.

Zone works fine with owntracks.

The below works for me; just triggered it a few hours ago :wink: Using iOS app 1.0.2. Prior was using OwnTracks but it is now disabled and commented out of the config.

trigger:
        platform: zone
        entity_id: device_tracker.jwelter_iphone
        zone: zone.work
        event: leave

Haha you’re right it works fine. I had my suppress notifications switch on! Just tried it with owntracks off and got the notification. (Cheated with fake gps)

@Stimo not sure why yours isn’t working with zone. Maybe something in the logs might help?

Now I am not sure @azeroth12 I will try again today and do some experiment, If you guys get it to work I don’t understand way I don’t.

Thanks, it works for me to!