I have a problem with the print time and print time left
The argument of the sensor is not a time that grows / falls in the sensor are defenite states with the time:
I expected it this way:
So far not the problem, but i want to extract the minutes e.g. till the file is finished/ or minutes untill now:
till now:{{( (as_timestamp(strptime(states('sensor.octoprint_print_time'), "%H:%M:%S")))|int) }}
local {{( (as_timestamp(strptime(states('sensor.octoprint_print_time'), "%H:%M:%S")))|int)|timestamp_custom('%H:%M:%S') }}
hour: {{( (as_timestamp(strptime(states('sensor.octoprint_print_time'), "%H:%M:%S")))|int )|timestamp_custom('%H') }}
minutes: {{( (as_timestamp(strptime(states('sensor.octoprint_print_time'), "%H:%M:%S")))|int )|timestamp_custom('%M') }}
results in template:
till now:-2208992163
local 00:03:57
hour: 00
minutes: 03
in the configation,yaml this templates do not work
So finally is it possible to change the format of the argument of the sensor to get a timestamp?
I have a problem with the print time and print time left
The argument of the sensor is not a time that grows / falls in the sensor are defenite states with the time:![image](https://user-images.githubusercontent.com/35165536/136650745-5cdc92cd-2217-4a83-b0e2-19bdfb762cf9.png)
I expected it this way:![image](https://user-images.githubusercontent.com/35165536/136650798-fc371044-d859-4e44-b3ff-0c6c42ae570b.png)
So far not the problem, but i want to extract the minutes e.g. till the file is finished/ or minutes untill now: till now:{{( (as_timestamp(strptime(states('sensor.octoprint_print_time'), "%H:%M:%S")))|int) }} local {{( (as_timestamp(strptime(states('sensor.octoprint_print_time'), "%H:%M:%S")))|int)|timestamp_custom('%H:%M:%S') }} hour: {{( (as_timestamp(strptime(states('sensor.octoprint_print_time'), "%H:%M:%S")))|int )|timestamp_custom('%H') }} minutes: {{( (as_timestamp(strptime(states('sensor.octoprint_print_time'), "%H:%M:%S")))|int )|timestamp_custom('%M') }}
results in template: till now:-2208992163 local 00:03:57 hour: 00 minutes: 03
in the configation,yaml this templates do not work
So finally is it possible to change the format of the argument of the sensor to get a timestamp?