Simple device tracking using the companion app on android - what have I missed

Hassio on RP3. Android Companion App. Standard home Wifi. Local install only. No external access.

I installed the Companion app, and the GUI works flawlessly. Entities were made in HA for many sensors, also a device_tracker. I want to use this in automations and scripts, but I have never seen the state change from “home”, and automations seem to trigger even when I’m physically away even if I have conditions set.

I was hoping the simplest use of this was «when the phone is not on the same wifi as the hass server, we consider it as “not home”». It seems I’m missing something, Sensors such as battery state are visible and have content. The state of the device_tracker.phone_model does not appear in the logbook at all. When I turn off wifi on the phone, it is not reflected in the state.

Any ideas? I’m probably just missing something basic.

Can you access your pi from outside?
Do you have remote access?

EDIT;
I missed this:

How is HA supposed to know what is going on if you don’t allow phone can’t communicate with HA?

If you want device tracking without external access then i’d use wifi or bluetooth trackers:



to name a few

The app can communicate with HA when they are on the same wlan. I was hoping HA would set the state to «away» or something like that when the phone is no longer reachable on the same wlan.

No it won’t since it doesn’t know that it’s not on the network.
It just knows the last status was home, and it keeps that until something change it.

The methods posted by Andy works, but it will report wrong position every now and then.