WeatherFlow REST API -- Station Observations

A new Tempest owner here and finishing up my WeatherFlow REST API to CWOP/APRS integration…

A few questions… these all relate to the STATION federated observation AP at /observations/station/{station_id}:

  1. There is an array of “station_units” although those units do not seem to correlate to the obs array. Example: station_units says units_temp is ‘f’ but the obs is in centigrade. It also appears that the obs for wind is in m/s, but I can’t be certain as it has not been very windy.

  2. The CWOP specification wants precipitation as inches per last 24 hours and last calendar day. Obviously obs precip_accum_local_day has today’s precipitation since midnight local time, but to calculate last 24 hours I am assuming I will need store the precipitation values every x minutes and sum up the last 24 hours observations. What is shown in “precip” in obs in the station federated API observation, is this “The Rain Rate description is set according to the latest one minute accumulation, extrapolated to an hourly rate?” The documentation is extremely light on the API and the forums have some conversation about precipitation but it is was related to UDP and/or the device observations. Are the units in obs actually inches?? We haven’t had any rain yet for me to test…

  3. Is it fair to say the wind_avg on the station federated observation is the last 1 minute average?

  4. Is a 1 minute cadence on API requests for station observations considered too aggressive for an application? Especially if we need to record the rain every x minutes, depends on answer for question #2.

  5. What are other values for the “status” array? Offline? Delayed?

  6. Is the timestamp in obs the last observation received as from WeatherFlow’s servers? Would it be fair to say I should record the last timestamp and make sure it is greater than my last API fetch to know that I am receiving new data?

  7. There is reference that the “default” device is one that is returned by the federated station API. Does this mean that if there are multiple devices for the station only 1 obs will always be returned at array pos 0 or will there multiple still in the obs array yet 0 is always the preferred?

  8. I chose to use the federated station observation API because I wanted to use the adjusted precipitation numbers from WeatherFlow (do the WeatherFlow adjustments only work on precip_accum_local_yesterday_final?) as well as I do not have to keep a local computer running here 24x7 to do the uploading every x minutes, although it depends on WeatherFlow continued access to the “hosted” API as well as no WeatherFlow outages…

Thanks!

Sean, AJ6B

The array of “station_units” show what units the user has selected to display their data. The data in the obs array will always be in metric (see here for details: Tempest API and click “expand operations” in the top right).

Yes, you will need to store the individual rain accumulation readings to calculate the accumulation over the last 24 hours. The precip value in the obs array is the total amount of rain accumulated over the last reporting period, which in the case of the station API end point is 1 minute. You will need to sum-up 1440 individual precip values from the obs array to get the total rainfall over 24 hours. The units of precip will be in mm.

Yes

No, 1 minute should be fine. Have you considered using the Websocket rather than the API? This will automatically send new observations every time they are received by the WF servers, saving you from making a new API request each minute.

I think the status array refers to the status of the API request, rather than the status of the device. If you use an incorrect API key on purpose, you should see the status array change.

It is the last timestamp given to the observation by either the hub or the Tempest (I don’t know which), not the time that it is received by the WF servers. Unless you switch to using the Websocket, yes you will need to make sure that each observation is newer than the previous one you received.

I believe it will still only return the observations for a single device (the default). There is currently no way to change the default without getting in touch with support.

Remember that the adjusted precipitation numbers for a given day are not available until 8 am at the latest on the following day. If you want to take advantage of these numbers, then your uploading to CWOP will be 24 hours delayed.

2 Likes

Thanks Peter for everything!

All changes have been implemented and are live…

Hi,

is there a way to get archived data? I only get the actual values via rest but not the old ones.

Is there maybe already some program(PC windows) to get the archived data and save it as csv?

The REST API allows you to get historical data, with caveats…


You will not be able to get the high-resolution data (3-second, etc)… you will be able to 1-minute under some calls, depending on the timeframe selects. Some will only return daily averages, etc.
YMMV

ah, thank you. I diddnt get this optional parameters :slight_smile:

1 Like

I have an issue
the Tempest API says there should be 17 fields in the Sky device starting with 0-16
I only have 9
How come? and how do I find out what mine actually are?
device_id=35103
{“status”:{“status_code”:0,“status_message”:“SUCCESS”},“device_id”:35103,“type”:“obs_sky”,“source”:“cache”,“summary”:{“precip_total_1h”:0.080386,“precip_accum_local_yesterday”:0.0,“precip_analysis_type_yesterday”:0},“obs”:[[1606739573,898,0.03,0,0.63,2.62,4.43,270,3.31,1,7,0.147142,0,15,null,null,0]]}

I count 16 items in obs you show (the coma is the separator)

obs”:[[1606739573,898,0.03,0,0.63,2.62,4.43,270,3.31,1,7,0.147142,0,15,null,null,0]]}

and they are ordered as mentioned on this page

1 Like

Sorry I must have been looking at the Air instead of Sky for some stupid reason.
Thanks for the link though, it’s a good explanation of Request Messages

One last question from the Sky device
Index 3 Rain Accumulated mm
What time period is that accumulation ie how long has it been accumulating ?

Just the previous 1 minute