I wanted to create a number in my esphome - which can be adjusted from the HA interface - but doesn’t have to be
a numbers seem to be what I want as it says “A number entity is like a sensor that can read a value from a device, but is useful when that value can be set by the user/frontend.”
But when I try and use this
I just keep getting errors which don’t seem to match the documentation
First it says must have min_value, max_value, step , none of which are on the documentation page - but clear enough to configure - although not documented that they are required
The last one though is
Either optimistic mode must be enabled, or set_action must be set, to handle the number being set.
I can’t find either optimistic or set_action on the documentation page - so I’m not sure what these are for - Is there different documentation that I should be using ?
You don’t. As I said that is the base component. You need to create a “type” of number component. In this case a template number.
That is what all the configuration options you are missing are listed under as in the image I shared and linked to above.
I think you are getting hung up on the fact that the example shown in the documentation for this component does not have all the options in the example yaml. It is a simple example. You can still add more options to it from the list of valid ones.
set_action and optimistic_mode are the 2 mode options that establish how your number entity will function/behave whenever a number is set from the frontend so, without you instructing it by setting one of the two options then it doesnt know how its supposed to handle a number when someone sets a number.