Allow a user to override an entity's entity_category
#1442
Unanswered
jcsanyi
asked this question in
Entity Models
Replies: 1 comment
|
I disagree with this. If an entity category is set incorrectly, it is a bug in the integration that needs to be fixed for everyone. We should not give people tools to workaround bugs on a personal basis, and letting other users deal with it themselves. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Context
An entity's
entity_categorycomes from the integration that created it, and there's no way for a user to change it. If an integration marks something diagnostic and you disagree (or vice versa), the only route is to stop using the integration's entity and hand-write your own definition in YAML instead. For a discovered MQTT entity that means duplicating the discovery config by hand and opting that entity out of discovery - a lot of work, and ongoing maintenance, to change one value.Why Override?
In a perfect world, all integrations would properly categorize all entities, and the various widgets and dashboards would work properly with them in exactly the way people expect them to. However - we don't live in that perfect world, and there's a couple real-world concerns with those assumptions.
Some parts of HA don't behave the way people want them to - they include or exclude diagnostic entities from showing, they exclude them from selectable dropdowns, etc. The proper fix would involve fixing these UI elements, but that may take some time, and there may not ever be a consensus. A bad fix would be to force integrations to select a wrong
entity_categoryin order to work around this problem - that defeats the purpose of the category in the first place. A configurable override seems like a good middle ground - it doesn't leave people stuck, but still encourages integrations and UI elements to both work towards proper implementation.Related to the first, but slightly broader - integrations are sometimes hesitant to implement
entity_categoryentirely because it has the potential to break things that are currently working for all their existing users. If there's an easy low-effort workaround, it would reduce the risk of adding this support, and make it much easier to roll out.The MQTT gateway projects I use are a good example. Proposals to start setting
entity_categorythere tend to stall for the same reasons every time: the classification is subjective, adopting it changes behavior for every existing user at once, and anyone who disagrees with a given call has no way to put it back. That's reasonable caution, and right now it's well founded - so the feature doesn't get adopted, or it only gets adopted timidly.The Proposal
Let's make the
entity_categoryuser-configurable even for entities that are automatically created by an integration - either in the UI like we already can with name and icon - or somewhere in the yaml config - perhaps extending thecustomizefunctionality to properly supportentity_category.I'm happy to put together a PR, but I'm hoping to get some consensus first as well as comments on whether it should be in the UI or just the config.
All reactions