Closed MadPatrick closed 8 months ago
Hi Patrick,
As I don't have an electric car, it is difficult to test.
Could you update the code on line 397
charging_time_remaining = round((self.myVehicle.fuel_and_battery.charging_end_time.astimezone(pytz.utc)-self.myVehicle.timestamp.replace(tzinfo=datetime.timezone.utc)).total_seconds()/60, 2)
towards
charging_time_remaining = max(0, round((self.myVehicle.fuel_and_battery.charging_end_time.astimezone(pytz.utc)-self.myVehicle.timestamp.replace(tzinfo=datetime.timezone.utc)).total_seconds()/60, 2))
This should set the remaining charging time to zero in all such cases.
Let me know if this works and I will include it in the code.
Hi Filip, Thanks for the quick responce.
First try crashed my Domoticz. I'll try tomorrow some more testing and set debug on
There is not any reason why Domoticz would crash with this... The only change is that the value is set to zero when a negative value is calculated. If I would have made an error in the python instruction, you would see an error in the log.
I made a type.......
On my production server it is running, but the negative value is not corrected. On my test server (copy of production server) is has adjusted the value.
Maybe i need to charge the car to trigger a different value. Value has not changed between the script changes, so maybe it will not update domoticz
Hello Filip,
It looks like it is now working. I had something strange inmy Domoticz database (couldn't enable new devices for my hardware list) Restored an old backup and the setting the negative value to 0 looks working now.
I'll test it the next couple of days ( I need the empty the battery and charge the car a few times)
Thanks for the support !!
The remaining charging time when nog connect is negative When you connect the charge plug it will give the correct value, but when it not charged for a few hours/days the time becomes negative