I am trying to create an ETA (Estimated Time of Arrival) template sensor, and I’m hoping for some direction.
I have a google maps api sensor that gives me the driving time in minutes between two device trackers and is called sensor.time_between. I’m almost there, but I am struggling with one final part.
My template looks like this:
{{ (as_timestamp(now()) + ((states("sensor.time_between")*60) | int )) | timestamp_local }}
This gives me, for example:
2019-03-22 22:17:33
I’m trying to figure out to work in an strftime function into the template above so that the result would instead be:
10:17
I would normally use the following to format if I was going to format now():
{{ now().strftime('%I:%M') }}
… but I cannot figure out how to work strftime(’%I:%M) into my template above without giving me errors. Can someone clue me in?