i am using input_number entities as internal variables, e.g. to track a numeric state over time that cannot be read directly. Although those helpers do have an “editable” attribute, changing it’s value to false in customization still allows changing their value in (autogenerated) lovelace UI.
Is there a way to make those helpers read-only for the UI while still allowing to set their value using services?
You can restrict a whole card or just selected rows.
I have most of my restrictions set up to use a PIN, or check a “lock override” input boolean (that is also protected with a PIN). For quick adjustments I use the card/row PIN and they auto lock again after a short time but if I’m doing something more extensive I use the override switch that keeps them unlocked until I turn it off.
editable just relates to whether you can configure it in the UI. Even if that’s false - as is the case when you add them with YAML - you can still change the values in the UI.
Having a display only field would be useful. In my project going to try just creating a dummy sensor. The configuration recompile (restart) seems to accept it. Also, Developer Tools States allows change of the state value. So later it should be possible to reference the entity and update the value. Below example the plan is to calculate and update the fluid level state in pyscript.
Here too I have some things in automations that I use input helpers for to expose what’s happening in Lovelace. But this should not be editable in lovelace.
I don’t fully understand why, but creating an entity using the hass.states.set method in a python script results in a read-only entity. Through limited testing, the only ways I found to edit it are using the python script method or via the states tab under developer tools. No other places in the standard UI or home assistant service calls seem to be able to effect any change.
If you want to display the input_* value in an entities card, a simple workaround is to use the multiple-entity-row. Installed either manually or through HACS.
For demonstration both rows use the same input_text entity, whereas the second is rendered with the multiple-entity-row:
My entities card YAML looks like this (only one additional line and no CSS/HTML hacks):
Sorry for the necromantic work here, but this is the first result in my Google searches…
The solution to the given problem, if you’re not using an automatic dashboard, is to use type: simple-entity on the entities card, as explained in this other post, which links to this part of the docs.
There’s no need for a custom component nowadays, if you were to install it just for this.