mr-manuel / venus-os_dbus-enphase-envoy

This Venus OS driver gets the data from the Enphase Envoy-S and displays it as PV Inverter. It works for all phase combinations. Additionally it's possible to post the data to multiple MQTT topics to get more detailed informations/monitoring for the Enphase system and single inverters.
MIT License
15 stars 2 forks source link

Production Values Incorrect #8

Closed brucedavidson closed 10 months ago

brucedavidson commented 10 months ago

Thank you so much for this package. Works super well and saves me buying an ET112 🙏🏻.

One small issue - if / when the script is disconnected from the Envoy and then gets reconnected (assume bad WiFi on Envoy), it seems to load the EnPhase system’s full (lifetime) production values (27kwh in my case). It then reflects in VRM as if that 27kwh was produced in that moment in time. It does this every time it gets disconnected and reconnects (as a result of poor WiFi this has happened 5 times today). As a result, my solar production and values for today are wildly inaccurate (over 150kwh of production being reported where only around 30kwh has in reality been produced).

Would be awesome if it might be possible to fix this bug.

mr-manuel commented 10 months ago

Hi, probably it writes shortly a 0 until the data is fetched and then it provides the correct data. Have you an one phase or three phase system?

mr-manuel commented 10 months ago

Could you please also check your logs, if there are any relevant entries like that a request took longer than 5 seconds?

brucedavidson commented 10 months ago

Hi, probably it writes shortly a 0 until the data is fetched and then it provides the correct data. Have you an one phase or three phase system?

I have a one phase system. :)

brucedavidson commented 10 months ago

Could you please also check your logs, if there are any relevant entries like that a request took longer than 5 seconds?

Certainly - will check the logs now and confirm.

brucedavidson commented 10 months ago

Could you please also check your logs, if there are any relevant entries like that a request took longer than 5 seconds?

I can see in the logs multiple instances through the day of the following:

'Max retries exceeded with url: /production.json?details=1 (Caused by NewConnectionError' 'ERROR:root:--> fetch_meter_stream(): 5 errors accured. Stopping driver...' ' WARNING:root:--> fetch_production_historic(): HTTP request took longer than 5 seconds: 21.285921 seconds'

mr-manuel commented 10 months ago

Try to change the 0 in this line

https://github.com/mr-manuel/venus-os_dbus-enphase-envoy/blob/08d904e55820cdb2741bac586395d9ca9ae0d561/dbus-enphase-envoy/dbus-enphase-envoy.py#L1593

to None like this

'/Ac/Energy/Forward': {'initial': None, 'textformat': _kwh},

Then restart the driver by launching bash /data/etc/dbus-enphase-envoy/restart.sh. Tell me if this solved the problem.

I found no other evidence what else could cause this. Have you maybe an InfluxDB and Grafana where you could monitor the value?