Try {{ (value / 1000) | float }}. It happened to me many times that the formula gives no error inside Dev Tools but gives conversion errors when inside an automation.
Tried also with {{ (value / 1000) | float }} … the sensor is skipped and no error in the logs.
With {{ value | float }} it work fine.
How I can debug? where to find the error?
value is the default variable name for the output of a RESTful component (https://home-assistant.io/components/sensor.rest/).
About value I’m sure that is work and refer to a right output because if I use {{ value | float }} this visualize the correct number in the UI.
Now the last question is … how to define the precision of the float? In the UI I’ve 3 decimals and I want to display only 2 decimals.
How I can achieve this?
If {{value | multiply(0.1)}} works and {{value/10}}does not work, that means that value is coming in as a string. You can’t do math on a string, you first have to convert it to a number. That’s why the filter works. You could also do {{value | float / 10}}
It seemed to work, but it was a casuality… My UI show randomic decimal points… some time 2 decimal, some time 3, some time 10 or more…
So, how I can show only 2 decimal point? float(2) seem to not work.