Device options #604
Replies: 8 comments 7 replies
-
|
@pvizeli Can you explain a bit more what you want to do, do you mean we should encourage exposing device options as entities but add the I started a bit on another route where device options would be exposed through a WS API, first step here to only display decice related information or status: home-assistant/core#44055 |
Beta Was this translation helpful? Give feedback.
-
|
How would things like a code for a keypad be handled? Or lock codes? Etc. There are so many variations to this that I think a WS API makes more sense and integrations can choose to implement it. EDIT: would we have to implement some way to access these from automations, scripts, blueprints etc.? EDIT: although, I can see entities being much easier to use for users in conditions, scripts etc. Are there any concerns in bloating the number of entities with entities that rarely change? would we now have entities that cover all of the helper types? |
Beta Was this translation helpful? Give feedback.
-
|
From end users perspective, it seems indeed any easy way. But for the dev, how easily test if an option is enabled? |
Beta Was this translation helpful? Give feedback.
-
|
Using entities was a long internal discussion, but let first look at what is around. The goal is to streamline device configuration/options. Currently, if you use 3-4 integration, you have 3-4 different ways to do that, which is quite ugly and bad for user exp:
The solution could be:
Of curse, some integration has its own Panel for a reason; I don't attack this with my description. I personally was a long-time fan of "Generic API, But Franck and Paulus are high fans of using that as a device class. That has the benefit, it's easy to use for devs, and users can use it with a different approach and inside scripts/automation without we need to build something completely new. I agree that HA works with the entity and device class, and with System Options and Integration Options, we have 2 completely different Option systems, which his own backend, which is IMHO fine for me and makes sense. The question is, do we really need a 3 different options system or that solved with the entities, like a lot of integration using it now... Of curse, we need some kinds of "Number" Integration like selection. EDIT: Someone will use the "night" option on Sonos the whole day, so he only wants once set this in the device info page. Someone other will make an automation to turn that on/off. Of curse, with generic API, we can make also device_options service to call that. But it's still a switch. Do we need something new or do we reuse existing logic for it? EDIT2: |
Beta Was this translation helpful? Give feedback.
-
|
I propose that |
Beta Was this translation helpful? Give feedback.
-
|
This would work really well for some homekit_controller devices which have settings like elevation or sensitivity that are trivial to expose as entities. And because the HomeKit API doesn't differentiate between settings and state, it also naturally handles the case for us where the setting is changed "on device" or through the official app, live updating just works on the HA side. So very much 👍 I guess my only query is if we want to use a device class or mark them some other way. Is there value in being able to know that a |
Beta Was this translation helpful? Give feedback.
-
|
Does this discussion overlap with the architecture "issue" here: #381 |
Beta Was this translation helpful? Give feedback.
-
|
This has been partially implemented by introducing a new entity property With this construct users can automate their config, track history for it etc. Entity categories |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
The circle with options is not closed today. We have System options, integration options but no device options. Device options are a bit different from the other options. Some device options also want to be used on UI, others only on the device page.
Today, there is a big gap between the ways how device options are exposed to an integration. Some use entity and others use service. If you are using an entity, based on the number of options, it ends up with tons of entities getting a mess on the auto UI. It isn't nice for the representation and user experience for new and exists users.
Proposal
We create a new entity device class
optionfor:We can filter such entities on the device info page and group them differently from the real data endpoints. Future, we also need a new integration
selectto allow value selection, which is also common for options.Consequences
All integration uses this device class to expose his options to his users.
Beta Was this translation helpful? Give feedback.
All reactions