This is a really quick and dirty way to pull data via BLE on my Raspbery Pi and toss it into InfluxDB. This only supports the WavePlus. If Airthings wants to send me free stuff I will extend it.
I quickly rewrote my script here to support this and eventually I will extend it.
https://github.com/TaylorBurnham/AirThings
The default measurement is "environment" but you can call it whatever you want. Defaults to no output if it fails.
environment,device=WavePlusPlus,serial=86753095150,name=Hallway humidity=45.5,temperature=18.81,pressure=1022.1,radon_lt=18,radon_st=42,co2=871.0,voc=106.0
It tags each pull with the device make, serial, and alias/name from the airthings.json
file. For the WavePlus it returns the following units:
- Temperature (C)
- Humidity (%rH)
- Pressure (hPa)
- Radon Short and Long Term (Bq/m3)
- CO2 (PPM)
- VOC (PPB)
If you're like me and always seen the pCi/L measurements of radon this is the approximate conversion below.
Unit | Name | Conversion |
---|---|---|
Bq/m3 | Becquerels per Cubic Meter | 37 Bq/m3 = 1 pCi/L |
pCi/L | Picocuries per Liter | 1 pCi/L = 37 Bq/m3 |
If you want to understand all of the safe tolerances and more when it comes to Radon exposure I recommend taking a look at the excerpts on this NIH page for Evaluation of Guidelines for Exposures to Technologically Enhanced Naturally Occurring Radioactive Materials.
- Install bluepy within a Python 3 virtual environment
- Install the script and update line #1 to point to that environment unless you installed it globally for some sick reason.
- Make the script executable.
chmod +x /etc/telegraf/exec.d/airthings-wave.py
- Make the script owned by root unless you're a fool because of step #6
chown root:root /etc/telegraf/exec.d/airthings-wave.py
- Add the configuration file
airthings.json
with each of your devices to pull in the same directory. - Add the
telegraf
file to your/etc/sudoers.d/
directory and be sure you followed step #4 or you're gonna have a bad day. - Install the input plugin. Configure the
timeout
to 10 seconds per device. - Restart Telegraf and make sure your metrics are showing up under the
telegraf
database.
I'll put some sample dashboards and other things in the repository I linked above once I've had it soak for a bit.