Hi,
I wanna built a timer coutdown for a script that can be use to delay turn off a device. So, on my wallpanel I would like to display the minutes remaining before the device will turn off.
To do that, on my script, before calling the delay sequence I set a mqtt sensor that will hold the “stop hour”.
So by exemple if I call my script at 15h00 and use a timer of 10, I’ll have in my sensor 15h10.
Now, I’m trying to get the minutes between my “stop hour” and now.
{% set stoptime = strptime(states.sensor.stoptimertimer.state, "%H:%M") %}
{{ stoptime }}
{{ strptime( now().strftime("%H:%M"), "%H:%M") }}
{{ (stoptime - (strptime( now().strftime("%H:%M"), "%H:%M"))) }}
With that, I’m getting the difference in a result like this :
0:03:00
How can I “convert” this to always get an integer (3).
Thanks in advance