Open Id2ndR opened 7 months ago
Thank you for sharing the queries -- I've heard about these issues before with other energy-related plugins, sad to see my plugin isn't be safe from it either.
Since you're talking long-term statistics, can I assume that you use the energy_generated_during_lifetime
sensor for your energy dashboard? If so, I would like to suggest trying the energy_generated_today
sensor instead, which resets anyway at midnight. If your stats became messed up at 2 december I see the same 0-value in my log, but looking at the energy dashboard the daily value matches what I see in the APS EMA app.
Ideally I would like to fix the false 0-values, but that'll require a lot of effort I'm afraid.
Thank you for your suggestion that may effectively mitigate this issue. I'll change my setup. Your guess was right about the 2 December. The APS API seems to be unavailable about every two month.
It seems that when the APSystems webservice is unavailable or came back online, this integration start with value "0" for the sensors instead of null.
At this time HA considers 0 as new index value of the counter, as a counter that restart at 0 each month for example. But the value that follow after this is the (total increasing) sum from APSystems which is then consider as the instantaneous production by HA, and is added like that in the long term statistics.
As I use this HAAC extension since the beginning of my solar production, I can workaround this issue by setting the long term statistics directly to the value from APSystems: