Input number - can fields be templates?

Does anyone know if the fields on an input-number can be a template?

I’m trying to simulate a min/max level slider for setting start/stop charge limits on a battery, I think an input-number would be the easiest thing to use but I would like to have the “initial value” be tied to whatever MQTT sensor found the last setting was (to keep it “in sync”) and set so the minimum/maximum interlocks the 2 input numbers (can’t set “max limit” lower than “min limit”)

You will need to use a Template Number entity rather than an Input number helper.

Will that also allow me to put something on Lovelace UI so I can drag/change the setpoints from HA?

I’d like it to be bi-directional, I already have a sensor that brings in the current value the hardware is set up for but now I’m working on how to sync that and issue the correct commands back to modify the value.

Yes. The Number entity is front-end interactive like an Input number helper, but allows you to template some of the attributes/properties.

1 Like

Oh cool, I didn’t realize that from the description. Sounds perfect!