I’m very new to Home Assistant and I’m trying to convert a time which I get from a Rest platform.
In the value_template I have this string “7:12:14 PM” and I wanted first to convert it into 24-format
I then created a template platform to convert the value stored in the Rest sensor into the format I’m looking for.
value_template: >
{{ as_timestamp(states.sensor.rest_time.state) | timestamp_custom(' %H:%M:%S ') }}
But this returns “None” while I did expect 19:12:14
Secondly, I want to have another time loaded in another sensor and I would like to calculate the time difference between 2 sensors:
e.g.
Sensor1: 19:12:14
Sensor2: 18:07:08
Calculation: 01:05:06
Any suggestion on how to manage at best these 2 conditions?
Thanks a lot in advance!