ksheumaker / homeassistant-apsystems_ecur

Home Assistant custom component for local querying of APSystems ECU-R Solar System
Apache License 2.0
186 stars 43 forks source link

ECU-C sometimes Today energy drops to 0 for a couple of minutes #193

Closed gratjetost closed 1 year ago

gratjetost commented 1 year ago

running the latest v1.2.29 with a ECU-C. Noticed already a couple of times the Today energy suddenly drops to 0. And after that comes back to its normal value. Leading in the HACS energy tab for a big spike and incorrect value.

image image

image image

HAEdwin commented 1 year ago

When did this issue first appear? This data comes from the ECU-C and identified as ECU data. Are there any signs of disruptions on the other entity statistics at this very same time?

What you can do to avoid this is adding the following check to APSystemsSocket.py: image

Have to see what the effects are though... normally, when the ECU goes into maintenance this value will be reset to zero and will not be visible in the graph at that time when using this quick fix.

gratjetost commented 1 year ago

first time happened on 27 april. and it happened now 4 times. All other sensors are not having the "gap" its only the today energy that drops suddenly to 0. Can you put the picture into text? So I can see what to replace with what? I'm not a programmer ;)

GillesBOULANGER commented 1 year ago

Same problem for me with ECU-C (V1.2.29), everything works perfectly and suddenly the output drops to 0. Then it comes back after a few minutes but the values indicated are very different from those provided by the android application an web site. Any ideas ? Edit : When i use ECU-IP/index.php/realtimedata/power_graph, graph seeam to be the same as HA. Then in don't know witch interface is rigth...

HAEdwin commented 1 year ago

I'll hope to pre-release a version this weekend which should solve this issue.

HAEdwin commented 1 year ago

The pre-release v1.2.31b contains an extra ECU query that introduces (part of) the use of energy history data. This is a query I previously described but was never needed (we thought). To compensate load time for the integration, I shortened the sleep-time between opening and closing the port. I also introduced the keepalive, a careful introduction to removing this sleep-time and keeping the port open. Success will depend greatly on compatibility with different ECU models and firmware. If you own an older model starting with 2160xxxxxxx ECU-R, you can even leave out the open/close functions, but does this work for other ECU models? I could make it optional in the UI settings. Anyway it should solve this issue. Please let me know if it does so that I can close the issue.

HAEdwin commented 1 year ago

I'm pretty sure Today Energy's issue has been resolved for the ECU-R, ECU-B and ECU-C. I'm closing this issue, if anything pops up, feel free to create a new issue.