Google Geocode Custom Component - GPS to Street Address

You openstreetmap’s is working as it’s updated with saying Home. Change over from using a nmap device tracker to a mobile one it will work as desired.

Ok but now the device is not at home and i get the same result

16

What you mean to change over nmap and using a mobile one?

Nmap is a router based scanner. It works by checking if a device is connected to a local network. You need a device tracker that updates its location from the device. You will need one of these device trackers
GPS logger
Locative
Owntracks
iCloud

Thanks… can you give me a tutorial step by step to get an API Key from Google? I tried to get one, but google says it’s invalid…

Is it possible to have the GPS (lattitude and longitude) from the address?

No it’s not possible. You can use a template sensor long with your deceive tracker to get the latitudes and longitude of your location.

Which is the meaning of ‘place’ option?

I forked your code and added a “Nearby” attribute using Google Places and have been using for a month or so. Only just noticed today that you’ve apparently already done that with the “Place” attribute. :slightly_smiling_face:

Place would display the name of a landmark or building nearest to you. For instance “350 5th Avenue” would be “Empire State Building”

1 Like

Can you post the link to your fork? I’m interested in seeing how you added google places.

Haha! I’m an idiot. I went to github to grab the link and realized I’d already submitted a PR to your code that I’d forgotten about. My age might be getting the better of me. :smile:

Note that I am a python newb and that was my first ever PR so I might have done it incorrectly.

@toddw65 I just tried it. I like the fact it tells me how far i am away from the location. I’m going to test it out for the rest of the day. Thanks for this, it looks like a really good way to add the place functionality.

1 Like

Has the places been implemented? and If so Do I need to replace my existing google_geocode.py with a new one?

I am using the component and it works fine.
I try to extract the formatted address with the following template but it doesn’t work:

value_template: “{{ states.sensor.auto.attributes.Formatted_Address }}”

Can anyone point me in the right direction please.
Thanks

@brugk000 this should work.
{{ states.sensor.auto.attributes[“Formatted Address”] }}

@Jtmoore81 it’s not implemented yet. I’m testing it at the moment. It looks very promising.

@toddw65 places works but the closest it’s managed to find was 1 mile away from me. Most of the time it was around 3 miles away. I found with Google’s geolocation api it classes streets and towns differently in some countries. I think it might be the same for places. I’m going to investigate and see if I can get it to find closer locations.

@michaelmcarthur awesome thanks!

@toddw65 I spent sometime testing out different location searches. I can’t get the accuracy as good as it needs to be in my area. I live in a suburb but have shops near me. I’m finding that I can get locations that are around one mile away. How close are your results?

@michaelmcarthur works like a charm, great work

I had to change the double quotes to singe one’s.
value_template: “{{ states.sensor.auto.attributes[‘Formatted Address’] }}”

Generally it seems to depend on where I am. I live in the boonies where the closest business is miles away, but when my wife or I are in town, I seem to generally get reports that are in hundreds of meters or less.

I was in the process of trying to switch from Owntracks to Tasker for reporting and seem to have something messed up at the moment. As soon as I get that corrected, I’ll take another look and do some location & distance logging.