API returning status_code 2, DATA_ERROR - null, when using time_start and time_end

Since 4th December 2024 I have had a problem with my code not working and today I began looking into why.
I suspect that it is because the API has been returning:
{“status”:{“status_code”:2,“status_message”:“DATA_ERROR - null”}
when I request observations from any of my devices including Tempest, Sky or Air,
and between a time_start and time_end.
Either using curl, a browser or the Tempest API Explorer page here:
https://weatherflow.github.io/Tempest/api/swagger/#!/observations/getStationObservation

If I use a day_offset it works correctly for example returning
“status”: {
“status_code”: 0,
“status_message”: “SUCCESS”
},
“device_id”: 386494,
“type”: “obs_air”,
“bucket_step_minutes”: 1,
“obs”: [
[
1734220800,
998.5,
23.6,
91,
0,
0,
3.17,
1
],

But if I use time_start and time_end (without a day offset) it returns:
“status”: {
“status_code”: 2,
“status_message”: “DATA_ERROR - null”
},
“device_id”: 386494,
“type”: “obs_air”,
“bucket_step_minutes”: 1,
“obs”: [
[
1734342720,
997.9,
22.7,
94,
0,
0,
3.16,
1
],

I am guessing Weatherflow changed something but perhaps I have a different problem?
Before I change my code to adapt I am trying to check if Weatherflow did something to cause this.

But other thoughts I have it was within a day (but not the same time) of adding a new Air to my system which includes 3 hubs running 2 Tempests, 2 Skys and 2 Airs.
Perhaps it might be a change to my raincheck settings or I accidentally touched an icon that changed something while installing the Air, but I doubt those thoughts.
The problem appears on all my devices including 3 different hubs including old, not so old and almost new.
I will log a support call and I thought I would ask here to let you know and hopefully publish a solution from some one.
cheers Ian :slight_smile:

1 Like

I get that data error as well, but it still returns valid data. I’ve no idea why.

2 Likes

Hi Sunny,
Do you mean when you look at it now it appears to be valid data?
A data type or something may be different which I am still investigating.
I went back to an old log file and checked that my same API call in the past returned:
_status {‘status_code’: 0, ‘status_message’: ‘SUCCESS’}

edit :And I just grabbed the actual call to the API from an old log file and tried it now and it returns the error now but it did not back when it ran about a year ago.
cheers Ian :slight_smile:

2 Likes

Well I sort of fixed it for now by allowing it to ignore the error with this:
if (_status_code == 0
and _status_message == ‘SUCCESS’
or _status_code == 2
and _status_message == ‘DATA_ERROR - null’
):

Which confirms the data is still good and it is only the status code and status message which have changed.
cheers Ian :slight_smile:

1 Like

And now the bug has been fixed and it appears back to normal.
thanks Weatherflow Tempest support
cheers Ian :slight_smile:

2 Likes