Allows for importing Awair data to InfluxDB.
WARNING: these scripts can no longer be tested/supported as Awair intentionally bricked my only Awair device.
- A device, capable of running either Docker containers or Python e.g., Raspbian or Windows
- InfluxDB v2 installed and accessible from the device running the import
- Bucket created on the influxDB and token available
- An Awair device that is not prevented from uploading data to the cloud. Recommend contacting Awair's support to inquire about their forced obsolescence policy before purchasing a new device.
Choose one of these 3 methods.
touch config.yaml
- This will fail due to malformed config.yaml. That's intentional :)
sudo docker run --name my-awair-influx -v "`pwd`/config.yaml:/app/config.yaml" vdbg/awair-influx
sudo docker cp my-awair-influx:/app/template.config.yaml config.yaml
- Edit
config.yaml
by following the instructions in the file sudo docker start my-awair-influx -i
This will display logging on the command window allowing for rapid troubleshooting.Ctrl-C
to stop the container. Note: config.yaml is automatically reloaded.- When done testing the config:
sudo docker container rm my-awair-influx
sudo docker run -d --name my-awair-influx -v "`pwd`/config.yaml:/app/config.yaml" --restart=always --memory=100m vdbg/awair-influx
- To see logs:
sudo docker container logs -f my-awair-influx
git clone https://github.com/vdbg/awair-influx.git
sudo docker build -t awair-influx-image awair-influx
cd awair-influx
cp template.config.yaml config.yaml
- Edit
config.yaml
by following the instructions in the file - Test run:
sudo docker run --name my-awair-influx -v "`pwd`/config.yaml:/app/config.yaml" awair-influx-image
This will display logging on the command window allowing for rapid troubleshooting.Ctrl-C
to stop the container. Note: config.yaml is automatically reloaded. - If container needs to be restarted for testing:
sudo docker start my-awair-influx -i
- When done testing the config:
sudo docker container rm my-awair-influx
sudo docker run -d --name my-awair-influx -v "`pwd`/config.yaml:/app/config.yaml" --restart=always --memory=100m awair-influx-image
- To see logs:
sudo docker container logs -f my-awair-influx
Python 3.7 or later with pip3 required. sudo apt-get install python3-pip
will install pip3 on ubuntu/raspbian systems if missing.
To install:
git clone https://github.com/vdbg/awair-influx.git
cd awair-influx
cp template.config.yaml config.yaml
- Edit
config.yaml
by following the instructions in the file pip3 install -r requirements.txt
- Run the program:
- Interactive mode:
python3 main.py
- Shorter:
.\main.py
(Windows) or./main.py
(any other OS). - As a background process (on non-Windows OS):
python3 main.py > log.txt 2>&1 &
- To exit:
Ctrl-C
if running in interactive mode,kill
the process otherwise.