Reverse Geocode Sensor ("Places") using OpenStreetMap - custom component

Try to use HACS. It’s working with latest core ==> “core-2021.6.6”,OS ==> “Home Assistant OS 6.0” and Supervisor ==> “supervisor-2021.06.3”

Thanks alot. it’s working now :slight_smile:

I’ve been seeing this on and off. The formatted address will show a Place Name but the Place Name attribute is ‘-’ Any ideas what is going on or how to further troubleshoot?

First, thanks a lot for a great integration.
I am using “formatted_address” data only, rather satisfied!

I am getting these errors in a log:

WARNING (MainThread) [homeassistant.components.sensor] Updating places sensor took longer than the scheduled update interval 0:00:30

Does that mean that a default scan_interval for the integration is 30 sec?
May I specify explicitly smth like scan_interval: 60 ?

my last visit here has been some time ago, so please let me suggest you use the companion apps and the geocoded location sensor for this? No more need for any CC, and full core support. As a user being frustrated by the limited data from the ‘old’ days and even having written my own AD app to attach those location data to the person entities, I can assure you that the current app data are so complete, you dont need any CC at all anymore. Even ditched the Life360 (because the activity sensor of the app even neatly replaces the moving/driving attr of Life360)…

I am using Life360 and “Places”, so far it works OK in general.
Issues are:

  • no value for “formatted_address” available sometimes;
  • address is outdated sometimes, if the person is moving (using scan_interval: 60).

Is it still and issue or was it just yesterday? Life360 was affected by the AWS outage yesterday.

Hello everyone since the new release of Home 2022.4.X was released I can’t make updates because I lose all the location information under the attributes heading street number city link google map etc. can you tell me what happened?

1 Like

Hi,

I’m trying to get “places” to work, unfortunately until now unsuccessful. Hopefully somebody can help me out with what I’m doing wrong.

I’m getting this error messages in the logfile:

This error originated from a custom integration.

Logger: homeassistant.helpers.entity
Source: custom_components/places/sensor.py:518
Integration: places (documentation)
First occurred: 14:49:54 (6 occurrences)
Last logged: 14:50:54

Update for sensor.haaino_places fails
Update for sensor.jim fails
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 515, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 743, in async_device_update
raise exc
File “/usr/local/lib/python3.9/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/homeassistant/homeassistant/util/init.py”, line 192, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/places/sensor.py”, line 439, in update
self.do_update(“Scan Interval”)
File “/config/custom_components/places/sensor.py”, line 518, in do_update
if current_location == previous_location:
UnboundLocalError: local variable ‘current_location’ referenced before assignment

sensors. yaml looks like:


  • platform: places
    name: jim
    devicetracker_id: geo_location.lightning_strike_00bcb5507ce26638c3773e2f781e70d2e1a17207

Jim’s attributes look like:

street_number: null
street: null
city: null
postal_town: null
postal_code: null
state_province: null
country: null
county: null
formatted_address: null
place_type: null
place_name: null
place_category: null
neighbourhood: null
previous_latitude: 52.06467454992081
previous_longitude: 5.382270812988281
current_latitude: 52.06467454992081
current_longitude: 5.382270812988281
devicetracker_entityid: geo_location.lightning_strike_00bcb5507ce26638c3773e2f781e70d2e1a17207
devicetracker_zone: Home
home_zone: zone.home
entity_picture: null
distance_from_home_km: 0
distance_from_home_m: 0
last_changed: 2022-06-06 14:49:23.254437
current_location: 52.06467454992081,5.382270812988281
previous_location: 52.06467454992081,5.382270812988281
home_latitude: 52.06467454992081
home_longitude: 5.382270812988281
direction_of_travel: stationary
map_link: null
options: zone, place
friendly_name: jim

What am I doing wrong?

Your sensor looks not correct.
It should be like this:

sensor places_jim:
  - platform: places
    name: jim
    devicetracker_id: device_tracker.jim_iphone8
    options: zone,place
    map_provider: google
    map_zoom: 19
    home_zone: zone.jim_home
    api_key: !secret email_jim

Check GitHub - custom-components/places: Component to integrate with OpenStreetMap Reverse Geocode (places)

Something has happened to this integration.

This is all the sensor gives me since I last updated:

I have not made any changes to the config. It used to give GPS coordinates, street adress and all that.

Check if your device_tracker has valid data.

It does…

Not the altitude though.
I would love to live 110 m up, if there is an elevator :slight_smile:

Yup, same here. Solidly broken in 2022.7.1.

Have updated the Places component to the latest version (1.8), but this has not helped. Rolled back to 2022.6.7 and all is well again, so suspect that the Python update has broken this component. I’ll look a bit deeper later when I have more time.

Just updated to 2022.7.1 and Places seems to be working ok so far, but I’ll keep an eye on it.

You note you upgraded to the latest version of 1.8. It looks like 1.12 is the latest version. Not sure if updating to 1.12 may fix your issues?

Not sure I will be able to assist, but posting any errors in the logs related to Places will help.

Oh, interesting. I picked up what I thought was the latest version earlier today. The tag is 1.12, but the manifest reports 1.9:

{
  "domain": "places",
  "name": "Places",
  "version":"1.9",
  "documentation": "https://github.com/custom_components/places",
  "dependencies": ["device_tracker"],
  "codeowners": ["@tenly2000","@iantrich"],
  "requirements": []
}

Where did you get yours from?

HACS

Although looking at the manifest file, mine also says 1.9

SNAG-0319

{
  "domain": "places",
  "name": "Places",
  "version":"1.9",
  "documentation": "https://github.com/custom_components/places",
  "dependencies": ["device_tracker"],
  "codeowners": ["@tenly2000","@iantrich"],
  "requirements": []
}

Interesting, thanks - I’ll look into this.

Incidentally, no entries at all in the logs, even on debug so… :confused:

Looking at the manifests for other integrations, I don’t believe the version in the manifest is reliably accurate. Some align with the Release Tag, others are v0.0.0, and others are several versions behind the Release Tag. Because it is manually updated, I’m not surprised.

I’d rely more on the GitHub Release Tag or Version reported in HACS.

Hmmm, well I’ve now removed my manually installed component, configured HACS and used that to install it (it was exactly the same FWIW) and then upgraded back to 2022.7.1 - same result.

I’ve now also removed all other components other than HACS and places from custom_components, as well as their respective configurations from configuration.yaml and it’s still the same. Something has really upset this component for me since the upgrade. The configs for my sensors are pretty straightforward too:

- platform: places
  name: <redacted>
  devicetracker_id: device_tracker.life360_<redacted>
  options: street,city
  map_provider: google
  map_zoom: 18
  home_zone: zone.home
  api_key: !secret email_address

I’ve rolled back to 2022.6.7 one more time and it’s immediately sprung to life. Otherwise, with 2022.7.1, my dashboard entities just sit reporting “Initializing…” and never update. Definitely open to any other suggestions here if you’ve got it working with 2022.7.1!

Regarding logging - despite having it set to debug, I’m not seeing any logs (error or otherwise) from this component whatever version of HA Core I’m running.