# Looking for guidance: Addon for TFA Dostmann CO2 Monitor

**URL:** <https://discourse.mozilla.org/t/looking-for-guidance-addon-for-tfa-dostmann-co2-monitor/49827>\
**Category:** WebThings\
**Created:** [December 4, 2019, 9:24pm UTC](https://discourse.mozilla.org/t/looking-for-guidance-addon-for-tfa-dostmann-co2-monitor/49827 "2019-12-04T21:24:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaller94](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jaller94/32/24189_2.png) [@jaller94](https://discourse.mozilla.org/u/jaller94)\
**Post date:** [December 4, 2019, 9:24pm UTC](https://discourse.mozilla.org/t/looking-for-guidance-addon-for-tfa-dostmann-co2-monitor/49827/1 "2019-12-04T21:24:26Z")

</div>

I’m looking for someone who can help me write my first add-on for the Mozilla IoT gateway. My preferred programming language is NodeJS. I’m familiar with the Web of Things API. My questions will be mainly around gateway add-ons (e.g. how to test them on my laptop and Raspberry Pi) and reading the USB device (possibly requiring udev rules).

The device I’d like to support is the TFA Dostmann CO2 Monitor. It has a USB interface reporting a room temperature and Carbon dioxide level every 5 seconds.

> **[CO2 Monitor AIRCO2NTROL MINI | TFA Dostmann](https://www.tfa-dostmann.de/en/product/co2-monitor-airco2ntrol-mini-31-5006/)**
>
> CO2 Monitor AIRCO2NTROL MINI ✓ To monitor the CO2 concentration in buildings ✓ High-quality NDIR Dual Beam sensor ✓ Display of CO2 concentration and indoor temperature

Ideally, we could jump on a call for you to explain me add-ons or help to get the the USB interface working in NodeJS without the need to run scripts as root.  
If someone in Berlin has the time for this, I’d be happy to meet up at c-base or Mozilla’s community space.

EDIT: I’m using the following NPM packages to learn how others communicate with the device.

> **[co2monitor - npm search](https://www.npmjs.com/search?q=co2monitor)**

---

<div class="post-metadata">

**Author:** ![mstegeman](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mstegeman](https://discourse.mozilla.org/u/mstegeman)\
**Post date:** [December 4, 2019, 9:30pm UTC](https://discourse.mozilla.org/t/looking-for-guidance-addon-for-tfa-dostmann-co2-monitor/49827/2 "2019-12-04T21:30:03Z")

</div>

Here are some good resources:

- [https://hacks.mozilla.org/2018/02/creating-an-add-on-for-the-project-things-gateway/](https://hacks.mozilla.org/2018/02/creating-an-add-on-for-the-project-things-gateway/)
- [https://hacks.mozilla.org/2018/02/making-a-clap-sensing-web-thing/](https://hacks.mozilla.org/2018/02/making-a-clap-sensing-web-thing/)
- [https://github.com/mozilla-iot/addon-list#readme](https://github.com/mozilla-iot/addon-list#readme)

In general, the easiest thing to do is to start from an existing add-on that somewhat matches your target device and modify it to suit your needs.

In this case, it might make sense to look at something like the [serial-adapter](https://github.com/mozilla-iot/serial-adapter) or [gpio-adapter](https://github.com/mozilla-iot/gpio-adapter).

---

<div class="post-metadata">

**Author:** ![jaller94](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jaller94/32/24189_2.png) [@jaller94](https://discourse.mozilla.org/u/jaller94)\
**Post date:** [January 3, 2020, 11:49pm UTC](https://discourse.mozilla.org/t/looking-for-guidance-addon-for-tfa-dostmann-co2-monitor/49827/3 "2020-01-03T23:49:51Z")

</div>

Thanks!  
I got the basics going (no real error handling though).

> **[web things / Webthings CO₂ Monitor Adapter · GitLab](https://gitlab.com/webthings/co2-monitor-adapter)**
>
> Webthings Adapter for the TFA CO2 Monitor AirCO2NTROL Mini & Coach

How do I deal with USB permissions?  
Currently I have to create a udev rule as root to be allowed to communicate with the USB CO2 Monitor.

As the Zigbee Adapter also relies on a USB connection (to the dongle), I’m reading through its code these days. It looks like they did not have the problem of missing permissions to read the device though.

> **[GitHub - WebThingsIO/zigbee-adapter: Zigbee adapter add-on for WebThings Gateway](https://github.com/WebThingsIO/zigbee-adapter)**
>
> Zigbee adapter add-on for WebThings Gateway

---

<div class="post-metadata">

**Author:** ![mstegeman](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mstegeman](https://discourse.mozilla.org/u/mstegeman)\
**Post date:** [January 4, 2020, 9:39pm UTC](https://discourse.mozilla.org/t/looking-for-guidance-addon-for-tfa-dostmann-co2-monitor/49827/4 "2020-01-04T21:39:02Z")

</div>

On the Raspberry Pi image, we add the `pi` user to the `dialout` group, which gives it sufficient permissions to access Z-Wave/Zigbee dongles. Not sure if that’s the case with your device.
