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

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.

Answered here

1 Like

Ding! This was it exactly - must have missed this from my first read-through of breaking changes, but I’ve now gone in, sorted all of my entities out and we’re back up and running. Thanks!

Consider this:

  1. Using a “person” entity instead of Life360 tracker for “place” sensors.
  2. Add a Life360 tracker for the “person” entity.
  3. Create a fictional “person” entity for tracking devices for a car, a favourite pet etc.
  4. Add alternative GPS tracking platform (like mentioned Traccar). Add corresponding device_trackers for “person” entities (may be commented).

Now, if anything goes wrong with some GPS platform - switch your “person” entity to another platform.

1 Like

Hi @daern, you might not have missed it. When the release notes first came out the Life360 breaking changes sections was pretty weak. I just updated it yesterday with (hopefully) a better explanation and clearer procedure for getting the Life360 entities in your system working again. (There are actually working entities already, it’s just that given the way the legacy device tracker code works the entity IDs get changed, and there was nothing I could do about that.)

Glad you got it working again!

1 Like

Ah, not to worry. The new instructions were crystal clear and was back up and running again in a few minutes :+1:

1 Like

Hello everyone, could you tell me why, since changes were made to the Home assistant release, I am no longer able to see the map in “Google Maps” with the location of the car?
First, in addition to obtaining the localization message with Telegram with:
street number, city number, distance from home etc. (to this day it still works regularly)
I also obtained from the car card by pressing on the “localization card” that I had created, the opening of an “attributes” subform, then by pressing on this I obtained the map in “Google Maps” with the position of the car.
Unfortunately, from the new release “2022.x.x” this functionality is no longer functional, it is as if the “Reverse Geocode Sensor (Places)” has failed with the changes to the release.
Could you help me get this feature back into operation?
Thanks Claudio

Could you clarify?
There is a “place” sensor which returns some location info.
Assume you selected a “map_provider = google”.
There is an attribute “map_link” which shows you a map with your location on Google Maps.
To show your current location on a Lovelace card, you need pass a map url into iframe card.
Could be done by config-template-card:

  - type: custom:config-template-card
    variables:
      MAP_URL: states['sensor.place_mama'].attributes['map_link']
    entities:
      - sensor.place_mama
    card:
      type: iframe
      url: ${MAP_URL}

Facing this very often:

2022-09-08 03:33:21.570 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.place_irina fails
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/local/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/usr/local/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
TimeoutError: [Errno 110] Operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 389, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Read timed out. (read timeout=None)
During handling of the above exception, another exception occurred:
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 718, in async_device_update
await task
File "/usr/local/lib/python3.10/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 565, in do_update
osm_response = get(osm_url)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 578, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Read timed out. (read timeout=None)

What could be a reason?

1 Like

The version 2.0 now has UI config only.
I just loathe this stupid trend “let’s remove settings in yaml”.
If one person make a wrong decision - ok, but when many people repeat same errors - this is awful.
OK, I agree that maintaining UI settings is much easier than maintaining UI + yaml settings and the developer decided to make his life easier.

Created an issue for that, probably hopeless.

Also, after updating the HA log is flooded by errors:

Finally, after migrating from yaml WRONG entities were chosen as a sources.
This is something new - an integration chooses itself settings and refuses user’s settings.

Downgraded to the previous version.
Disappointed.

What do you mean?

Hello everyone,

First of all, a big compliment for this great integration. :slight_smile:

Is there anyone who could help me with a problem regarding the language option? I would like to display the attributes in German and choose “de” as the preferred language. However, the output remains in English.

Am I missing something in the documentation? Thanks in advance!

Great work, it would be nice to get the ISO Country Code like other geolocating sensors.

Thanks, Steffen

Added in v2.3, just released.

1 Like

I believe if you set language as de it will do as you describe … however, that will be true only if there is German data for that location. If you enable debug logging and find the OpenStreetMaps URL. Open the URL in a browser and see how much data there is in German for these points. If you are seeing a lot of data in OpenStreetMaps in German that is not showing in places, please open an Issue on GitHub with some example addresses or lat/long. (You can send those to me privately if you’d prefer).

1 Like

I am a complete newbie with HA, I am looking at a way with this HACS to get the name of the city where my HA system actualy is located (my system is in a RV motorhome getting its position set via a GPS module)

can anyone give me a guideline on how I could accomplish this ?

thanks