Hi there,
I am struggling calculating the remaining time of a sensor (timestamp information). The idea is, the calculate the remaing time in minutes until the timestamp given by the sensor.
I am fine calculation the remaining time compared to a fixed time unable to change it to the timestamp.
states(‘sensor’) → 2023-08-26T11:59:43+00:00
following approach works, but I am unable to replace time by the timestamp of the sensor.
{% set time = “14:45” %}
{{ (((as_timestamp(strptime(time, “%H:%M”))) - as_timestamp( strptime( now().strftime("%H:%M"), “%H:%M”) )) /60) | int}}
Any help would be apprecaited - thanks
JJ