So that you can track energy. This works for everyone that has sensors report the usage at the time it was collected. Not a significant delay after. Thats what you aren’t understanding. This is specific to your device. My device reports the usage the moment it is collected. This displays correctly in home assistant. If your device output it’s usage 16 seconds earlier it would work exactly how you expect it to work. But your device does not.
I understand that. But energy meters for private homes don’t send their data continously. In my home it is sent to the grid company wirelessly and it is technical reasons for not doing it more often than each hour. These meters are mandatory in the 3 countries I have mentioned.
pulled directly from the site:
so it looks like you can change the interval to make it work for you.
The meter is owned by the grid company and nothing is possible to change by the end user. But even if it is 15 minutes, the last interval would most likely still be in the wrong hour.
Don’t replace the meter. Add an additional meter for your use.
stigvi, did you make a feature request on this? I’m facing the same problem.
I just noticed this issue myself, after noticing yesterday’s reported cost was off by the equivalent of 2 USD. This is definitely an issue for all users in Scandinavia wanting to add their smart meters to HA, and I am a bit surprised by the arrogance displayed by the moderators in this thread. What about being a bit more forthcoming - other people’s reality may differ significantly from your own. You do not really want to scare users away?
To me this looks like an obvious design flaw, if you want to display engergy consumption for a time period, a least one measurement will have to be sent at/after the end of that period.
@stigvi Did you open a feature request?
No, I have not opened a feature request about this, but my plan is still to do it.
Exactly what arrogance? HA by default does not do this. Don’t shoot the messengers for telling you something does or does not work. As stated above, request the feature to be added.
HA was not designed to handled historical data as an input. HA lacking this functionality is not a bug, it’s a missing feature. I’m sorry that doesn’t work for you.
This was my impression reading the thread. It may not be intentional and I might be reading to much into it. If the initial response had been that this functionality was missing and needed a feature request, that would have been perfectly ok - but it was most definitely not.
Anyway. There is is workaround for this. The smart meter is reporting power usage (W) in a timely fashion (typically every 2-3 seconds), so getting the energy usage is possible with an integration sensor like this:
Integration - Riemann sum integral - Home Assistant’
But this kind of makes HA re-invent data that is already readily available (even though it is sent 10 seconds too late).
If you read top to bottom it wasn’t brought to light that the data was being sent past it’s measurement time until later in the thread. After that, every explanation on how home assistant worked with it’s data collection was met with distain and disbelief. I’m sure it could have been handled better, however the mods are not the only ones to blame in this ‘fiasco’.
In any case, a method to add historical data to HA has been discussed and I believe something is in the works. I have no idea what the timeframe is, this is just the whispers that I’ve heard.
This ought be changed, or at least expanded. A consumption value is a historic value, and is not the same as a state value such as voltage, current or temperature.
The Energy module consumption should consider a change in the consumption value historically. If both price and consumption updates every hour, and the price updates at 10 seconds past the hour and consumption at 12 seconds past the hour, then you’re bound to get mistakes if you calculate the cost by taking the entire consumption difference and multiplying it with the price received two seconds earlier.
Similarily, the consumption ought at least to be spread out over the time since the last consumption update. So if you get a consumption update 12 seconds past the hour, then it makes no sense to place the entire difference in the hour period in which the update came.
EDIT: When reading the entire thread, I see that you’re making a point of Home Assistant missing the functionality of handling historical data. But to be honest, you could easlily have pointed this out in the beginning instead of making snide comments about “get a better meter” and “bad data in → bad data out”. The OP’s problem (the same problem I’m having, by the way) is caused by a missing feature in Home Assistant, not by bad meters or bad data.
This is not correct at all. Here are the two first sentences in the first post:
This clearly states that the question is about historical consumption data updated every hour some seconds past the hour.
Also, try not to make it about blame. I’m sure everyone is as grateful as I am that you’re spending precious free time answering questions on the Home Assistant community forums!
And I’m also sure that everybody just want Home Assistant to be as great as possible, and in this case everybody has learned something. I’ve learned that Home Assistant doesn’t handle historical data (yet). And you’ve learned that this is a problem in the Energy module when calculating cost with consumption data being updated from grid connected meters once an hour.
Everybody wins.
You might want to check who said that. It wasn’t me. I can’t speak for why tom said that, maybe he was having a bad day.
It still wasn’t clear what the actual problem was. And OP was (and still is) is indignant about this being an issue.
I was merely trying to help explain why the issue was happening and current ways to get around it. Again, I can’t speak for what tom was trying to do.
And OP was (and still is) is indignant about this being an issue.
What?? I know perfectly well what the issue is and did so long before I posted here. As I said, I wanted some discussion about solutions to this.
“I will make a feature request, but wanted some discussion and suggestions beforehand. Unfortunately it seems no more than me see this as a problem with HA”
You might want to check who said that. It wasn’t me.
You are right. I stand corrected.
I was merely trying to help explain why the issue was happening and current ways to get around it.
And I thank you for it.
Hopefully the Energy module will be improved to better calculate cost and consumption by hour periods when grid consumption sensors have long time intervals between data points.
Maybe it’s a language barrier or something but issue = bug or something broken. This is not the case, HA was never designed to take historical data. Therefore, this is a missing feature. That’s all I’ve been saying since I joined the conversation.
I’m fairly sure it will progress to handle these cases. It’s one of the largest problems with energy right now. So I doubt it will be swept under the rug. However, I do believe it will take a while to add. So at this point, we wait (or join in the development). I still think it should be added as a feature request to see the number of impacted users through the voting system.
Got a meter, also Norway, and discovered this same issue after a day. So not only the few of you seeing this as a limitation in the current Energy feature implementation.
I can’t remember if I mentioned this, but I believe there is development in the works in relation to this. I have no time table on it unfortunately.