Cant convert to int

Hi all.
Try to make cert expire sensor in days (who was before but lost in newest versions of HA)

"{{ (as_timestamp(states('sensor.cert_expiry_timestamp_blog')) - as_timestamp(now())) / 86400 |  int }}"

but this template anyway show me float result - 45.0455884278814 for example

why and what I do wrong?


you need to wrap it in parenthesis:

"{{ ((as_timestamp(states('sensor.cert_expiry_timestamp_blog')) - as_timestamp(now())) / 86400) |  int }}"

As @Hellis81 said. Your original was only doing the int on the 86400.

my bad. thanks