Trying to get 30 min power feed, every hour (e.g 01/12/2024 07:00:00) shows null value

I have tried via the graphs, download from feed and directly via the API call for power to get the power in 30 min increments but each hour (e.g 01/12/2024 07:00:00) value is null whereas the 30min (e.g. 01/12/2024 07:30:00) has a value. If I get the 10s feed then all values come except the one on the exact hour e.g 2024-12-01T07:00:00+00:00 which is null (the 10s values either side are there. So this erroneous null seems to be throwing the aggregations out. All values for an exact hour show null.
I am not a programmer I tend to get data in to excel via csv or json to get the values I want. The reason I want 30min intervals is so I can tie up the energy cost per 30min as I use Octopus.
Has any one any ideas on the cause/solution.
Thanks

Where is your data originating?

As you have a NULL value, it means that no data arrived in emonCMS during that feed interval. If you are sending data at exactly 1 hour intervals at 5 mins before the hour (OK unlikely but it serves to explain what happens) then you’ll always have a value in the feed when the window closes on the hour (by Internet time). If you’re sending the data at 10 ms before the hour and it gets delayed for some reason and arrives 1 ms after the hour, you have a NULL value in the data. For this reason, we always send the data from an emonTx, the emonPi itself and the emonTH at a rate that’s slightly faster than you set the Feed Interval in emonCMS. This way, a value is occasionally overwritten (one arrives just after the window opens and another arrives and overwrites it just before the window closes), but you don’t get NULL values.

I don’t have enough information about your setup to know this is what’s happening, but it seems a likely explanation.

Apologies I should have given further info. The open energy monitor Kit3 is installed which was all preconfigured with my login etc and all the feeds were pre set up on the emoncms web site. I have not done any changes to the set up and the MyHeatpump preconfigured page shows the heatpump data (flow, return, power, energy generated etc) as it should. Looking at the Inputs and feeds pages the values configured seem to be updating between 30-40 seconds, the side bar is green up to 30 seconds then turns yellow but before reaching 40 seconds it updates and turns green again counting up the seconds.
Based on the above the values are being updated to the website within 40 second feed cycle so I think there is another issue causing every reading that is for an exact hour e.g 07:00:00 being null. Any other ideas or is it a bug in the data recording? here is a 10 second interval example from the API page using electric_power feed.
[
“2024-12-01T12:59:40+00:00”,
13.899999618530273
],
[
“2024-12-01T12:59:50+00:00”,
13.699999809265137
],
[
“2024-12-01T13:00:00+00:00”,
null
],
[
“2024-12-01T13:00:10+00:00”,
13.899999618530273
],
[
“2024-12-01T13:00:20+00:00”,
13.800000190734863
],
If I request 30 min cycle i get
[
“2024-12-01T11:00:00+00:00”,
null
],
[
“2024-12-01T11:30:00+00:00”,
10.399999618530273
],
[
“2024-12-01T12:00:00+00:00”,
null
],
[
“2024-12-01T12:30:00+00:00”,
13.399999618530273
],
[
“2024-12-01T13:00:00+00:00”,
null
],

This is quite normal.

What do you mean by “feed cycle”?

There are two times of importance here: The interval (frequency) at which data is sent to emonCMS - you say between 30 - 40 s and this sounds quite reasonable, and the “Feed Interval”, the time between samples in the database. You can find what this is by hovering your mouse pointer over the name of the Feed on the Feeds page.

(Incidentally, this is locked to Internet time, so it happens on the round 10 s, ¼ m, 20 s etc.) If you request (or someone has set) a Feed Interval less than 40 s, you’ll obviously get NULL values because the Feed is moving on faster than data is arriving.

Hi Robert, Thanks for patience on this one, so my feed interval is 10s as in your screenshot. Looking more closely at far right column on the Feeds Tab (see screenshot) the seconds count goes 6, 11,16,21,26 which are all green, then 31 (yellow) then the value to the left updates and the seconds count goes back to 6 11, etc.

From what you are indicating ‘something’ is happening at exactly each hour on the emonTH that means that the 10s interval value for T00:00 doesn’t get written to the database. ALL the 10s interval values between exact hours T00:00 get written correctly (3,599 values) then the T00:00 fails. Does the emonTH do something on the hour to cause this or something at the website end?

Thanks again for your responses

Have you really got an emonTH, or have you got confused?, because as far as I’m aware, an emonTH is not normally part of a heat pump monitor installation.

Hi Robert, I do have a an EmonTH (this was an extra) but that is for the indoor temperature :slight_smile: the ‘black box’ in the monitoring kit is an emonhp . Sorry for the confusion over the name.

1 Like

Hello @sarnold814 If you want average power you can put a tick in the average box on the graph tool for that feed. Are you seeing null values on the Energy feed? That shouldnt have null values as it should be recorded using Log to Feed (join).

There’s a bit more on averages here: Calculating Averages — OpenEnergyMonitor 0.0.1 documentation

@TrystanLea Surely the original problem is it’s a 10 s feed with data arriving every 30 - 40 s?

@sarnold814 If you set up a Feed for your emonTH, make sure you set the interval to 60 s.

Hi Trystan, looks like setting the Interval to 1800 and yes to average gives me the power in watts for a 30 min timeslice and doesn’t give any nulls. Still can’t understand why when I look at the most granular interval of 10s it gives a NULL whenever the Time element is 00:00 when all the other 10second slices (359 of them between the hours) have a value e.g.
[
“2024-12-01T12:59:50+00:00”,
13.699999809265137
],
[
“2024-12-01T13**:00:00+00:00**”,
null
],
[
“2024-12-01T13:00:10+00:00”,
13.899999618530273
],

I will test the average out a bit more tomorrow but on the face of it that works

Thanks

1 Like