leeyuentuen / polestar_api

Polestar Api - Home Assistant Component
MIT License
112 stars 18 forks source link

"estimated_charging_time_to_full" doesn't account for a full trickle charge #120

Closed darac closed 3 months ago

darac commented 4 months ago

According to https://github.com/leeyuentuen/polestar_api/blob/main/custom_components/polestar_api/sensor.py#L190, the sensor estimated_charging_time_to_full is capped at 1500 minutes. However, this is not sufficient to account for a full charge using the Home Charging Cable (aka "Granny Charger").

The charging cable produces 2.3kW. Sustaining this for 1500 minutes results in 57.5kWH being added to the battery. However, I own a Polestar 2 with a 78kWh battery (there are larger Polestar 2s now, and future models are likely to be even larger), so this doesn't represent a full charge.

While it's relatively unusual to attempt a full charge using the Home Charger, it's not completely infeasible (my partner has just driven to his parents and will leave the car on charge for the whole weekend. The integration is currently warning "Value 2040 is higher than max value 1500").

As a suggestion, could we size this to allow charging 100kWh using the Home Charger? (100kWh / 2.3kW ≈ 43.5h. 43.5h * 60m = 2610m). This should be sufficient even for a Polestar 4 at release.

leeyuentuen commented 4 months ago

maybe i can just remove the limit for that entity

leeyuentuen commented 4 months ago

changed in this beta, maybe take a look? https://github.com/leeyuentuen/polestar_api/releases/tag/1.6.7

leeyuentuen commented 3 months ago

should be fix now on 1.6.10