Utility meter offset and energy dashboard

Hi,

I am pulling data every 30 minutes from an API that holds energy usage in kWh. The API is n3rgy for UK power and gas meters.

The energy data is updated in 30 minute intervals, and I am polling this every 30 minutes and 5 seconds. Each reading contains the consumption for that 30 minute period.

I need to create a sensor in home assistant that can accept the fact that the value changes with every update, for example update 1 might be 2 kWh, and update 2 might be 4kWh. I have figured out how to make a utility meter to capture this.

The issue however is the midnight reading, in that the 00:00:05 reading will actually be from 23:30:00 the previous day, until midnight. If I add this sensor to the energy dashboard, this 30 minute slot will fall into the next day.

Any ideas? Would an offset work and how would this work with the energy dashboard?

Thanks.

Unfortunately I’m almost certain it is not possible to have the update appear in the previous day.

Is the 30 minute update a limitation if the API or your polling?

That is discussed before. It is a physical limitation of measuring consumed energy. You have to observe it before you can report it. So if you want consumed energy within an hour, you have to report it after the hour is finished.

Regarding the energy dashboard, this is a major fault with it. And it could be easily solved if it was possible in the configuration to input an offset. All electricity meters in scandinavia are reporting consumed energy a few seconds after the hour. An offset would make this work in the energy dashboard for 20000 HA users in the nordic countries.

1 Like

No. A sensor can report the total a lot more often than every hour. e.g. This SMA energy sensor updates the total energy imported every 5 seconds:

At 12 minutes past the hour the energy dashboard takes the value closes to the end of the past hour.

Feel free to create a new feature request if there is not one open already (search first):

It is still reporting this after the 5s interval is finished. My point was that every energy counter (or sensor) is doing this. They report the energy used some time after the interval has finished. Some do it each 24 hours. Many at 1 hour interval and some more often. The energy dashboard fails completely on that. It seems to work when the interval is short, but there still is en error there when you have a new hour or day.

And before you suggest that I should buy a new sensor. That is not possible. The energy meter is owned by the grid company and is not replacable.

Yes it is but you specifically said:

and I said sensors do not need to do this. The reporting interval does not have to be at the end of each hour.

Can the energy dashboard be improved for slower reporting sensors?

Sure. But it is all we have at the moment. Feel free to suggest improvements.

Perish the thought!

You can however create your own template sensors & utility meters to track your use and costs if the dashboard does not work for you.

I had my own energy and cost tracking set up before the energy dashboard was released. I set up the energy dashboard anyway but rarely look at it. My own system is more comprehensive and can do things the energy dashboard can’t, like tracking fixed daily supply costs and predicting my monthly bill. It does use a couple of the energy dashboard graphs but they could be done with apexcharts if I wanted to.

When was the energy dashboard released? Is it 2 years ago? There has been A LOT of discussion and complaints about this and I dont think it helps to make a feature request.

I have. But I regard myself as an experienced user and able to do what is needed. But there is a lot of users that dont have a qlue and they dont even know the reason why the energy dashboard is wrong. They compare it with the graph at the grid company’s web page and see that Home Assistant got it wrong and is not usable for tracking energy in Norway, Sweden or Denmark.

Another problem with the energy dashboard is that it is not able to get the price correct for the used energy. The price is changing every hour, but the energy used is approx 10s late. Even if the energy used was not delayed, there would still be timing issues. 0.0001ms after a new day or hour has started and the reported energy would be on the wrong day or hour with a wrong price. And the energy sensor has to change before the price sensor changes.

I am, as you understand, not using the energy dashboard. It fails completely IMO. And I find it strange that it is not fixed, but I accept it as it is. I use something else.

Improvements and additions have been made since then (water tracking for example). And more will be done.