Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Defect in Data Chart HTTP API?
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Defect in Data Chart HTTP API?

by Gamblor21 on Sun Jul 12, 2020 5:49 pm

I was recording rainfall amounts every minute and had two "ticks" of rain (0.2794mm) the rest of the measurements are 0. The time period for this was 20:30:00Z to 21:00:00Z approximately. The two times where data other then zero were recorded were 20:23:03 and 20:40:03.

I am making the following three calls (feed should be public):
Code: Select all | TOGGLE FULL SIZE
https://io.adafruit.com/api/v2/Gamblor21/feeds/rain/data/chart?hours=2&resolution=5&field=sum
https://io.adafruit.com/api/v2/Gamblor21/feeds/rain/data/chart?hours=2&resolution=10&field=sum
https://io.adafruit.com/api/v2/Gamblor21/feeds/rain/data/chart?hours=2&resolution=30&field=sum


The first two return data as I expect with 0.2794 being the value for the time periods it was recorded (exert from the 5 min feed):
Code: Select all | TOGGLE FULL SIZE
["2020-07-12T20:15:00Z","0.0"],
["2020-07-12T20:20:00Z","0.0"],
["2020-07-12T20:25:00Z","0.2794"],
["2020-07-12T20:30:00Z","0.0"],
["2020-07-12T20:35:00Z","0.0"],
["2020-07-12T20:40:00Z","0.0"],
["2020-07-12T20:45:00Z","0.2794"],
["2020-07-12T20:50:00Z","0.0"],
["2020-07-12T20:55:00Z","0.0"]


But when I call the 30 minute resolution (or 60) I get the following:
Code: Select all | TOGGLE FULL SIZE
["2020-07-12T20:00:00Z","0.0"],
["2020-07-12T20:30:00Z","0.2794"],
["2020-07-12T21:00:00Z","0.5588"],
["2020-07-12T21:30:00Z","0.0"]


I am expecting to see 0.2794 for both fields.

A resolution of 60 minutes gives what appears to be the two thirty values added:
Code: Select all | TOGGLE FULL SIZE
["2020-07-12T20:00:00Z","0.0"],
["2020-07-12T21:00:00Z","0.8382"]


There were only ever two data points recorded (besides the zeros) and this is now 3 times what was recorded.

The idea behind this would be to run the chart API to get say sum for hourly rain for the past 24 hours. Obviously if the last value is incorrect that would be an issue and I'd rather work on 60 minute resolution.

Gamblor21
 
Posts: 1
Joined: Sun Sep 22, 2019 6:01 pm

Please be positive and constructive with your questions and comments.