Geocoded location is incorrect

I notice that in Map my location is off by about 75 meters. The address shown has the wrong Postcode (I’m in the UK). I’ve set up tracking on my Android phone via HA Companion and Nabu Casa.

I read that you can change location in config so I did. I think I got it right but the home icon doesn’t show up. I used “icon: mdi:Home”. I’ve attached some screenshots. Did I do this correct?

The address shown on Map is incorrect also. Close but not correct. Where does that come from?

Many thanks.

TL;DR - Contribute your address data to Open Street Map and the location will be spot on.

Post code areas are basically based on delivery routes of a 1960’s red Commer van - yes, the system has been improved since then however it was not designed to be used for location. Some post codes may contain one property; another a whole estate of 200 homes. My own home geocodes about 150m away without the property number. Both Royal Mail and OS have other data sets, but…

The next issue is data ownership. The Postcode Address File is owned by Royal Mail who license access to generate revenue. HASS uses Open Street Map for map tiles which is created by volunteer surveyors and cartographers in a similar way to Wikipedia. OSM data includes manually collected post code data (there was a specific project to collect this), and if your home has been added to the map, it can include comprehensive address data enabling precise geocoding.

There’s that word again - geocoding. OSM providges a service called Nominatim to search OSM data by name and address to give a location. I don’t know, but suspect HASS used Nominatim (or a similar OSM-based service) to turn your address into a location, and show it on a OSM map (look in the bottom right of the window).

The good news is you can improve the data OSM has to find your home. Just as I have been contributing for almost 15 years, and Amazon employees contribute (to help their parcel delivery services), anyone can add their home address to the map.

Basically, you create a point which represents your home, and add tags containing your full address (house number and post code), which can them be used by OSM and HASS to pinpoint your location. As a side effect of open data, many services and businesses (Amazon!) will also be able to find the address.

addr:housenumber = 123
addr:street = Example Street
addr:city = MyTown
addr:postcode = AA99 9AA
addr:country = GB

Happy Mapping,

HASS user, OSM volunteer surveyor and cartographer, Technologist.

If this helps, :heart: this post!

If you mean the “geocoded location” of your phone, then this is not with HA, the phone passes that on to the HA app on the phone and then to HA server
I.e. check what the phone says, then the HA app

Thanks, I just joined and added my home and street which wasn’t shown on the map (fairly new build). How does this tie into HA though? Do I need to add something to the config file for HA to “see” my real location?

I’m not sure, geocoded is on the HA map. My phone shows my correct location but that’s Google. I don’t see how the wrong address is from my phone. Nowhere is that address used.

Hence my question, I was not sure which geocoded location you were mentioning… I only (!) know this from my mobile who passes it on to HA-App and then to HA server, I never used this for the map, for that I just setup a zone home (thuis) with the exact location and limited radaius

I believe the sensor in question is the one provided by the android app

This sensor updates infrequently compared to the device tracker entity. There are also some further improvements in the current app beta and this PR to make things more accurate like the device tracker.

After turning on the location sensors in my Android 6.1 phone I’m still not getting accurate locations. I seem to be stuck at home (even that is off by 75 meters or so). I’ve given up on it for the time being.

I thought this was a geocoded issue. Since you said location please take a look at these steps

If you continue having issues then we need to see the companion app logs.

Sorry, I’m not sure what the issue is. I have an incorrect home location (off by about 75 meters) and our Android phones don’t track. I’ve double checked all the settings several times and all the proper boxes are ticked. I’ve attached the companion app logs.
Looking at the logs I don’t see any successful location results.
Thanks again for your help.

Make sure you are looking at the device_tracker and not the geocoded location sensor, that sensor should not be used for location tracking but it does show up on the map. Take a look at the attributes and you can see waht data google is sending to the app. Lets first make sure we are talking about the correct entity because this post title mentions geocoded location but you mention location tracking which is not exactly the same thing. One reports a pretty address the other reports actual phone coordinates.

In your logs I can see some GPS coordinates, can you check to see how accurate those coordinates are with respect to where you expect the device to be?

About 2 lines below a line like this, your log has several:

08-19 07:53:22.595 21624 21624 D LocBroadcastReceiver: Received location update.

What device are you experiencing this issue on? I can see the Geocoder is failing but seems like its failing connecting to Google.

08-19 08:07:31.629 21624 21624 E GeocodeSM: Failed to get geocoded location
08-19 08:07:31.629 21624 21624 E GeocodeSM: djil: DEADLINE_EXCEEDED: Deadline exceeded after 4.999378750s. 

I do indeed see backgroudn location updates coming and being sent to HA as they need to so that is why I am asking you to make sure you are looking at the correct entity

08-19 08:05:30.858 21624 21696 D LocBroadcastReceiver: Location update sent successfully

The lack of tracking happens for both phones, mine and my wife.
The map looks like it’s set to geocoded (screenshot) but I’m not sure where to change that because if I go to entities both phones have the entity ID as device_tracker (screenshot). I’m not sure where to change that in the map display.

Yes, the GPS coordinates are correct.

A few more screenshots: