serkri / SmartEVSE-3

Smart Electric Vehicle Charging Station (EVSE)
MIT License
67 stars 28 forks source link

Total Charged energy not initialised correctly #212

Closed ocaj-nl closed 8 months ago

ocaj-nl commented 8 months ago

I have an SDM630 connected directly over Modbus to the SmartEVSE and configured as EVMeter. This works excellent.

However, if the SmartEVSE is restarted or new firmware is uploaded, the "Total Charged"-value remains 0 (both on the web-page and over MQTT) and only starts displaying/sending the correct value once a car is connected/charging. From that point in time it remains correct.

If I look at the indication on the SDM630 (small "phone"-symbol on the display) the EVMeter is read over modbus continuously by the SmartEVSE, not only while a car is connected. Somehow the Total Charged-information is not updated internally in the SmartEVSE until a car is connected?

I tried finding a cause in the source, and found the code to set EnergyEV from Modbus in line 2966 of evse.cpp, I'm not sure why this is not triggered after reboot until a car is connected?

dingo35 commented 8 months ago

Line 2966 is called on receiving a response of the modbus request, so EnergyEV should be filled with the right value as soon as it is read from the modbus.

I dont have access to my SmartEVSE right now so cant reproduce/debug this, Im afraid you're on your own here...

ocaj-nl commented 8 months ago

Ok, I restarted everything and now it just works fine. I suspect that something went wrong when earlier this week I temporarily disabled the EVMeter (as part of analysis of issue #210 ) and then reenabled it things got messed up. I'll close the issue as everything works fine now.