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

RFC: First-class entity like input_select #43

Closed
jantman opened this issue Jul 3, 2018 · 5 comments
Closed

RFC: First-class entity like input_select #43

jantman opened this issue Jul 3, 2018 · 5 comments

Comments

@jantman
Copy link

jantman commented Jul 3, 2018

Background

I'm relatively new to HA and am integrating it with ZoneMinder. One of the main features that I wanted to control are ZoneMinder's Run States, effectively a named group of camera/monitor settings that can be switched between via the API.

Logically, this is an enumeration of string Run State names that's pulled from the ReST API (the list of options, and the currently-active option). The API also exposes an endpoint to set the desired run state.

I did some investigation on the forums and Google for what others have done, and the two threads I found both reference cobbling something together with a manually-curated input_select and then some automations or scripts.

Before I realized that input_select is a purely user input construct (thanks @balloob ) I did some non-zoneminder-specific investigation and found many references on the forums of this common pattern of integrations that expose a set of options and have one of that set as "current" - essentially the programmatic equivalent of input_select (I found a large number of the forum search results for "input_select" to be some combination of wanting to update the list of options, update the selected option, or take action on a user selection, via a component or other integration).

Proposal

For the use cases described above, I believe it would be of great benefit to have a first-class component that allows selection of a single option from a dynamic list of options (like input_select) but has the first-class update/polling/action capabilities of full Entities (i.e. a multi-valued switch).

@awarecan
Copy link

awarecan commented Jul 4, 2018

How about scene?

@jantman
Copy link
Author

jantman commented Jul 4, 2018

I'm not clear on how scene would really help here...

  1. My proposal is for something new built in to the hass core, not necessarily for end-user use. Right now there's ZoneMinder, as well as a lot of TV and media integrations (i.e. video and audio inputs, playlists, etc.) that have a logical action of "select one and only one item from a list" and "this list currently has one and only one active item" but there's no way to handle this natively in the component, because there's no Entity that works that way.
  2. In terms of ZoneMinder specifically, I don't want to control cameras individually from hass. I already have the run states defined in ZM where I normally set them, I just want a way to be able to control them from hass.

Sometime this week I'm going to work up a PR to expose ZoneMinder run states as a service, which will at least let users handle this through automations... but the UI side will still be missing.

@MartinHjelmare
Copy link
Member

This proposal has come up many times and the answer has always been that we shouldn't implement a "multi-valued switch" but tailor each component after a specific device, eg vacuum component for robot vacuum cleaners.

@balloob should we close?

@MartinHjelmare
Copy link
Member

Btw, the zoneminder component has implemented services to cater for the run states selection.

@balloob
Copy link
Member

balloob commented Mar 20, 2019

Yeah let's close. A lot of these things are really frontend concerns and should be solved there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants