alandtse / tesla

Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Apache License 2.0
600 stars 99 forks source link

min_to_full_charge attribute of time_charge_complete sensor not updating? #530

Closed codedesperate closed 1 year ago

codedesperate commented 1 year ago

Hi there, I am looking very much forward to being able to use min_to_full_charge, as I can then make a automation to go pick up my car from the public charger 10 minutes before it finishes. This way I will be at my car when it is finished, and i will avoid penalties for still being connected to a charger while fully charged.

However, this attribute only updated when the car gets provides this info. So typically I will see this attribute have the values 55 > 41 > 36 > 26 > 14 > Finished

As it rarely ever hits 10 minutes exactly, this is very difficult to make an automation upon. Is it possible that once the min_to_full_charge attribute has a value set, it will by itself start counting down, and only be corrected if the car gives a new value? This would avoid this attribute not decreasing properly like 55 > 54 > 53 > 52 and so on.....

alandtse commented 1 year ago

We only present what the API gives us. Your automation can make the calculation on minutes left based on last update and the attribute. Alternatively, you can rely on the existing timestamp for targeted completion.

codedesperate commented 1 year ago

Hmm okay. I've previously had issues with the timestamp not updating as the car changes it's estimated completion time. I already have a automation that triggers 10 minutes before the provided timestamp, but it didn't work as the timestamp didn't update correctly.

That was some time ago though. Next when I charge I'll keep an eye on the timestamp and see if it updates. Thank you for the input.