Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deconz component switches entities #11642

Closed
swttt opened this issue Jan 14, 2018 · 11 comments · Fixed by #11712
Closed

Deconz component switches entities #11642

swttt opened this issue Jan 14, 2018 · 11 comments · Fixed by #11712

Comments

@swttt
Copy link

swttt commented Jan 14, 2018

Home Assistant release:
0.61.0.dev0

Python release:
Python 3.5.3

Component/platform:
Deconz

Description of problem:
Xiaomi temperature sensor added trough deconz has its capabilities mapped to a different entity on a restart.

e.g. sensor.temp is the temperature, sensor.temp_2 is humidity and sensor.temp_3 is pressure.
on a restart these switch around so sensor.temp_2 could be temperature etc.

This makes it impossible to change the icon or friendly_name.

Expected:
That they keep mapped to the same entity.

Additional info:
Not 100% sure if this is a home-assistant issue or that the problem actually starts within deconz.

@Kane610
Copy link
Member

Kane610 commented Jan 14, 2018

The issue is that you've got a device with multiple sensors. You have to make sure to give all devices a unique name using the API, there is a service in HASS that exposes the API.

I've created an issue with deconz to get them to improve naming. dresden-elektronik/deconz-rest-plugin#363

@swttt
Copy link
Author

swttt commented Jan 14, 2018

Thanks!
Looked trough their api docs and at the service within HASS, but no idea how i could change the name of a sensor. Could you give an example?

By the way, should i close the issue since it's more a problem with deconz? Or keep it open so other users could find this and close it when its fixed?

@Kane610
Copy link
Member

Kane610 commented Jan 14, 2018

There are full examples in the component documentation. If you still need help I can help you tomorrow.

I've got this issue from others I'm thinking about doing it super easy to rename devices. This will probably be the most common issue otherwise. Keep it open till I put up a PR so I can reference this issue.

@swttt
Copy link
Author

swttt commented Jan 14, 2018

Actually the device name itself is unique. It's more an issue with the different sensors "within" the device where the mapping to an entity changes on a restart. Or do you mean i could rename those as well?

@Kane610
Copy link
Member

Kane610 commented Jan 15, 2018

You can rename each sensor separate from the other once belonging to the same device. But only through the api

@swttt
Copy link
Author

swttt commented Jan 15, 2018

Thanks, found it.
Couldn't get it working trough the service within HA tho. Might have done something wrong there, but got it working trough postman.

@Kane610
Copy link
Member

Kane610 commented Jan 15, 2018

Maybe I need to improve the documentation.

@tinloaf
Copy link
Contributor

tinloaf commented Jan 16, 2018

I guess this would be very nicely solveable through the new entity registry, once it comes?

@Kane610
Copy link
Member

Kane610 commented Jan 16, 2018

Im gonna do a small fix first that will always create the entities in the same order in hass, based on their deconz ID.

@tinloaf tell me more, that sounds interesting.

@tinloaf
Copy link
Contributor

tinloaf commented Jan 16, 2018

Have a look at #11533 - the idea is to have a central place (a YAML file) which is used to assign a specific entity ID to each entity, where entities must be identified by some "unique id". I guess this unique ID could be the deconz ID.

@Qxlkdr
Copy link
Contributor

Qxlkdr commented Jan 23, 2018

@Kane610 Just got to say, wonderful work with this component. I'm looking forward to the "small fix".

@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants