Aggregating values

Something doesn’t seem to be “right” with my data. I’m importing readings from my smartmeter through a batch process. I get half-hour readings, which I’m logging directly to a feed with those timestamps. It’s a 30m fixed interval feed, which I believe is the right choice given the reading frequency. I load new values approximately every day.

When I try to see my energy usage, grouped daily, I don’t get the results I’m expecting, I just get 0s, despite the individual items being logged ok. If I change the timescale, I get some activity on the graph, but it doesn’t align with the values, e.g.:

Daily is worse, as not even the graph is shown.

Am I logging this incorrectly or need to take some extra steps? Thanks!

Hello @Dash what does the raw half hourly data look like?

Submitting over MQTT to emon/octopus:

{
  "time": "1725062400",
  "electric": 0
}

This goes to the input Octopus/Electric, which I then log to a feed. I have lots of 0 usages, but otherwise it’ll be a decimal, to three decimal places.

I’m still stuck on this. I’ve found by changing to using the “Accumulator” function I can log the kWh additions, but strangely, and when I change the time view on graphs, this does aggregate and I get a sum of the amount for the entire period. But for reasons I cannot understand, they’re offset by a single time-interval (half an hour), with the values appearing half an hour before the timestamp in the message. There doesn’t appear to be a way of changing the time value in the input functions to cater for that.

I’m really perplexed at why when I’m recording figures, it doesn’t sum up the totals when I use a bigger interval, or how I would resolve that on the inputs aside from this accumulator that’s not playing ball.

See, the yellow here is the accumulator function and a delta in the chart. But it’s offset to the actual values. Here the headline figures are all ok as we’re on a half-hour period. Changing to a 1 hour period in the chart, and only the accumulator version tots up the values for that period:

Hello @Dash you want to use Log to feed (join) for cumulative kWh feeds like this. With standard log to feed it’s recording null values in between actual readings, there are likely a few null values around midnight and that’s throwing out the daily results…

@TrystanLea thanks, I’ve tried using join, but this brings me back round to the original problem - EmonCMS can’t seem to sum up or aggregate values over a time period. If I produce a graph or CSV on anything lower than the update interval, I get duplicate entries, if I do the oppose (most likely) and want to display values per-hour or something, I only get the values that happen on that hour.

This graph/csv is set to the interval that is being reported (30 mins), with correct values:

But if I now change the interval to hourly, I’m missing every other value, instead of having them added together:

As energy is an absolute usage, I need to be able to display a sum’ing of usage to get useful figures. And I’m not sure how to get this to work.

This works best if you use the cumulative feed that is always growing, as you have done in an earlier post. With the Delta option ticked, the graph will show the total import for any time interval.

It won’t do this for individual half-hourly readings, but you could tick the Average option and set the scale to an appropriate number to get the total; i.e. 2 for hourly or 48 for daily.

As to why the cumulative feed appears out of sync by one interval, I don’t know. I would suggest picking just one feed, and making sure it’s synced up to reality. Is the timestamp for the beginning or end of each half-hour interval?

End time - it’s essentially a half-hourly snapshot of the meter reading, so that consumption has been done in the last half hour period. The accumulator though puts it as the entry for the window before, so a reading taken at 11 is recorded and displayed in EmonCMS as occurring at 10:30, which is just perplexing…