HA Map screen and iOS devices - shows correct locations, how to reference them?

I have my own iPhone and my wife’s iPhone running the iOS Companion app, and on the Map screen, we both appear at the correct sites. I’m uptown at the office, and she’s south at the school. What are the actual sensor values for these devices and their locations?

Interesting. I’m looking at Hass.IO / Developer Tools / States, and DO see all the location information. :slight_smile: Looks like I need to dig a little deeper.

you have two device_tracker.iphone_you and device_tracker.iphone_wife (depends on your iphone names)
this will show you your location

device_tracker.wifes_iphone
state: home (incorrect)

source_type: gps
battery_level: 89
latitude: 35.nnnnnnnnnnnn
longitude: -80.nnnnnnnnnnnn
gps_accuracy: 85
altitude: 194
vertical_accuracy: 10
friendly_name: Wife's iPhone

2 question:

  • Does your wife have the setting on where it uninstalls unused apps?
  • Did your wife turn off location services?

ah the app is creating an additional sensor.geocoded_location
check this one
and check if the app can update the location in the background

Her phone is still using the Beta app, and I seriously need to update it. :frowning:
My phone is using the 2.0 released app, and yet it shows:
device_tracker.freds_iphone
state: not_home (correct!)

source_type: router
scanner: AsusWrtDeviceScanner
friendly_name: Fred's iPhone
icon: 'mdi:alpha-f-box'
hidden: true

I’d start by updating if her location is not updating. I also noticed that if the app isn’t used in some time, it does not perform updates.

And that device tracker is not the device tracker created by the ios app btw. That’s created by your router. So you gotta find the one with source_type gps

No, I manually clean up her apps from time to time.
No, it appears her location is reporting correctly.

I think there is some disconnect/disparity between what the HA Map screen shows (absolutely correct) versus what’s available in the default sensors. Plus, while the ‘zone’ locations appear correct on the map, they are not reported anywhere in a sensor?

Yes, I definitely understand the difference between my router and the app. :slight_smile: So, I’ll have to check a multitude of sensors and values before determining a legitimate zone location?

If you’re using person to combine all the device_trackers? No, just get the infromation from the person.

I have no idea what devices are currently on your map. Probably should start by listing them all here if you are unsure.

Personally, I make a map card and only display what I want to display and ignore the built in map by disabling it.

I can look at the person values, if the template editor will properly reference them. Or is that something I need to automate?

template editor or the states page will show the lat and lon. It’s the same method as you’d use to get the device tracker info. Not to mention, it will also show you the source.

{{ state_attr('person.x','latitude') }}
{{ state_attr('person.x','longitude') }}
{{ state_attr('person.x','source') }}

The source may also be a list of all sources. I can’t tell on my system because I only use 1 source.

1 Like

Many thanks, Petro!! :smiley:

1 Like

No problem

I’m curious… is the source a single entity for you or does it show a list of entities?

Checking in the template editor from my phone, it simply shows ‘none’. :frowning:

Finally got home, where I can work on this a bit more. First things first:
I did not have any ‘Persons’ defined :frowning:
Entirely my fault, I mistakenly thought HA User == Person. Nope.
Second, there were multiple iOS devices in the Integrations page.
I deleted the majority of them and restarted Home Assistant.
Then I confirmed the remaining two devices are the appropriate ones.

Now, let’s see what’s reported in the template editor.

It’s ‘interesting’ how HA insists on adding an iOS device multiple times. :frowning: Even after deleting the integrations and restarting HA multiple times.

What do you mean? Are you sure that it’s creating multiple or is it just creating a new entity_id because the last one was never deleted?

WHat I mean by that is, if an entity_id exists, home assistant will make a new one with the same name but increment the last number… i.e. lights.kitchen_1, lights.kitchen_2, etc. Once you ‘register’ a name with a device it sticks forever unless you remove it from the registry.

1 Like

Thank you for that explanation. I may have to remove things from the registry to eventually resolve the excess device numbering, then.