briancmpbll / home_assistant_custom_envoy

173 stars 76 forks source link

Battery charge / discharge stopped working #135

Closed cmack66 closed 11 months ago

cmack66 commented 11 months ago

All other entities are working fine, but recently I have lost all data related to charge discharge of battery. Battery charge percentage is working correctly. Any advice on how to troubleshoot further?

77degrees commented 11 months ago

This is happening to me as well

catsmanac commented 11 months ago

If it changed recently, what else that you can think of changed too:

To see what the envoy is using for reporting enable debug on the envoy device. In HA go to the integrations page and click the Envoy. In the envoy Integration page click 'Enable Debug logging' (depending on your HA version it might be in the 3 vertical dot menu) . Let it run for a couple of minutes to perform some collection cycles. Then in the same page click 'disable debug logging' and the log file will download to your pc.

In the log file you'll find debug entries of what data it collected. It includes the raw data collected from the Envoy. Feel free to upload the file here (as file, do not paste content here) , but best remove the Enphase token as that is the access key to your envoy. (future version will not include the token in the log anymore)

cmack66 commented 11 months ago

No other changes were made when the issue began to occur - here is the requested debug. Thank you for your help. home-assistant_enphase_envoy_2023-08-13T13-03-57.360Z.log

catsmanac commented 11 months ago

@cmack66, your logfile shows errors when handling a change in current_battery_capacity. It is expecting an integer value for the previous value. The error states that the previous capacity was not an integer and shows it as '6.888'. Does that number makes sense for current_battery_capacity?

This code has not been changed in 10 months. I can change it to expect a floating point number, but if that 6.888 figure is not correct then something else happened. I think that battery capacity would be reported in Wh and that a number of 6888 might be realistic?

Maybe have a look at battery capacity history if you see some sudden change?

cmack66 commented 11 months ago

@catsmanac I changed the value previously of current_battery_capacity to display KWh, but I did not think that would affect the number being reported to the integration. It looks like changing it back to Wh and 3 decimal places fixed the issue. Thanks for your help.