Google Geocode Custom Component - GPS to Street Address

@jacob_gibbs that error looks like you are using an older version of my component. The error usually presents it’s self when there is an issue with the api key, rate limits or incorrect location info passed to the sensor. The newest version of the component displays the error as the state so you can debug. Add the latest version reload and let me know how you get on.

Doh! I thought I was on the most recent version, but turns out I wasn’t. Upgraded, added an API key and all is working again. Thank you!

Crazy! Good job. :slight_smile:

Excelent!
Used for just one day, and got the api limit error. Just got an API key to see if fix this. Also missing an option to choose a picture: it seems that picture or entity_picture doesn´t work as it does for device_tracker.

same here, there is no picture shown.

@ElGrande72 and @prates thanks for you interest in my component. I was not aware that entity_picture did not work. Thanks for pointing it out. A quick fix is to use customise.yaml to add in entity_picture from there. I’ll have a look at adding entity_picture / picture into the component in a future release.

@michaelmcarthur I’ve also noted that device trackers reports that you’re at home, while this component report Home. At first the capitalization seems not big deal, except if you have groups that mix them. If you have a device tracker and a sensor with this geocode component on same group, both at home location, and the device tracker leaves the area, group reports that the group is away.

Great component!

Some explanation please. For android phone do I need to install anything on the phone? And for Iphones?

@anon35356645 you need to install a device tracker on you phone like owntracks or locative. Basically anything that updates home assistant with gps info. Have a look at Home assistant device trackers for more info. Hope this helps

I used this custom component for a while, but now have found a simple way to get the reverse geocode translation and would like to share with you. I was already using Google Maps Travel Time component to creaate a sensor for travel time from my GPS coordinates to home. If you also use this component, you can create a template sensor to extract the full address location from Google Maps Travel Time:

  - platform: template
    sensors:
      <sensor name>:
        value_template: "{{ states.sensor.<GMaps travel Time Sensor>.attributes.origin_addresses[0] }}"

@prates thank you for using the component. The google travel time method Is good if you want the full address. It is more difficult if you want to display one part of the address as different areas of the world have different address formats which squews the results. I worked on a way to use google travel time along with templates with a few people over on reddit. It worked most of the time. I eventually ended up writing this component as a easy way to get the info I required.

Thank you Michael for your splendid work.
I have two questions:

  1. I noticed that address takes much longer to update than position. Is it possible to update address for every new position received? At least mine is working that way.

  2. Someone got the map into hadashboard? I searched and tryed many things without success. For hadashboard “generic” is not a valid widget type. Using “camera” and “entity_picture” I get a blue google map error: g.com/staticmaperror.
    I believe it’s possible to do it, but not sure how.

@FunkyBoT Thank you for take nag interest with the component.
Q1
The component checks the location every 60 second. You might be able to use scan_interval: 30 In your sensor.yaml. This should speed up the update time. Just watch how often you update as you might hit Google’s api rate limits.

Q2
I have not used hadashboard but I have managed to use camera to display a map. I just followed the guide on the website

@michaelmcarthur
Q1 - Yes, I’m aware of the Google’s API rate limit. I’ll play with scan_interval. Anyway it would be nice that position matches with address, otherwise a map position will only match with address when stopped for a few minutes. I don’t know if this is possible, since map location & address are not syncronized each other.

Q2 - Your link was the one I was refering to. It uses “platform: generic”, but there is no “widget_type: generic” in hadashboard. If someone knows how to insert Show Google Maps as a card in hadasboard, please let we know.

Thanks for your help.

Hi all, and thanks to the developer for this component! I’ve having a little configuration issue, mainly around getting the location to display. I have the following:

sensors.yaml

- platform: google_geocode
  name: James
  origin: device_tracker.zy223dt84n
  options: street, city

known_devices.yaml

zy223dt84n:
  hide_if_away: false
  icon:
  mac:
  name: James
  picture:
  track: true
  vendor:

groups.yaml

  view: yes
  entities:
    - group.weather
    - group.housestats
    - group.people
    - light.outside_front_door 
  People:
   - device_tracker.c0eefb245ab8
   - device_tracker.ac5f3e69b431
   - device_tracker.zy223dt84n `

However, it only ever displays zones I have configured i.e. home or work or if I’m not in defined zone just not_home. I do see the updates in the loggbook, like the below.

image

What do I need to do to get the location to display in the default view?

@rsachoc Thanks for your interest in the component. To fix your problem you should add sensor.james to your groups.yaml. It should look like this:

  entities:
    - group.weather
    - group.housestats
    - group.people
    - light.outside_front_door 
  People:
   - device_tracker.c0eefb245ab8
   - device_tracker.ac5f3e69b431
   - device_tracker.zy223dt84n
   - sensor.james
1 Like

Thanks, that seems obvious in hindsight, but I’m learning!

Hey Michael,
Great work with this platform!

I only have one question about the Windows HA:

The plugin tries to load, but i get an error message when HA is loaded
ERROR (MainThread) [homeassistant.loader] Unable to find component device_tracker.google_geocode

I’ve put the file google_geocode.py into custom_components\sensor\ (but i had to create all those folders).
Could it be that the .py file needs to be somewhere else?

@Joeke thanks. You have put the component in the correct place. It looks like it’s to do with the placement of

platform: google_geocode

It should be in the sensor part of your configuration.yaml or sensor.yaml if you have split up your configuration. Google Geocode is a sensor not a device tracker. Let me know how you get on.

1 Like

Oh man… Feeling a bit noob here.

Thanks for clearing that up! I had put the google_geocode beneath the device tracker section and not the sensor section.
After correcting it to the sensor section it’s working now.

Thanks again for making such a cool component!