This program will transfer data from Airthings sensors such as the Wave Mini or Wave Plus via their Dashboard to a MQTT-broker of your choice.
This program will only get your sensor data from the cloud, it will not connect directly to the sensors. This means you need an Airthings account, and a way of syncing the data to the cloud. The simplest method being their Airthings Hub or the View Plus. Having the app on your phone and connected to the sensor will also sync to the cloud, albeit with a delay.
You also need to have a dashboard set up on https://dashboard.airthings.com with a tile that looks like this:
Note that the selected location and room (workplace/living room in the screenshot) will make up part of the MQTT-topic.
This is a Python program and has been developed on Python 3.8.3.
- Download or clone the script.
- Install necessary packages from requirements.txt using
pip install -r requirements.txt
- Run setup.py to set up and test connections to Airthings and broker:
python setup.py
The information is stored locally in the directory in a file namedsettings.json
. - Run
airthings2mqtt.py
on a schedule using Cron or equivalent.
This script would not be possible without the foundation of this program: https://github.com/Danielhiversen/home_assistant_airthings_cloud
Daniel had already set up the connections to the API and the data structures. I've simply moved the output to be MQTT.