WebSocket API not returning data on listen_start request

Hi all -

I just bought a Tempest weather station a few days ago, primarily because of the API which looked friendly and easy to use.

The WebSocket API does not seem to work. If I send the message for listen_start_events, I get an ack and receive event info for my station. If I use listen_start, I receive no ack from weatherflow API and no data ever flows to me. The REST API always returns data to every request as expected.

Is anyone having a similar experience with issues with the websocket API or just me?

Hi Josh,

It took me a bit to notice but listen_start and listen_rapid_start both want the device ID while listen_start_events wants a station id. I’d be curious to see the response you’re getting from listen_start_events as I get something like this…

response:{"status":{"status_code":0,"status_message":"SUCCESS"},"device_id":195926,"type":"obs_st","source":"cache","summary":{"pressure_trend":"falling","strike_count_1h":0,"strike_count_3h":0,"precip_total_1h":0.0,"strike_last_dist":35,"strike_last_epoch":1666493484,"precip_accum_local_yesterday":0.0,"precip_accum_local_yesterday_final":0.0,"precip_analysis_type_yesterday":0,"feels_like":0.7,"heat_index":0.7,"wind_chill":0.7,"raining_minutes":[0,0,0,0,0,0,0,0,0,0,0,0],"dew_point":-0.0,"wet_bulb_temperature":0.4,"wet_bulb_globe_temperature":6.4,"air_density":1.29804,"delta_t":0.3,"precip_minutes_local_day":0,"precip_minutes_local_yesterday":0},"obs":[[1671241538,0,0,0,0,20,1020.4,0.7,95,0,0,0,0,0,0,0,2.44,1,0,0,0,0]]}

For the other two commands I get an actual ack that looks like…

response:{"type":"ack","id":"listen_start"}

I’d be super curious if that’s what you see or if you get an ack in the message for listen_start_events as I’ve got an open ticket open about never getting device offline/offline events. Otherwise though I have good luck with listen_rapid_start and listen_start sending me rapid wind and observations.

Hope that helps!

Billy

I see something very similar when using listen_start_events. I guess I was just a little giddy that something was actually coming across. I didn’t even realize it was the wrong thing.

Whenever I try to request with listen_start, the connection is established, but I never receive an ack message or any data. The connection just closes after the expected ten minutes.

image

Is the station id supposed to be the exact same as the device id that is passed in?

It would appear that the station_id and device_id are two different values. That resolved my issue. Sorry for the incompetence on my part.

I do wish it would have been made more clear that the two values are different. The types of values seem very similar in the example requests and the device id was hidden deep in the settings.

Think of Station ID as the ID of the hub and the Device ID as the ID of the Device attached to the hub. Only the hub has a connection to the internet so it makes sense that its ID is the Station ID.

Hi,

Not incompetent at all. At least I hope not because I made the exact same mistake to start with!

Happy coding Josh

Billy

Suggestion for Weatherflow:

  • Update the APIs so all calls that take Station IDs would accept either the plain station ID number, or that same value with a preceding “S”
  • Update the APIs so all calls that take Device IDs would accept either the plain device ID number, or that same value with a preceding “D”
  • Update the documentation to always show the S and D prefixed values
  • Update the customer UIs (web & app) to always include the prefixes when showing station and device ID values.
2 Likes

I got what I wanted out of it. I just wrote a quick script in Node.js to get the data from the socket and write it to a SQLite db. If anyone is interested in it, here it is: tempestwx-adapter-node/index.js at main · JoshieB/tempestwx-adapter-node · GitHub

2 Likes