IPhone location routine stopped working

Hello community,

I am new to Home Assistant, however I really like to play around and do first baby steps. I am using a Home assistant green with version 2025.5.3 and the setup was super smooth. I have a couple of Xiaomi Lamps and a powerplug that I was able to use within home assistant using the Xiaomi Miot Auto plugin that I installed from HACS (mabye someone has more experience using this plugin and can help?).
However, in a first step I was able to add all the devices and I am able to control them in a first dashboard that I was creating.
In a second step, I started to work on some automations that I setup in Home Assistant.
I wanted to turn on & off some lights, as soon as my IPhone is in close proximity to the house. As I was running first tests, this worked fine - till now. I don’t know what changed, but I am not able to run any automations anymore (once I check the “last executed” logs of the automation, its not getting triggered) that are related to the iphone (I also had an automation that when I turn on a focus, a lamp should be turned on, just to test it out, but also this seems not to work anymore). My Home Automation app on IOS has all the permissions and runs the latest version, I verified that. Someone encounters similar issues and might be able to help?

Would be happy to hear any ideas you might have

greetings :slight_smile:

Have you confirmed the Companion app has access to HA from outside of your network? And you’ve confirmed that the device tracker changes from home to not_home to home as you leave and return? Also check that the person entity has the correct device tracker associated.

It would be helpful if you posted the YAML for your automation.

Hello @michaelblight ,

thanks for your reply and sorry for getting back to you so late. It’s really weird, cause the other day, by chance, it worked, but only once. I have no explanation for that.
I gave my home assistant now access from outside my network, via its own url that I setup using cloudflair. I validated that, however I haven’t tested the automation yet.

A couple of things:

  • How can I ensure the companion app has access from outside of my network?
  • I don’t know how I can check the device tracker you are talking about. Can you tell me where I can do that?

In the meantime, I will try to find the yaml file and will provide it here.
Thanks so much for your support

greetings

Have you changed the phone settings so the HA app can continue running in the background, and is not shut down by battery optimisation?

Heyy @jackjourneyman,

it seems that I figured it out. I made my HA accessible from outside (thanks @michaelblight for pushing me in that direction) via cloudflare and a dedicated domain and it seemed I had to go over some settings in the IPhone as well. First, I made sure that the app is running in the background (as you suggested) and it has location services with detailed information. I had to setup the sensor settings of the IPhone to be read with periodic update = 20 seconds.

I will do some further testing now with location based triggering and then I will keep you updated :slight_smile:

Greetings