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

@Holdestmade

Can you tell us what specific line numbers you commented out in sensor.py? I’m not a python person and I don’t want to break it.
Thanks

No log entry, but your’re right.
The places sensor looks during initialization for an entity_picture in device_tracker.
But the owntracks device_tracker has no entity_picture.
That may leads to a not logged error.

I then added the entity_picture in customize.yaml which leads to this error:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/places/sensor.py", line 312, in setup_platform
    add_devices([Places(hass, devicetracker_id, name, api_key, options, home_zone, map_provider, map_zoom)])
  File "/config/custom_components/places/sensor.py", line 332, in __init__
    self._entity_picture = hass.states.get(devicetracker_id).attributes.get('entity_picture')
AttributeError: 'NoneType' object has no attribute 'attributes' 

You should fix that.
By the way: I could only detect 4 lines referencing entity_picture !?!?
But anyway: I prefere to wait for the fix instead of modify the origin code :slight_smile:

Lines 263, 332, 382-385 and 411, been using it with commented out lines since 0.94 and works perfectly

No good idea, did it and HA never came back from restart.

You’ll have to wait for the update from the author then.

1 Like

For info, these lines I commented out:

ATTR_PICTURE = 'entity_picture'

self._entity_picture = hass.states.get(devicetracker_id).attributes.get('entity_picture')

@property
def entity_picture(self):
#   """Return the picture of the device."""
    return self._entity_picture

ATTR_PICTURE: self._entity_picture,
2 Likes

Yes, that looks right and its logical.

All references to entity_picture.
Declaration and filling.

But when I did that, the restart failed, from which reason ever.

But ok, as long as my google geocode is running, I will have the time to wait.
Thanks for your help.

@Holdestmade
Thanks for the line numbers. That confirmed what I thought needed to be commented out.

Restarted and it worked just fine.

Hi Juan,

I don’t have any near future plans to maintain or update this component. I really only created it because I had a personal need to track multiple people with disparate home locations and I wanted “place” information as opposed to just street addresses - and there was nothing available at that time that could do that.

I found the component useful - and so I decided to share it - and I’m glad to see that you and a handful of others also find it useful - however, I’ve moved on to other projects (learning Swift and iOS development) which doesn’t leave me any time for Python development.

If you, or someone else wants to take over this component, it won’t conflict with anything I had planned to do - so you’re welcome to do so. I’d just ask that you give appropriate credit/acknowledgment to me in the comments for the initial creation of the component.

If there’s anything else you need me to do in the Github repository to approve an ownership transfer - just let me know.

It would be great if someone were able to do whatever is required to have the functionality that “places” provides built in to the core Home Assistant product instead of having to install it as an add-on.

Thanks…
Jim

Good day Jim,
I’d like to offer assistance with the component, but the reality is have no programming knowledge. I was only able to offer help with the repository restructure for HACS, because it’s quite simple. I’ll ping the HACS maintainer/owner to see if there’s anyone there that would perhaps be able to help with maintaining this component.

@ludeeus
Jim is looking to transfer ownership/maintenance of this component. It’s equivalent to google geoplaces but completely free. Perhaps it could be transferred to the custom-components repo where one of the contributors could look after it?

Dear Jim,

I volunteer to take ownership of the component.
I have python knowledge and I’m quite into Home Assistant.

Jan

Hi Jan,

Ok. It’s yours under the following conditions:

  1. It remains a completely free component - for both commercial and non-commercial use.
  2. The current functionality continues to exist as a “version 1” and made available to those who want to continue to use it the way they do today.
  3. If you want to add/remove or change features, please do so beginning with a version 2.0 (but do not force people to update to it)
  4. Maintain a statement in all versions of the comments/documentation that acknowledges me as the original author.
  5. If you become unable or unwilling to maintain it, transfer ownership to someone who is.

That’s it. Pretty reasonable I think…

I don’t know if you need me to do anything. I think you can probably just clone my git or create a branch - but if you need me to do actually do something to make the transfer happen - just let me know what it is…

Good luck! Thank you for taking this on - and thank everyone else for their kind words over the past 2 years…!

Jim

1 Like

Hi

I’ve updated to 0.96 and I’m getting errors

2019-07-18 15:06:08 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform places
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/places/sensor.py", line 312, in setup_platform
    add_devices([Places(hass, devicetracker_id, name, api_key, options, home_zone, map_provider, map_zoom)])
  File "/config/custom_components/places/sensor.py", line 332, in __init__
    self._entity_picture = hass.states.get(devicetracker_id).attributes.get('entity_picture')
AttributeError: 'NoneType' object has no attribute 'attributes'

Is there anything I can do to fix it?

Thanks

See above, it’s an issue with entity picture, needs some lines commenting out. Unrelated to 0.96 I think ?

Thanks @Holdestmade

It’s related to 0.96 for me, I rolled back to 0.95.4 and it’s working and no errors in log.

Sorry, I haven’t seen the previous posts.

I think I’ll remain on this HA version for now…

Mine wasn’t working at first on 0.96, but after several restarts and reboots, It is now back functioning for me like it was in 0.95 versions.

Let’s move it over to the custom-components repo so that it can be a community component. Reach out to me here or on Discord @iantrich#6541 and I can help you get it transferred over.

Edit: I asked ludeeus to add you to the custom-components repo (should be active in a few hours) so if you wish:
Go to https://github.com/tenly2000/HomeAssistant-Places/settings
And go all the way to the bottom of the page to “Transfer Ownership”
And then transfer it to “custom-components”

We got it transferred :tada:


Should now be in HACS by default going foward as well. If you previously installed it with HACS, you’ll need to uninstall and use the updated path to receive updates when they are made.
2 Likes

Installed it from HACS and now getting this error again (see posts above about this error)

I have to comment out all the entity-picture refs in sensor.py to make it work

Error while setting up platform places
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/places/sensor.py", line 312, in setup_platform
    add_devices([Places(hass, devicetracker_id, name, api_key, options, home_zone, map_provider, map_zoom)])
  File "/config/custom_components/places/sensor.py", line 332, in __init__
    self._entity_picture = hass.states.get(devicetracker_id).attributes.get('entity_picture')
AttributeError: 'NoneType' object has no attribute 'attributes'

@jebeke65

Are you now taking over this component?

Can you look into the entity.picture issues that we have to manually remove lines in sensor.py to make work?
Seems that once the lines are commented out. It works fine for the most part.

Lines 263, 332, 382-385 and 411, been using it with commented out lines since 0.94 and works perfectly

Thanks

1 Like