I have a template sensors setup and I want it to round the value to a single decimal place. It doesn’t seem to do this each time. Can someone tell me what I am going wrong?
Thanks everyone. This is working great. Now that I think of it. Would it be possible to eliminate the decimal place altogether? Just have a whole number?
Edit: forgot that just truncates the decimal, effectively rounding the number down regardless of its value. Simply changing round(1) to round() would be a better choice.
I use that in all my energy sensors (rounding to 2 but that shouldn’t make a difference?), and never have seen the epsilon error, (which I am studying now…)
Thanks folks. I am very close. Right now I have this:
value_template: "{{ ((states('sensor.smartups_load')) | int / 100 * 1500) }}"
This is giving me the old epsilon error again. May decimals. I’d like to not display any decimals at all if possible. I just want a value thats says 250 for example. Not 250.0
Epsilon error is in all languages. In all honesty, it should be applied on the state level by the core. And us as users should only have to specify a number of sig figs at the sensor level, with a system wide level to fall back on.