How to trigger a script or automation when my iPhone enters a zone

I’m new to HA, so forgive me if I’m asking an obvious question or asking in the wrong place…

I am trying to get HA to open my garage door using ratdgo. The ratdo is installed correctly and I can run it manually from HA using both the web interface on my PC or the HA app on my phone.

I’m pretty sure I have the iPhone location service setup correctly. I can look through the logs and see my location and general speed of travel, along with all the other iPhone statuses.

I have set up a zone at my house which is correctly recognised when I enter it with my iPhone. I get a notification on my iPhone from the HA app that I have entered the Home zone.

However, I am at a loss as to how to use this as a trigger to run a script or automation to me ratgdo open. Here is the yaml from the automation:

device_id: 010b86208fb65c527b799cbfca84a7ef
domain: device_tracker
entity_id: a3345c732425c04cb6c9dde79b401722
type: enters
trigger: device
zone: zone.home

I created the automation from the gui on the web interface using the following commands:

Any ideas what I am doing wrong? I’m guessing what I think is my iPhone when select it using the gui, is actually someother entity that doesn’t report iPhone statuses, but I’ve been unable to find anything in the documentation about it.

Thanks!

Is that notification from this automation or a different one?

  • If it’s different, compare the triggers you are using for the two automations.
  • If it’s this one, then the issue is in the action not the trigger.

Is that notification from this automation or a different one?

I think it’s a system notification. I was seeing the notification before I had set up any automations. When I set up the app on the iPhone, I enabled all notifications. For example, this morning when I left the house, I got a “Location Change - Home exited” notification on my phone. I definitely didn’t set up an automation for that.