Monitoring CO2 using AirCO2ntrol Mini

Aymen Furter
2 min readAug 2, 2020

To keep track of air quality, I decided to buy a CO2 Measuring Device from Digitec (TFA AirCO2ntrol Mini). Not thinking too much about it, I just bought the cheapest option available:

I was positively surprised that the device provides an undocumented API, as discovered by Henryk Plötz (https://hackaday.io/project/5301-reverse-engineering-a-low-cost-usb-co-monitor/log/17909-all-your-base-are-belong-to-us).

There were even out-of-the-box apps available intended for the raspberry-pi. However, this application’s dependencies are quite tedious to install.

That’s why I decided to containerize this app, using the following Dockerfile:

FROM ubuntu:18.04RUN useradd -ms /bin/bash monitorENV TZ=Europe/Vienna
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get update && apt-get install -y software-properties-common && apt-get update \
&& apt-get install -y rrdtool librrd-dev nginx ntp python-pip libcairo2 libcairo2-dev glib2.0 libxml2 libxml2-dev libcogl-pango-dev unzip rsync \
&& pip install python-rrdtool
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R monitor /home/monitorWORKDIR /home/monitorRUN curl -LO https://github.com/aymenfurter/officeweather/archive/master.zip && unzip master.zip && mv ./officeweather-master/* . \
&& cp monitor.py /usr/bin \
&& mkdir /var/local/monitor \
&& rsync -av --progress web/* /var/www/html \
&& mkdir /var/www/html/images \
&& chown -R monitor /var/www/html/images
ENTRYPOINT nginx && /usr/bin/monitor.py /dev/hidraw0

Further information is available on the corresponding Github repository: https://github.com/aymenfurter/co2-docker

--

--

Aymen Furter
Aymen Furter

Written by Aymen Furter

I am a Cloud Solution Architect working for Microsoft. The views expressed on this site are mine alone and do not necessarily reflect the views of my employer.

No responses yet