Extra API fields when bucket_step=1440

@dsj and @corrineb, I have been tracking down a bug in the PiConsole and I have noticed that the fields returned from a device endpoint API call vary based on the bucket_step. When the bucket_step is 1, 5, 30, or 180 minutes, the returned fields match the existing Implementation Notes for the API. However, when the bucket_step is 1440 minutes, there are a number of extra fields in the response that are not documented. These appear to be high/low/mean values, but I can’t work out exactly what everything is. The result is that the PiConsole is extracting data from the wrong fields when the bucket_step is 1440 minutes (e.g. when trying to calculate the number of lightning strikes over a year by summing the total number of lightning strikes per day).

Here are some examples of individual observations copied from the obs array for API requests with different bucket_steps. First for a Sky device:

"bucket_step_minutes":1440
[“2020-01-07”,2189,0.11,0.003804,0,1.42,8.67,230,16233,0,0.83,0,765,18,135,0,2.9,null,0,1,3,1,null]

"bucket_step_minutes":180
[1584921600,0,0.0,0,0,0.53,2.73,078,3.25,180,0,0,0,3,null,null,0]

"bucket_step_minutes":30
[1590969600,0,0.0,0,0,0.21,1.65,068,3.27,030,0,0,0,3,null,null,0]

"bucket_step_minutes":5
[1593561900,0,0.0,0,0,0.59,2.01,230,3.32,005,0,0,0,3,null,null,0]

"bucket_step_minutes":1
[1593561000,0,0.0,0,0,0.49,0.94,224,3.33,001,0,0,0,3,null,null,0]

and a Tempest device:

"bucket_step_minutes":1440
[“2020-05-22”,1016.4,1018.2,1015.6,18.9,20.1,17.4,94,98,87,6954,28023,0,0.4,1.74,0,58,234,0,0.49,4.16,0,299,3,0,0,528,2.56,0.192568,null,18,null,1,0]

"bucket_step_minutes":180
[1591088400,0.00,0.31,1.79,342,3,1016.5,11.3,89,0007,0.00,00,0,0,0,0,2.55,180,0,0,0,1]

"bucket_step_minutes":30
[1592713800,0.00,0.00,0.00,000,3,1014.2,19.2,98,0000,0.00,00,0,0,0,0,2.49,030,0,0,0,1]

"bucket_step_minutes":5
[1593129600,0.00,0.28,0.85,146,3,1012.4,22.1,83,1628,0.04,14,0,0,0,0,2.49,005,0,0,0,1]

"bucket_step_minutes":1
[1593561000,0.31,1.09,1.79,349,3,1008.9,24.6,72,6210,0.42,52,0,0,0,0,2.52,001,0,0,0,1]

I would assume similar behaviour for an Air device, but I haven’t tested it. Can you provide documentation for the additional fields when bucket_step = 1440?

Hi Peter,

You are correct. The API response for the 1440 bucket step is different than the others. Here is the structure for the 1440 records. If you have any questions let me know.

SKY
0 - TIMESTAMP
1 - LUX
2 - UV
3 - PRECIP_ACCUM_TODAY_LOCAL
4 - WIND_LULL
5 - WIND_AVG
6 - WIND_GUST
7 - WIND_DIR
8 - LUX_HIGH
9 - LUX_LOW
10 - UV_HIGH
11 - UV_LOW
12 - RECORD_COUNT
13 - SOLAR_RADIATION
14 - SOLAR_RADIATION_HIGH
15 - SOLAR_RADIATION_LOW
16 - BATTERY
17 - PRECIP_ACCUM_TODAY_LOCAL_FINAL
18 - PRECIP_ANALYSIS_TYPE
19 - PRECIP_MINS_TODAY_LOCAL
20 - WIND_INTERVAL
21 - PRECIP_TYPE
22 - PRECIP_MINS_TODAY_LOCAL_FINAL

AIR
0 - TIMESTAMP
1 - PRESSURE
2 - TEMP
3 - HUMIDITY
4 - STRIKE_COUNT
5 - STRIKE_AVG_DISTANCE
6 - TEMP_HIGH
7 - TEMP_LOW
8 - PRESSURE_HIGH
9 - PRESSURE_LOW
10 - HUMIDITY_HIGH
11 - HUMIDITY_LOW
12 - RECORD_COUNT
13 - BATTERY

Tempest
0 - TIMESTAMP
1 - PRESSURE
2 - PRESSURE_HIGH
3 - PRESSURE_LOW
4 - TEMP
5 - TEMP_HIGH
6 - TEMP_LOW
7 - HUMIDITY
8 - HUMIDITY_HIGH
9 - HUMIDITY_LOW
10 - LUX
11 - LUX_HIGH
12 - LUX_LOW
13 - UV
14 - UV_HIGH
15 - UV_LOW
16 - SOLAR_RADIATION
17 - SOLAR_RADIATION_HIGH
18 - SOLAR_RADIATION_LOW
19 - WIND_AVG
20 - WIND_GUST
21 - WIND_LULL
22 - WIND_DIR
23 - WIND_INTERVAL
24 - STRIKE_COUNT
25 - STRIKE_AVG_DISTANCE
26 - RECORD_COUNT
27 - BATTERY
28 - PRECIP_ACCUM_TODAY_LOCAL
29 - PRECIP_ACCUM_TODAY_LOCAL_FINAL
30 - PRECIP_MINS_TODAY_LOCAL
31 - PRECIP_MINS_TODAY_LOCAL_FINAL
32 - PRECIP_TYPE
33 - PRECIP_ANALYSIS_TYPE

2 Likes

Thanks for sharing this @corrineb, it’s super useful!

1 Like