-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Daily Energy steps up massively every time consumption resumes from 0 #598
Comments
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. |
This issue continues, and renders the Glow useless for daily power consumption, and only useful for instantaneous power monitoring. This issue shouldn't be closed off, even if there is no solution, because people need to be able to find that it as a serious limitation of the platform. |
I think the best solution at this point is to put a note somewhere in the documentation that it is best not to use glow if you also have solar panels. What you also can try is using a different method: ./Klaas |
Happy to try this out - is there a way I can make this change onboard the Glow itself, rather than making a Template sensor in HA - would be good to still get the advantage of the 'always recording' glow, even during a system reboot, etc. |
I have noticed this in testing as the test pulses I've been using are not well timed and I will wait long periods before testing it again. I think Klaas means you can change the method of the total_daily_energy sensor by adding this to the adopted devices ESPHome YAML:
Petro on the HA Community Forum has a great explanation of this here, where he also suggests that There is also this post which says that for square waveforms, the This is totally untested and only based on some research and assumptions on what Klaas meant because I have also noticed this issue. I will report back if/when I get a chance to test. |
I think that is a limitation of the pulse meter method in general. The pulse meter only knows the data that is there (the pulses), it makes assumptions about what the value was in between polling samples because the Riemann sum is an approximation. The CT clamp has a much higher polling rate in comparison. Have a look at the Wikipedia page for graphs that visualise the methods: https://en.wikipedia.org/wiki/Riemann_sum Despite that, I think maybe you'd got some false signals in your data, or noise? I think that even if the approximations of energy consumption are wrong, the total at the end of the day should be correct because for every x kWh consumed, there must have been x * Disclaimer, it's a Friday morning before I finish work for Christmas so take the above with a grain of salt. |
The graph does suggest the "stepping up" is the cause, based on the CT clamp being flat. I've just checked the total daily energy component page and it says it uses the integral. I'll admit complex math is not one of my strengths but I can't understand why it uses an integral. Counting total daily energy with a pulse meter is as simple as dividing the number of total pulses received in a 24 hour period by the pulse rate. @klaasnicolaas am I missing something critical here? It seems to be that doing the above and simply counting every pulse as 1/pulse_rate kWh would give more accurate numbers than relying on integrals and assumptions. The A template sensor that calculates the difference between the value of |
I hope this won't get seen for a few days as you should all be celebrating with your families but I've been thinking about this for days and it's bothering me tonight. @kineticscreen after the Christmas period, when you get a chance, try dropping this Home Assistant automation in and allow your total energy graph to build up over a 24 hour period. Compare the zeroed total energy graph against the CT clamp and the Total Daily Energy (integral based) graphs.
Barring any filters you've applied to the total pulse meter output, I think you will find that the total at the end of the day is much closer to your CT clamp (assuming it's accurate) and you'll also have a smoother graph with less steps. If my logic is right, this should fix all of the numerous issues of this nature reported with Glow, especially from this with renewables. Of course it will need a properly integrated solution but I'd like to prove that graphing the total is more accurate than using the Riemann sum. Hope you all have a great holiday period and please don't prioritise this meaningless stuff over your families. I'm only posting this now because it's stopping me from sleeping tonight! Merry Christmas. |
I'm confused what this would solve, as it just triggers a reset to zero at midnight which happens anyway. The issue isn't the midnight reset to zero, it's the 'coming out of zero' moments that happen throughout the day, when grid use changes from export to import. Is there something else apart from this automation that I'm missing? |
You might have missed the extra stuff I put in the comment prior.
The total doesn't reset, the daily energy graph resets but the total is persistent until manually reset. They use different counting methods. The daily energy component is intended to be used with hardware that outputs energy use in watts, measured directly. In the case of the pulse meter, we're not really measuring watts, we're measuring the time between pulses and estimating the watts. This means the "daily energy" is based on an estimation and is often wrong when pulses are irregular. It also uses the Riemann sum which is also an estimation and imperfect, doubling down on the errors. The total amount of energy we use in any period is much easier to calculate than that. Every pulse is always 1/ The HA automation I posted is a quick fix to reset the pulse meter If you add the automation to reset the sensor at midnight, we can allow it to graph for a 24 hour period and you can compare it to your CT clamp and the Hope I explained myself clearly enough. Merry Christmas :) |
Glad you caught on to my iffy explanation! I don't always explain things very well. It does look like the yellow line follows the shape of the red one better than blue does, especially around 6:00pm when the blue line has a bunch of steps. I'm still with in-laws at the moment but I'll see if I can get a better ESPHome component to track the yellow line daily. I fear the other utility meter components may also use the Riemann sum but I'll have to check. Thanks for your data |
That's reassuring. A bit odd that it strayed at the end of the day. I wonder if your photodiode was missing pulses? As you say, trialing for a few days will see how accurate it is long term against the CT clamp and also the existing daily Riemann sum sensor. |
How strange. I'm not sure why that would be. There doesn't appear to be a pattern. My possibly slightly biased theory would be that the CT clamp is overmeasuring because of estimations it makes itself in between data points, although it's clear it has a much higher sampling rate than the meters usage LED provides. Of course Glow is also relying on capturing all pulses with 100% accuracy. Are you confident it's not missing any, maybe due to internal_filter being too high or the photodiode not being sensitive enough? If it is capturing with 100% accuracy I can only imagine that the CT clamp is overestimating, if my previous assumptions are correct. |
After having stabilised the instantaneous consumption data errors I was getting by adding the
internal filter:
as well as ensuring no feedback from flashing LEDs, this has revealed a different issue, where the Daily Energy increases by huge numbers every time the unit starts to detect consumption again, after a period of 0 flashes due to adequate solar generation:As you can see, this not the result of an incorrect reading of the Consumption - only momentary modest pulling from the grid is accompanied by massive instantaneous jumps in the daily total.
Has anyone experienced this? My only thought it is somehow connected to the 4-5 minute lag the unit has to changing power consumption to 0 once the flashing has stopped. And somehow when it kicks back in, it's assuming a value across the time that should be 0?
The text was updated successfully, but these errors were encountered: