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

Storage entity registry #16018

Merged
merged 10 commits into from Aug 18, 2018

Conversation

Projects
None yet
10 participants
@balloob
Member

balloob commented Aug 17, 2018

Description:

Migrate entity registry to use the storage helper. All mutations of the registry will need to go via the UI.

Depends on (and temporarily includes) #16017

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

balloob added some commits Aug 17, 2018

@balloob balloob requested a review from home-assistant/core as a code owner Aug 17, 2018

@wafflebot wafflebot bot added the in progress label Aug 17, 2018

@MartinHjelmare

This comment has been minimized.

Show comment
Hide comment
@MartinHjelmare

MartinHjelmare Aug 17, 2018

Member

It's weird that we require a non core component (frontend) to fulfill the feature set of a core component (entity_registry) We should at least have a service to allow modification of entity registry without frontend.

Member

MartinHjelmare commented Aug 17, 2018

It's weird that we require a non core component (frontend) to fulfill the feature set of a core component (entity_registry) We should at least have a service to allow modification of entity registry without frontend.

@balloob

This comment has been minimized.

Show comment
Hide comment
@balloob

balloob Aug 17, 2018

Member

We already have this for config entries and auth too. We should only expose things as services if we want people to automate it. I would not want people automate changing entity IDs.

I think that as the project grows, we'll have a few more of these pieces: they function normally (give the same entity ID to the same entity) but can be tweaked via the WebSocket API.

Member

balloob commented Aug 17, 2018

We already have this for config entries and auth too. We should only expose things as services if we want people to automate it. I would not want people automate changing entity IDs.

I think that as the project grows, we'll have a few more of these pieces: they function normally (give the same entity ID to the same entity) but can be tweaked via the WebSocket API.

@balloob balloob referenced this pull request Aug 17, 2018

Merged

Device Registry #15980

2 of 4 tasks complete

@pvizeli pvizeli merged commit 8ec550d into dev Aug 18, 2018

6 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 93.747%
Details

@wafflebot wafflebot bot removed the in progress label Aug 18, 2018

@pvizeli pvizeli deleted the storage-entity-registry branch Aug 18, 2018

@balloob balloob referenced this pull request Aug 29, 2018

Merged

0.77 #16256

@Torgrima

This comment has been minimized.

Show comment
Hide comment
@Torgrima

Torgrima Aug 31, 2018

hi!

I have some issues after the update to version 0.77.1.

I struggle to rename z-wave devices in version 0.77.1. Before i could rename all the sensors belonging to one device and do the same with the zwcfg*.xml file.
I also strugle with cleaning up if a battery powerd z-wave node is not responding. Now I can't clean up the wrong entris in the new entity registry storage.
Before it was also wery easy to see and compare the entity in customize.yaml and groups.yaml

How can I manage to rename, delete entities in frontend if it don't work properly?
Is there a way to manage the yaml entries in a better/easy way?

Torgrima commented Aug 31, 2018

hi!

I have some issues after the update to version 0.77.1.

I struggle to rename z-wave devices in version 0.77.1. Before i could rename all the sensors belonging to one device and do the same with the zwcfg*.xml file.
I also strugle with cleaning up if a battery powerd z-wave node is not responding. Now I can't clean up the wrong entris in the new entity registry storage.
Before it was also wery easy to see and compare the entity in customize.yaml and groups.yaml

How can I manage to rename, delete entities in frontend if it don't work properly?
Is there a way to manage the yaml entries in a better/easy way?

@justarandomgeek

This comment has been minimized.

Show comment
Hide comment
@justarandomgeek

justarandomgeek Aug 31, 2018

Yeah, I've lost the z-wave rename field in the zwave control panel, and my workflow for installing/renaming devices involved renaming them and then deleting them from entity registry and rebooting to rediscover so that the half-dozen or so entities for each switch would have consistent names. Surely the removal of the manual option means someone has (finally...) implemented an automatic "rename the whole device" option somewhere to replace it, right?

justarandomgeek commented Aug 31, 2018

Yeah, I've lost the z-wave rename field in the zwave control panel, and my workflow for installing/renaming devices involved renaming them and then deleting them from entity registry and rebooting to rediscover so that the half-dozen or so entities for each switch would have consistent names. Surely the removal of the manual option means someone has (finally...) implemented an automatic "rename the whole device" option somewhere to replace it, right?

@kolossboss

This comment has been minimized.

Show comment
Hide comment
@kolossboss

kolossboss Sep 1, 2018

I am also afraid of upgrading to 0.77 because of the change of the entity registration file. For me this was the only way to "simply" rename the Zwave devices. Until now I see no benefit in the hole entity registry. It makes everything more complicated. I have to rename on different locations. And now its not even possible to access the registry...

kolossboss commented Sep 1, 2018

I am also afraid of upgrading to 0.77 because of the change of the entity registration file. For me this was the only way to "simply" rename the Zwave devices. Until now I see no benefit in the hole entity registry. It makes everything more complicated. I have to rename on different locations. And now its not even possible to access the registry...

@fortepc

This comment has been minimized.

Show comment
Hide comment
@fortepc

fortepc Sep 1, 2018

I have upgraded now to .77 and am regretting it because of the loss of the entity_registry.yaml. The only way I could start to make sense of my Z-Wave and devices, and other entities auto-discovered/named, was to rename the entities to something that made sense. Maybe I'm just a total idiot, but now I can't find any way to rename an entity id at all. The new blogpost says it should only be managed via the UI but there is nothing in the UI yet to be able to modify the entity id.

The entity_registry.yaml was a godsend for getting the entity ids to make sense, this particular change feels like a massive step back for me. Now I have no clue how to accomplish my desired entity naming structure. Sure, I can use customize to rename what they display as in the front end, but that doesn't help me at all with automations or creating a UI where I NEED to have the entity ID, and I can't constantly reference the states page just to grab an entity ID.

fortepc commented Sep 1, 2018

I have upgraded now to .77 and am regretting it because of the loss of the entity_registry.yaml. The only way I could start to make sense of my Z-Wave and devices, and other entities auto-discovered/named, was to rename the entities to something that made sense. Maybe I'm just a total idiot, but now I can't find any way to rename an entity id at all. The new blogpost says it should only be managed via the UI but there is nothing in the UI yet to be able to modify the entity id.

The entity_registry.yaml was a godsend for getting the entity ids to make sense, this particular change feels like a massive step back for me. Now I have no clue how to accomplish my desired entity naming structure. Sure, I can use customize to rename what they display as in the front end, but that doesn't help me at all with automations or creating a UI where I NEED to have the entity ID, and I can't constantly reference the states page just to grab an entity ID.

@fortepc

This comment has been minimized.

Show comment
Hide comment
@fortepc

fortepc Sep 1, 2018

Turns out: I was a total idiot.
That REALLY should have been mentioned in the blogpost for .77, cause that's a very welcome new addition 😛 and those of us using lovelace wouldn't have noticed it otherwise. I know it's just experimental but many of us have totally switched over already. I will add though that the entity_registry.yaml was slightly easier to do when setting up your network for the first time, renaming all of your relevant entity_ids for each device, but this is more idiot proof so I guess It's a change that makes sense.
image

fortepc commented Sep 1, 2018

Turns out: I was a total idiot.
That REALLY should have been mentioned in the blogpost for .77, cause that's a very welcome new addition 😛 and those of us using lovelace wouldn't have noticed it otherwise. I know it's just experimental but many of us have totally switched over already. I will add though that the entity_registry.yaml was slightly easier to do when setting up your network for the first time, renaming all of your relevant entity_ids for each device, but this is more idiot proof so I guess It's a change that makes sense.
image

@kolossboss

This comment has been minimized.

Show comment
Hide comment
@kolossboss

kolossboss Sep 1, 2018

Yes its possible, but very its annoying.
As you said, I added a zwave device with a lot of sensors. So there are 20 new entities. I have to find and rename every single entity manually.
In the registry you can find/replace...done. Imagine I add 5 new devices. Its totally crazy
I‘m also not sure if renaming an entity in the UI, have any effects on Automations/scripts/customization.

kolossboss commented Sep 1, 2018

Yes its possible, but very its annoying.
As you said, I added a zwave device with a lot of sensors. So there are 20 new entities. I have to find and rename every single entity manually.
In the registry you can find/replace...done. Imagine I add 5 new devices. Its totally crazy
I‘m also not sure if renaming an entity in the UI, have any effects on Automations/scripts/customization.

@justarandomgeek

This comment has been minimized.

Show comment
Hide comment
@justarandomgeek

justarandomgeek Sep 1, 2018

That's really not a solution though - it's making an already bad problem worse! Renaming this way means 6-12 individual rename operations for every single new device installed (based on my housefull of GE switches and a couple of other sensors) if you want all the entities for one device to stay named together (which is the only sensible way...). I had been hoping the ZWave configuration rename option would do this eventually, but it seems instead they've decided to remove that entirely as well, and leave us with the most tedious possible renaming system.

justarandomgeek commented Sep 1, 2018

That's really not a solution though - it's making an already bad problem worse! Renaming this way means 6-12 individual rename operations for every single new device installed (based on my housefull of GE switches and a couple of other sensors) if you want all the entities for one device to stay named together (which is the only sensible way...). I had been hoping the ZWave configuration rename option would do this eventually, but it seems instead they've decided to remove that entirely as well, and leave us with the most tedious possible renaming system.

@sejnub

This comment has been minimized.

Show comment
Hide comment
@sejnub

sejnub Sep 2, 2018

HA is about automation and now here we reduce the possibility to automate the setup.
In my opinion it should always be possible to setup a new HA instance with an identical configuration by installing a naked HA instance and then copy a number of files with documented syntax and semantics to the config folder.

I think it is a very bad idea to force a user to use the UI. I totally understand that we should have more UI for newbies that have difficulties writing YAML. BUT the UI should never be mandatory. Just create UIs that change configuration files that have documented syntax and semantics.

I am sorry if this is the wrong place for this fundamental concern. If there is a better place for my general remark please point me to that place.

sejnub commented Sep 2, 2018

HA is about automation and now here we reduce the possibility to automate the setup.
In my opinion it should always be possible to setup a new HA instance with an identical configuration by installing a naked HA instance and then copy a number of files with documented syntax and semantics to the config folder.

I think it is a very bad idea to force a user to use the UI. I totally understand that we should have more UI for newbies that have difficulties writing YAML. BUT the UI should never be mandatory. Just create UIs that change configuration files that have documented syntax and semantics.

I am sorry if this is the wrong place for this fundamental concern. If there is a better place for my general remark please point me to that place.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Sep 3, 2018

@balloob

This comment has been minimized.

Show comment
Hide comment
@balloob

balloob Sep 3, 2018

Member

Pull requests are the wrong place to discuss.

Member

balloob commented Sep 3, 2018

Pull requests are the wrong place to discuss.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.