#Rounding of time (solved)

1 messages · Page 1 of 1 (latest)

agile prism
#

I wan't to remove the decimals, any idea what I am doing wrong?

vast hollow
#

Remove the quotation marks to start (the ones at the start and end)

agile prism
#

Allready tried that, i've also tried to round the value one more time . However without dividing the sensor value with 3600 rounding works.

vast hollow
#

What is the format of the original state you are trying to round?

agile prism
#

the format is seconds, i want hours

vast hollow
#

{{ (states('sensor...') | float / 3600) | round(0) }}

#

you need to round after the division, not before

agile prism
#

That did it thanks 🙂