ksheumaker / homeassistant-apsystems_ecur

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

Wrong value #183

Closed hekmanViii closed 7 months ago

hekmanViii commented 1 year ago

The sensor Ecu energy Today counts up the produceced energy, but once in a while is records the total energy of that day instead of the last xx miniutes. Which results in double the energy produced.

Ganzhans commented 1 year ago

ik think I have the same, but do you mean the hole dat double or only a one time reading double. For me its a one time reading only :)

20 minutes before every thin was fine !!

Screenshot 2023-05-31 at 16 29 11

Screenshot 2023-05-31 at 16 27 10

Ganzhans commented 1 year ago

and is it possible to correct it by hand and ...... how ?

hekmanViii commented 1 year ago

Yes its reading the total day value (till that moment) instead of the use fort hat moment.

So its reading like: 0,25 kWh, 0,35 kWh, 11,60 kWh, 0,25 kWh.

I can correct this by going to [development tools] [statisics]

Search for ecu.

[ECU today Energy]

Clikc on the icon far right.

Find the time and correct the number.

Van: Ganzhans @.> Verzonden: woensdag 31 mei 2023 16:37 Aan: ksheumaker/homeassistant-apsystems_ecur @.> CC: hekmanViii @.>; Author @.> Onderwerp: Re: [ksheumaker/homeassistant-apsystems_ecur] Wrong value (Issue #183)

and is it possible to correct it by hand and ...... how ?

— Reply to this email directly, view it on GitHub https://github.com/ksheumaker/homeassistant-apsystems_ecur/issues/183#issuecomment-1570363122 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A5B7NDZXKX3UMRGEXXQXEATXI5JRZANCNFSM6AAAAAAXQK6AQI . You are receiving this because you authored the thread. https://github.com/notifications/beacon/A5B7NDZDEQ5EOBMN3K32RSTXI5JRZA5CNFSM6AAAAAAXQK6AQKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS5THLPE.gif Message ID: @. @.> >

Ganzhans commented 1 year ago

I see the [ECU today Energy] entry but I don't now what the correct values mus be ....... I edit some thing, but when en where can I see the new values Engery values on the live section or energy dashboard also ?

hekmanViii commented 1 year ago

storing

hekmanViii commented 1 year ago

See post before this happens about once or twice every week. The day total comes in place of the total for 19:40. I have to correct this or my stats will be disrupted.

HAEdwin commented 7 months ago

I am currently evaluating a change that uses the historical data that the ECU stores. This has a number of advantages, including a correct display of Energy Today in /100 resolution (Wh) regardless of HA restart. There's initially a small difference between the ECU/HA value of Energy Today and the EMA site. I noticed that the EMA data is being corrected after the ECU finished maintanance in the evening after sundown. Hopefully this weekend I'll be able to prepare a pre-release.

HAEdwin commented 7 months 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 7 months ago

@hekmanViii @Ganzhans

If you are trying v1.2.31b you might have an issue with the Today Energy. I have forgotten to specify END in the suffix.

Line 38 of APSsystemsSocket.py should be changed from self.ecu_energy_history_suffix = "END00\n" to self.ecu_energy_history_suffix = "END00END\n". Then restart HA and see if that made a change to Today's Energy.

HAEdwin commented 7 months 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. Notice that there might still be a small difference between the ECU en EMA values. EMA does it's own calculation but is sometimes adjusted by the maintenance interaction with the ECU in the evening.