Also open to naming suggestions.
It seems there’s some desire for this functionality already, and I could use it for my Elk M1 integration. There’s at least two threads asking for features for either generic variable storage or input boxes of some kind of entering text in the UI.
I’m willing to try implementing this, but I imagine it will require dabbling in polymer (which I’ve thus far avoided) to implement the UI side (though it shouldn’t be too complicated, I imagine - it’d be just a labeled text box?), and I’m not sure if implementing a new generic item like this is something I should even try to do or leave to core developers to define and implement.
As I’m sitting here brainstorming this, I imagine something like this for functionality / features:
- Settable / gettable just like input_boolean / input_slider / etc, except UI is an input box
- Supported values (with appropriate validation) of int, float, and str; could support bool possibly though I really don’t think there’s a use for that (can’t think of a case where input_boolean wouldn’t work fine)
- Optional upper and lower bounds in the case of numeric inputs (perhaps can double for string inputs as min / max length)
- Optional regex validation in the case of string inputs
- Optionally can be dynamically marked read-only (this would behave similar to a sensor then, but there might be a use case where enabling and disabling changes from the UI might make sense based on some other thing being set / etc)
- Optional slider in addition to input box for numeric modes (would require min/max be set)? This is sort of a “bonus feature”, in case someone wanted to be able to both make quick adjustments as well as precise ones.
In my case I want to be able to represent read-writable numeric values on the Elk M1 alarm/automation controller (Counters and Custom Settings). I could implement them as sensors and only report on the values, but that’s giving up potential functionality. input_slider isn’t practical because the potential range is 0 to 65535, but often you’ll have users that only use 0 to 30 for example on a counter, and even with requiring the user to manually set the slider min/max settings making precise adjustments if they wanted to be able to may be difficult.
I can also imagine other uses, like an input box to speak arbitrary phrases via TTS or send arbitrary notifications via other means, for example.