Device tracker status 'home' when away

I have a problem with presence detection, using the mobile app as device tracker.

My gf left for work today and I spotted on HA that she was still showing as being ‘home’. I checked around to see if she’d left her mobile phone by mistake but she hadn’t. So, to test it I toggled off WiFi on my mobile and I am still showing as ‘home’ too. Checked on the router and we are both showing as disconnected.

I’ve checked which mobile device is being used for each of us and they are named correctly.

Does anyone have any advice as to what could be the problem?

1 Like

Please have a look first at the following doc. There is a working list that solve most of the problems.

Still, I have the same issue with one of our three mobile divides too, not always, but once in a while. Two devices are exactly the same with the same settings where one is giving problems. Still fingering out what the issue could be with this one device causing problems so now and then.

3 Likes

What device tracker? What integration has created this device tracker?
Do you have external access set up?

1 Like

It’s the phone companion app being used as device tracker as mentioned in my original post. Location is set to always on both devices so I can’t see what the problem is.

EDIT: Both devices are iOS apple phones

I didn’t see that with mobile app, I just saw that you toggled wifi and that made me think it was not the app.

Do you have external access set up?

Just local access. It all worked fine until sometime over the last couple of days.

If you only have local access then how is Home Assistant supposed to know when you have left the local network?

3 Likes

Thanks. Looked at that and all my settings comply with the advice in the doc.

If you do not have Home Assistant Cloud set up at all, the problem is likely that the remote connection is not secured. The Companion App requires an encrypted connection for remote connections. Please see the Home Assistant docs or this guide to setting up Let’s Encrypt with Duck DNS for instructions on setting up a secured connection.

Troubleshooting | Home Assistant Companion Docs (home-assistant.io)

I definitely don’t have cloud access but, I assumed the companion app used the router to track a device connection. As I said, it’s always worked fine until the last few days.

Ok. Then use the same magic you used before.
Neither Home Assistant or the companion app will work that way. But if you had some magic working before then keep using it.

Think about it… You are on your wifi network, all is good.
Now you disconnect, how is the app supposed to tell HA on your network that it can’t talk to that it has disconnected?
It can’t know that it has disconnected before the disconnection has happened.
It’s impossible that the companion has worked this way. You must have been using the router device tracker.

2 Likes

The companion app location doc states the below without any mention of requiring cloud access:

Location updates are sent from your device to Home Assistant in a number of situations:

  • When you enter or exit a zone defined in Home Assistant.

https://companion.home-assistant.io/docs/core/location/

And, both mobile phones are set to false for tracking in known_devices.yaml

iphone_m:
  name: iPhone M
  mac: 70:31:7F:EP:93:2B
  icon:
  picture:
  track: false

iphone_r:
  name: iPhone R
  mac: A4:CF:99:1E:S8:DD
  icon:
  picture:
  track: false

Come on… Again, how is it supposed to send location data with it’s mouth taped shut? You need to give them a possibility to talk to each other for it to work.
The docs does not say the phone needs to be on, have reception, in working condition or that your HA server needs to be on, have power and all that either.

The code block is for known devices and that is router tracking.

2 Likes

Maybe I’m missing something here but, surely, the companion app, regardless of cloud/local access will know if the device the app is loaded on is in the zone (i.e.connected to the home WiFi) or not, then updates the status accordingly with no need for cloud access?

In this instance, my gf has left home, her device/companion app is no longer connected to the home WiFi, therefore she should show as Away? Or am I really missing the point?

1 Like

Yes. Go back and answer my questions.

1 Like

The companion app sends your location to HA and therefore, it needs a working connection with HA to do so. To verify a few things:

  • The HA address set up in the companion app is: http://192.168.x.x:8123 or is it http://[email protected]?
  • When you go out of your house, and open the app, does the HA dashboard show up?
  • In the companion app, do you have enabled the location tracker under the sensors?

In general, when i am getting out of the house, the phone switches to mobile data (so it still has internet connection) and since i have external access enabled to my server, it receives my location from my phone. If that location is inside any zone i have set up, the zone name appears:

But how?
Please look carefully at what you are typing.

Your Home Assistant is not accessible outside the network.
How is the phone, which is no longer connected to the local network, supposed to tell Home Assistant, which it now has no connection to, that it has disconnected from the network?

1 Like

HA Address is http://192.168.x.x:8123
Dashboard throws up an error
Location tracker is enabled

However, I’ve never had cloud access to HA and until a couple of days ago if I was at home and my gf left the house, checking on the dashboard, her status would show as ‘Away’. I even have an automation to send me a notification when she arrives back home because, I don’t always hear her arriving back when I’m in my home office.

I always assumed, that the status simply changed ‘home’/‘away’ on connection/disconnection to the home WiFi, without need for cloud access.

1 Like

As I said before, with router device tracker you can get something like this.
It will not work perfect, but it will give you something like this

Very odd! I’m dumbfounded as to why it’s worked absolutely fine previously up until last weekend.

I removed router tracking of the iPhones a couple of years ago because it was causing conflicts and duplications with the companion app device tracking. And I’ve never had cloud access to HA.

I’m even considering going back to a previous back up to check the difference in set up as it may be the only way to resolve this.