hultenvp / solis-sensor

HomeAssistant integration for the SolisCloud PV Monitoring portal via SolisCloud API
Apache License 2.0
208 stars 42 forks source link

Zeroing at sunrise on daily consumption #2

Closed richhalliwell closed 3 years ago

richhalliwell commented 4 years ago

hi just wondering what your plans are with the daily energy. I note your comment:

energytoday: Total energy produced today. Note: This value is not necessarily zeroed at midnight but at the moment the portal receives first value from the inverter again after midnight (in my case at sunrise when the inverter switches on. May behave differently with different inverter and/or logger models)

This means that if you plot daily energy - group by daily, aggregate MAX you can often end up with it picking up the wrong day's max (previous day for the current).

Where i try and use utility_monitor to take daily measurements from the total_output measurement via sampling, it is never as accurate as what the plant thinks it has done in a day.

i'm running out of ideas to fix this. I guess you could force a reset to 0 of daily power at midnight (which must be what the solis ginlong web portal does in their reports).

Could this be fixed in code - or would you suggest some other work around?

hultenvp commented 4 years ago

Hi Rich,

Great to see someone else is also using my integration.

What I've done so far is not to use max(), but to use last() in my query. This works because daily energy is cumulative and I'm still asleep during the period the result of Last() is wrong ;-)

I want to fix this programmatically and zero the result at midnight and keep it zero until I see a current and or DC voltage, but I hope that until that time last() will work for you.

Cheers, Peter