Getting station data

Using the documentation here: WeatherFlow Tempest API & Developer Platform
I’ve gotten my device ID from the response from swd/rest/stations

And am passing it to: https://swd.weatherflow.com/swd/rest/observations/?device_id=[your_device_id]&token=[your_access_token] (substituting the values, of course)

But am getting: {“status”:{“status_code”:3,“status_message”:“REQUEST_INPUT_ERROR - device_id required”},“type”:null,“source”:“db”,“obs”:null}

What am I doing wrong?

try this one? Does that work? https://swd.weatherflow.com/swd/rest/observations/device/168731?day_offset=0&format=csv&token=bcf4754a-886b-4b84-9ce7-5b70c22e5299

I think the error message is telling you that you are using the wrong device id.

401 Not Authorized. Where would I get the device ID from? I grabbed it from the response from the station request:
{"stations":[{"location_id":76713,"station_id":76713,"name":"Home","public_name":"Conrad St","latitude":41.4593,"longitude":-82.05627,"timezone":"America/New_York","timezone_offset_minutes":-240,"station_meta":{"share_with_wf":true,"share_with_wu":true,"elevation":191.08578491210938},"last_modified_epoch":1656428823,"created_epoch":1655642627,"devices":[{"device_id":**204795**,"serial_number":"HB-00068027","location_id":76713,"device_meta":{"agl":1.8288,"name":"HB-00068027","environment":"indoor","wifi_network_name":""},"device_type":"HB","hardware_revision":"1","firmware_revision":"177"},{"device_id":**204805**,"serial_number":"ST-00061881","location_id":76713,"device_meta":{"agl":3.749040046334267,"name":"ST-00061881","environment":"outdoor","wifi_network_name":""},"device_settings":{"show_precip_final":true},"device_type":"ST","hardware_revision":"1","firmware_revision":"165"}],"station_items":[{"location_item_id":633647,"location_id":76713,"device_id":204805,"item":"air_temperature_humidity","sort":0,"station_id":76713,"station_item_id":633647},{"location_item_id":633649,"location_id":76713,"device_id":**204805**,"item":"barometric_pressure","sort":1,"station_id":76713,"station_item_id":633649},{"location_item_id":639677,"location_id":76713,"device_id":**204795**,"item":"diagnostics","station_id":76713,"station_item_id":639677},{"location_item_id":639678,"location_id":76713,"device_id":204805,"item":"diagnostics","station_id":76713,"station_item_id":639678},{"location_item_id":633651,"location_id":76713,"device_id":204805,"item":"light","sort":4,"station_id":76713,"station_item_id":633651},{"location_item_id":633648,"location_id":76713,"device_id":204805,"item":"lightning","sort":2,"station_id":76713,"station_item_id":633648},{"location_item_id":633650,"location_id":76713,"device_id":204805,"item":"rain","sort":5,"station_id":76713,"station_item_id":633650},{"location_item_id":633652,"location_id":76713,"device_id":204805,"item":"wind","sort":3,"station_id":76713,"station_item_id":633652}],"is_local_mode":false}],"status":{"status_code":0,"status_message":"SUCCESS"}}

you didn’t copy and paste the complete url in the test link I just posted. It is missing the last 8 characters.

But indeed you get the device id from the call you did. In your case your tempest has device id 204805 (I’m assuming you added the asterix)

You can also get the Device ID from the app in the Station Status page. An easy way to get it is from the Web page of your station. At the bottom is image. Just click on it and you get a screen similar to this from one of my stations. I’ve circled the Station ID and Device ID.

Yes, I attempted to “bold” them in the code block which puts on the asterix, but I guess that doesn’t work in code blocks.

I retried it and that works, but not the request I’m trying to get. I’m looking to get current devic data, not current location data.

I’ve resolved the issue. I had a “=” in the wrong spot in the device_id. My apologizes, but thank you for helping.

1 Like