Not sure if I understand.
Under integration > entities I see the option ‘display precision’ for sensors. (sensor.hb_temp_inlet). This option is missing for a number entity (number.hb_2_fan_speed)
Which UI settings are you refering to?
Did you create this “number” entity by yourself? Or it is created by some integration?
If by yourself - then did you set a “step” value fractional?
If it was created by some integration - you can create a template sensor for this “number” entity with a desired precision.
This should get you started.
It takes the value of a sensor (in this case a water sensor that also provides temperature values).
The sensor will give you a numeric value with a C at the end.
This template strips the C, turns the number into a float (now you could do some math with it if you wanted) and finally rounds it to one digit after the comma.
In order to be able to show it in HA as a graph, it also assigns a unit of measurement
Yes - sorry, forgot to mention the config.yaml — very old school – I know
You can of course also do it in the GUI
create helper
template sensor
in the field “State Template” you just enter the same info as before:
{{ (states(‘number.heatbooster_hb_1_achter_fan_speed’) | float | round(0) ) }}
I guess the advantage with the GUI is, that you get an immediate readout of the template sensor as preview on the bottom. That way it is easier to play around with the parameters .
Frank’s code example is based on the legacy way of creating a template and I had already some sensors in the new format in my configuration file.
This is the code result (so far)
Edit: although original script is working, you get a log error because default is missing
changed line: state: “{{ (states(‘number.heatbooster_hb_1_achter_fan_speed’) | round(0) }}”