-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Data @ 11pm-12am is lost every night #45
Comments
I think this may be related to a time zone calculation error I have spotted. |
I think there is possibly a second factor here as well. The data from DCC is delayed up to 30 minutes. Or a second case. Not an easy fix, as HA works on “now” reading, so you can’t push history into HA to close out “yesterday”. Let’s see what @HandyHat thinks, but maybe worth a question on HomeAssistant wider forum to see how other integrations deal with it. |
Another possibility could be to change the sensor behaviour (or a new sensor) to not reset to zero at midnight, by reading the cumulative data instead. Feature Request #25 |
I think I understood what you were saying about the sensor using post-midnight data until a full set of 24hrs was accumulated, but I'm no technical expert, so no real idea how that could work. But I am wondering where the data disappears to? I mean, presumably the DCC has a full 24hrs of data, and sends it every 30mins on request? So if data is 'lost' from the sensor, then it must be being over-written with the next 30mins of data?? Or is HA request data from the DCC by timestamp - so if it doesn't request data for 11.30pm-12.30am, then the DCC never sends it? Isn't DCC data timestamped? Can't the data values be stored in the sensor based on DCC timestamp? And if the issue is the "upto 30min" data delay from the DCC, why does it always seem to be zero rated for 1hr from 12am every night without any variation to it (at least I think that's the time period it shows 0kWh). Also, why bother resetting the sensor to zero at midnight anyway? After all, my SMETS2 SmartMeter doesn't reset it's meter value at midnight, so why doesn't the sensor value just reflect the kWh reading from the SmartMeter? Sorry for all the dumb questions which doesn't help fix the 0kWh value around midnight. |
The zero could be related to this. The choice to reset the sensor at midnight is an implementation choice to give the “consumption today”. I think it would be easy to put this in place, as an add on to the PR I’ve just made. |
Well, I'm no expert, but I do think resetting to zero at midnight everyday isn't the best idea. I mean, 24hrs is just an arbitrary thing to help us humans figure out how much energy we're using from day to day. I think it would be better to just keep accumulating indefinitely (same as my SMETS2 meter does). Why do you have to reset it annually? Can't the value just 'match' the SMETS2 meter reading which never gets reset (well, maybe it does when it reaches 999999kWh). |
A year’s consumption is the biggest chunk of data the Glow API will return. |
Looking at p9 of the documentation, can't the electricity be returned at minute level (losing a minute or two at midnight is going to be irrelevant), and gas at the 30min level, the majority of people probably don't burn at lot of gas around midnight, so losing an hour of gas consumption at midnight is probably not going to have much impact on the daily kWh or £ cost of gas consumed. Whereas most people are probably consuming a background level of electricity throughout the day & night. So perhaps two different sensor data retrieval periods would be appropriate? Sorry, my lack of understanding how it all works is probably resulting in a lot of dumb questions |
Sadly you can’t get the per-minute data for free via DCC as it will only update the data from your meter once every 30 minutes. |
Okay. Well I suppose the real issue is: because In the attached graph of Obviously, like most people, I'm never not burning electricity every 24hrs. It's constant consumption. So there should never be any flatlined zero consumption showing in the graph (unless I was to switch off my entire electricity supply). At least, I think that's what the problem is :) If the inherent 30min/DCC thing means it's simply not possible to ensure the data around midnight isn't lost, then perhaps the best thing is to say it's for 'guidance only' and just close this issue? |
Let’s summarise…
I’ll work on point 2. When this is added the documentation can be updated. |
In the Hildebrand Bright app (which I think must get it's data from the DCC too?) it doesn't appear to be missing any data around midnight - see attached image. However, I think this is something that has changed between their currently 'released' version of the app and the 'beta' version available in the Google PlayStore, because I think I started to notice this same issue when I looked in the app, and then I joined the 'beta' programme and looking this morning it appears to be fine. |
We are agreeing. The data is all there in the Glow API / DCC. It just how you get at it and manage the 30 minute delay. The Home Assistant model assumes real time data, not historic (30 minute old) data. I have a proposed solution in my summary post above, let’s wait and see if that works. |
I now have the cumulative (Usage since Jan 1 in current year) sensors implemented in my test system. |
Yeah unfortunately it is impossible to backdate data in Home Assistant from what I can tell. Using cumulative on the energy dashboard means that some days will be overreported, as the usage during the last 30 mins that is missing will get attributed to the next day :( |
- Clarifies that data is lost in the last 30 minutes of the day, closing #45 - Compresses the added sensors - Add all the collaborators and users to the credits
I've clarified that the last 30 minutes of the day will be lost on the daily sensors, the bug in the calculation of DST has been fixed and cumulative sensors have been added. Please reopen if you are still losing more than 30 minutes of data! |
Each night at the end of the day, the accumulating value of kWh consumed is reset to zero and begins increasing again for the next day from after midnight. This value (for electricity) is
sensor.electric_consumption_today
However, if you use a HistoryGraph (see attached image) to graph
sensor.electric_consumption_today
it's apparent that there is no data from 11pm until 12.30am every night (the consumption data is zero for at least 1.5hrs). This means that there is at least 1.5hrs of consumption not being accounted for every night.Expected behaviour would be for consumption data to continue until 12.00am when it would reset to 0kWh and begin accumulating again from 12.01am.
HomeAssistant v2021.10.6
Hildebrand Glow (DCC) integration v0.3.3
The text was updated successfully, but these errors were encountered: