WeatherFlow UDP listener and MQTT/InfluxDB publisher utility

@vinceskahan

This is an awesome tool! Thank you.

Is there any way to limit how long this runs, or to stop it gracefully?
The only way I’ve been able to stop it so far is to close the terminal
window.

Thanks again for your work.

Rick Comito
Station 4756

If you run it in the foreground, you’d need to hit control-C twice. If you run it in the background, you’d kill the process. Typical Linux commandline stuff.

One of these days I might repackage it to be a regular systemd service and then you could start/stop it like typical long-running services. Maybe. Someday. Perhaps :slight_smile:

4 Likes

Aaaahhh. The old control-C twice trick. :wink:

I tried control-C, control-D, , even @.

Thanks vinceskahan.

Rick Comito
Station 4756

:wink:

Screen-Shot-2013-04-04-at-12.50.34-PM

1 Like

it’s right there next to the Easy Button

2 Likes

Got round-tuit - added a ‘systemd’ directory with etc/default config file and lib/systemd/system service file for running this as a systemd service. See the README.md file therein for how to install it.

Disclaimer - this is lightly tested. Let me know if you find ‘features’.

4 Likes

I assume you found the systemd file under the ‘tempest’ branch. I haven’t merged my draft support for the tempest up to the master branch yet.

update today - added ability to define --mqtt_user and --mqtt_pass for folks who have user and/or user+password protected MQTT brokers. This one’s not much tested so let me know if you check it out. Use the https://github.com/vinceskahan/weatherflow-udp-listener/tree/mqttlogin branch to get the modified copy for now if you want to try it out.

1 Like

version 4.1.0 released - official Tempest support vs. v119 of the WeatherFlow UDP reference document

1 Like

Important note - before reporting perceived bugs, please read the commentary about UDP data and what you, as a user, can reasonably expect regarding accuracy of rain+lightning data. See the github readme for details…

2 Likes

Great stuff in here. Just got my weatherflow yesterday, and am firing up the listener to publish to Influx… I wish Grafana had a better azimuth visualization for wind direction…

One important note is that since this device uses UDP broadcasts and is wireless, you’ll want to make sure that your wireless network is not filtering broadcasts.

1 Like

Just curious… is the “hub_rssi” value reported in device_status actually the station_rssi? Note that hub_status reports a different value and that hub_status's value corresponds with the value reported by the tempest app. Likewise, the device_status rssi value is the same as the tempest app shows for station rssi.

device_status  =>  serial_number  = ST-00002149 device_type = tempest ts  = 1594598396 uptime  = 280451 voltage  = 2.58 firmware_revision  = 133 rssi  = -75 **hub_rssi  = -74** sensor_status  = 0 debug  = 0
obs_st        =>  timestamp  = 1594598395 wind_lull  = 2.73 wind_avg  = 4.83 wind_gust  = 6.56 wind_direction  = 319 wind_sample_interval  = 3 station_pressure  = 948.03 temperature  = 21.84 relative_humidity  = 29.76 illuminance  = 77232 uv  = 5.82 solar_radiation  = 644 rain_accumulated  = 0.0 precipitation_type  = 0 lightning_strike_avg_distance  = 0 lightning_strike_count  = 0 battery = 2.585 report_interval = 1 firmware_revision = 133
rapid_wind     =>  ts  = 1594598397 mps = 6.2 dir = 305
hub_status     =>  ts  = 1594598397 firmware_revision  = 143 uptime  = 288136 **rssi  = -62**

This has been asked+answered many times in other threads…

One is the RSSI hub=>wifi access point.
One is the RSSI sensor=>hub.

ok. didn’t realize that, thanks for clarifying. the naming convention isn’t crystal clear so I’m assuming that the hub_rssi value reported in device_status is sensor/station-to-hub (since it agrees with the WF app’s station RSSI value and it’s inside what is labeled as the device’s status block)

I’ve tried to install and use this on my Pi Zero but I cannot get it to work
If I type python listen.py --raw
python: can’t open file ‘listen.py’: [Errno 2] No such file or directory

If I typelisten.py I get
-bash: listen.py: command not found

I’ve tried using python3 listen.py and python3 listen.py --raw and still the same results

Any ideas?

it’s a clean install of the lastest Buster lite and I followed the install instructions # for python3
sudo apt-get install -y python3-pip && sudo pip3 install paho-mqtt influxdb

I suspect you downloaded it via a browser and it’s likely in your browser’s Downloads directory.

No, I downloaded it using apt-get on the pi console
I actually copied and pasted the instructions
I don’t have a monitor or keyboard attached to the pi, I’m running it remotely

You did not download my listener.py from GitHub. All you did was install its prerequisites. You need to get the actual software too.

If you want to get just the listener, you could run the following from a shell window…

wget https://raw.githubusercontent.com/vinceskahan/weatherflow-udp-listener/master/listen.py

Thank you very much for this integration, I have been using it for the past couple of days with mqtt and it works flawlessly! One question, should I be able to publiush to mqtt and influx? When I use the following parameters - I only get influx (no mqtt):

-b 192.168.1.105 --mqtt --influxdb --influxdb_host=192.168.1.105 --influxdb_port=8086 --influxdb_db=weatherflow -M

Thanks again for all of your hard work!

I’m pretty sure it should work with publishing to both. You probably need to specify the option to tell it the mqtt broker’s address, as it’s doubtful the default will work for everybody. Check the top of the python script for more info.