Add "Minutes to arrival" as an attribute to the "Arrival time" to the Tessie integration

It would be very helpful to have the estimated time to arrival in e.g. minutes be available in the tessie integration. A convenient way to have it might be as a attribute to “drive_state_active_route_minutes_to_arrival”

Use case:
I would like to let home assistant open my garage door 45 seconds before I get home in my car.

My current situation is, that I struggle to do some math with the value I retrieve from tessie. I get something like 2024-03-07 06:58:00.464541+00:00 as estimated time of arrival. Since this gives me only a wallclock time and not minutes to arrival it is no good for my use case.
I am just not clever enough to get the code correct. Like:
{{ states(‘sensor.tessy_zeit_bis_zur_ankunft’) - now() < 0.75 }}

This might also be interesting for other users.

Thank you very much @Brett_Adams in advance!

{{ (states('sensor.tessy_zeit_bis_zur_ankunft')|as_datetime - now()).total_seconds() <= 45 }}

If you have it as an attribute in minutes, other people will want it in seconds and not be clever enough to get the code correct.

1 Like

Fair point!

Thank you very much! I will give it a try once I have started an active navigation to get some meaningful data.