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

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

Not sure if you’ve sorted it out yet, but yes the places integration can do this. If you have HACS already installed, check out the places installation instructions here: GitHub - custom-components/places: Component to integrate with OpenStreetMap Reverse Geocode (places)

Once installed, add a new places sensor with the device tracker of your RV.

Hi all,

Just installed places in HA and it’s working great. My question is how can I get Postal Town shown instead of City. City is just too general for me.

TIA

You can’t at the moment. I’ll add as an Advanced Display Option in the next release (release TBD).

1 Like

Thank you, that would be great. Are new releases announced here or elsewhere?

I’ll actually release it shortly. If you have places installed via HACS, Home Assistant will notify you when there is an update.

1 Like