WeatherFlux, an InfluxDB 2.x integration gateway for WeatherFlow stations

Hello all!

Just to let you know I’ve wrote a small php daemon to listen WeatherFlow messages (devices on the local network) and send data to an InfluxDB 2.x server. Once set, it’s fully autonomous (no need for Telegraf, for instance)…

You can view it as a powerful data collection tool or as a simple boilerplate to prototype more advanced applications. Just let me know if you use it or find it useful.

Thanks :wink:

WeatherFlux

1 Like

Hello Pierre

Long time no read. Thanks for sharing your script.

Just a question, is it designed to cope with like x Tempest devices and so many hubs ?
For ex I have right now 5 hubs, 3 air modules, 1 sky and 5 Tempest active on the network.

Will they al be nicely identified or is there a chance it goes all wrong in the tables ?

1 Like

Just curious, but does it work with the new PHP 8 ? I’ve seen lots of complaints about breaking changes due to the language changes.

This looks notionally the same as my python-based listener/publisher, just written in PHP and with a lot more configuration needed by the user…but it’s always fun to see how other people approach similar problems.

Hi Eric!
Yes, I stayed away from you for a while mainly for professional reasons, but also to take advantage of my little free time to start developing a WordPress “fully integrated environment” for data transformation/visualization (weather, pollution, etc. but not only). It’s a great pleasure to see you here, a very nice news :slight_smile:
To answer your question: yes, no problem with the number of devices and stations you have. Influxdb doesn’t store in tables. I store time series in a org/bucket/measurement paradigm. As it’s not a sgbdr, the key point is to be able to “tag” data (not to “join” it). And I think I’ve done it right. At least to support a few thousand devices without any problem.

Just for you to see how it is structured, I took a screenshot a test instance :

If you’re “afraid” about not relational data storing (and retreiving) you can specify filters to store your different stations in different orgs or org/buckets (with multiple instance of WeatherFlux and filters settings). I tried it (just to test) in a small docker container, and it can handle about fifty concurent configurations). But it’s not mandatory at all… It is designed to handle it gracefully in a single InfluxDB org.

I’ll play with it coming week end, see what I can do with it, might be an interesting alternative with Grafana … always looking into visualisation allowing me to easily select a part, zoom in and out, pan etc combine sources in 1 graph … just spend 2 days trying to figure out what was wrong with 3 Tempest devices and found some correlations this way.
The rest is for the technicians :slight_smile:

Will let you know how it goes, always fun to learn new things

1 Like

Hello Vince!
It’s working with PHP 7.4+ so, yes, it’s working with PHP 8… so far :slight_smile: I will make intensive tests with PHP 8, but not before the next month…

I must admit I don’t know your listener more than that… But for the InfluxDB part, it should be similar (mine only works with version 2.x). I’m intensively using tags to generate indexes and reduce cardinality, maybe have you done things like that too. I will get an eye to tell you if it’s comparable :wink:

For mine, to publish to influxdb v1 it would look like:

python3 listen.py --influxdb --influxdb_host=influxdb --influxdb_port=8086  --influxdb_db=testdb -M

The ‘-M’ option there is the important option, meaning ‘support multiple sensors’. That constructs a value with the serial number of the detected sensor, so it can support any number of sensors and even multiple hubs since it’s just picking the UDP broadcasts off the wire(less).

So it would publish a Tempest obs_st record to sensors/ST-00001234/wf/obs_st within influxdb and you could pick the elements out of it in grafana by grabbing the individual fields from the observation (ie, ‘temperature’).

No configuration is needed to say which sensor(s) might be there. The app just listens and if a new sensor appears it puts its measurements into the db with the key including the serial number of the sensor, so it’s easy to tell the measurements from each sensor apart.

There is a user-provided pull request associated with the github repo to support v2 influxdb, but I haven’t merged it into my stuff yet as I don’t have any WF gear any more so I can’t really test functionality additions too well.

Sorry to hijack your thread a little, but I wanted to explain a bit.

Nice to see more third-party integrations !!!

Based on what you said, it’s similarly the same thing.
No device config to do to collect and store (just InfluxDB parameters, like what you put on the command line).
The only difference I see for now is the static / dynamic fields and tags that can be set with WeatherFlux, but it’s mainly for my usage I’ve done this sort of things :innocent:

That’s really cool to see all integrations / apps done since the last time I came…

Thank you to pointed me out your tool, I will get an eye on it :slight_smile:

@pierre tried to install on a raspberry but I get errors,

[RuntimeException]                                                                                    
  No composer.json present in the current directory, this may be the cause of the following exception.  
                                                                                                        
                                                                                                                                 
  [InvalidArgumentException]                                                                                                     
  Package weatherflux/weatherflux has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version  

stretch
php 7.0.33
composer 2.0.8

Guess I need to learn a few more tricks here but appreciate some help :slight_smile:

edit : got past error 1 but now what requirement is missing in my php ??

Hi Eric.
This error is mainly due to a PHP requirement incompatible with your current configuration… As your PHP version is 7.0, it’s a PHP version problem: WeatherFlux needs PHP 7.4+…
I can’t go less than this PHP version, I’ sorry…

If you can wait some days, I’m working on a new version which will be more simple to install (but which requires PHP 7.4+ too) and a dockerized version (fully autonomous, so you don’t care about PHP version). This new version will be ready for the end of the next week - if all go well :wink:

Hi @eric !

Just to let you know, it has been updated: new version and complete documentation.

And a Docker image ready to run… :slight_smile:

Will test maybe tomorrow the non docker version. I really need to setup a test lab with proxmox one of these. To many testings going on. Just find some nice hw within budget :wink:

Will let you know how it goes. Thanks Pierre

Well after some heavy fiddling got it all up and running.
Your part was the easiest part once I got influxdb v2 correctly installed :sweat: on an Ubuntu VM. Your script sends nicely all data in the ‘database’
What was worst is how to link Grafana to influxdb V2 via the ‘flux’ query language. First know that when you use the snaps from Ubuntu (via GUI) you get a version not allowing to use Flux as query language so you have to install it manually via terminal. Took me a day to figure that out. Only way to link both with a token.

Now all is linked, but … now I need to learn the Flux language to get some things out of the database and do things with it. :face_with_monocle: :stuck_out_tongue_closed_eyes:

If you just want to graph as is (for ex with wind speed in m/s) you can do so inside influxdb V2 and there is no need for Grafana.

Haha. The fun of adminsys :smile:
Nice to know it’s working for you…
I’m using InfluxDB2 but the need for Grafana remains valid for many cases.
Did you try the windrose for Grafana? I think I will get a try, but if someone have already do a “dry run”, I will not deprive myself of the experience :sweat_smile:

1 Like