I have a button that will set my overnight charge value for the battery. I really don’t want to hardcode a value, I want to input it when the button is pressed or at least pick from a list of values. Is this possible?
May be I got you wrong, please correct me.
There is a button.
There is a number entity.
When you press a button - some value is set for the number entity.
Currently this value is a hardcoded 75, but you want have a possibility to manually input it.
Was it correct?
If yes - why do you need a button to change a number, why not changing the number itself from some card like Entities or from more-info for this number entity?
That is correct, I thought it would be nice and easy to press a button and enter the value I wanted. I didn’t want a slider, but I just want to add the % I require. I don’t know what more-info is? I am new to HA so the button might be the wrong method.
There are 2 types of input_number:
– box
– slider
So, create an input_number entity of the “box” type.
It is a popup dialog window containing info about some entity.
In most lovelace cards, when some entity is tapped by a mouse then this window is displayed for this entity.
I see what you mean. more-info has a slider, but when it slides I get no indication of the value. I would rather type it in. I see your point, a button is the wrong card. Handy for a reset, but not for setting different values. I tried to add an entity card, but I couldn’t get the box. Sorry if I have missed something obvious.
slider or box - is not an option of a card.
This is a property of a number entity.
Number entity of a “slider” type cannot be displayed with a box - and vice versa. Type of a number is selected on creation.
I appreciate your time with this. That slider not reflecting the value while sliding is annoying. I made the Number as a Helper, but then got confused how to add it to a card and how it then links to the entity I want to change.
I was using Number Set, but couldn’t work out how to link Input Number Set to my Number and then to the Entity I want to change.
“Number” entities are usually used to set a value of some entity’s state or attribute.
To change entities (i.e. either state or attributes) which created by some integration - a corresponding service call is used.
Example: there is a “fan” entity created by some Xiaomi integration. To change a speed, you need to call a corresponding service using this “fan” entity_id and some “number” entity as a value of speed.
To change “template” entities (let’s not talk about trigger-based ones for simplicity) - just change that “number” entity, then the target “template” entity will be changed automatically since YOU provided a corresponding rule of this changing (defined a state or attributes as a template using that “number” entity).
To use numbers - create them with “box” type (since sliders are not convenient for you) and then use these numbers to change entities (2 scenarios described above).