Allows for importing MyAir data to InfluxDB.
The app reads the settings from template.config.toml
, then config.toml
(if it exists), then environment variables.
See template.config.toml
for details.
Choose one of these methods.
touch config.toml
sudo docker run --name myAir -v "`pwd`/config.toml:/app/config.toml" vdbg/resmed-influx
sudo docker cp myAir:/app/template.config.toml config.toml
config.toml
by following the instructions in the filesudo docker start myAir -i -e MYAIR_INFLUX_MAIN_LOG_VERBOSITY=DEBUG
This will display logging on the command window allowing for rapid troubleshooting. Ctrl-C
to stop the container.sudo docker container rm myAir
sudo docker run -d --name myAir -v "`pwd`/config.toml:/app/config.toml" --restart=always --memory=100m vdbg/resmed-influx
sudo docker container logs -f myAir
git clone https://github.com/vdbg/resmed-influx.git
sudo docker build -t resmed-influx-image resmed-influx/
cd resmed-influx
cp template.config.toml config.toml
config.toml
by following the instructions in the filesudo docker run --name myAir -v "`pwd`/config.toml:/app/config.toml" resmed-influx-image
This will display logging on the command window allowing for rapid troubleshooting. Ctrl-C
to stop the container.sudo docker start myAir -i
sudo docker container rm myAir
sudo docker run -d --name myAir -v "`pwd`/config.toml:/app/config.toml" --restart=always --memory=100m resmed-influx-image
sudo docker container logs -f myAir
Dependency: Docker installed.
Inspect template.config.toml
file for all the settings that need to be overriden. Command will look something like:
sudo docker run \
-d \
--name myAir \
--memory=100m \
--pull=always \
--restart=always \
-e MYAIR_INFLUX_RESMED_LOGIN=user \
-e MYAIR_INFLUX_RESMED_PASSWORD=password \
-e MYAIR_INFLUX_INFLUX_TOKEN=token \
vdbg/resmed-influx
Python 3.11+ with pip3 required. sudo apt-get install python3-pip
will install pip3 on ubuntu/raspbian systems if missing.
git clone https://github.com/vdbg/resmed-influx.git
cd resmed-influx
cp template.config.toml config.toml
config.toml
by following the instructions in the filepip3 install -r requirements.txt
python3 main.py
.\main.py
(Windows) or ./main.py
(any other OS).python3 main.py > log.txt 2>&1 &
Ctrl-C
if running in interactive mode, kill
the process otherwise.The app may fail on first run, or may start failing after a long period of successful runs with a "policyNotAccepted" error. If this happens, navigate to the myAir web - ResMed site, enter your credentials, and accept myAir's policy.
This template is what produced the following Grafana dashboard:
Note: the dashboard uses influxdb v1 compatibility mode. This page explains how to enable it.
All the myAir adapter code was copied from here.