A custom home-assistant component for a family of compatible CO2 monitors distributed under various names
- TFA Dostmann CO2 Monitor AIRCO2NTROL MINI.
- ZyAura ZGm053U
- TFA Dostmann CO2 Monitor AIRCO2NTROL COACH
- ZyAura ZGm27
Idea based on "Reverse-Engineering a low-cost USB CO₂ monitor". Thx Henryk Plötz. Code for this HA integration originally taken from jansauer. Some older devices have a static encryption (as Henryk Plötz found out). This integration is both, with the newer and older devices compatible.
Upgrading from a very old version? Remove
airco2ntrolfrom yourconfiguration.yamlbefore proceeding.
- Open HACS, search for airco2ntrol and install it
- Restart Home Assistant
- Go to Settings -> Integrations -> Add Integration, search for
co2and select airco2ntrol - Optionally enter a custom device path (e.g.
/dev/airco2ntrol), or leave empty for auto-discovery - Once your CO2 sensor is attached, the integration will create 3 entities automatically
- Copy the
custom_components/airco2ntrolfolder toconfig/custom_components/airco2ntrol/(Use the Samba or SSH/SFTP add-on to access your config folder) - Restart Home Assistant
- Go to Settings -> Integrations -> Add Integration, search for
co2and select airco2ntrol - Optionally enter a custom device path (e.g.
/dev/airco2ntrol), or leave empty for auto-discovery - Once your CO2 sensor is attached, the integration will create 3 entities automatically
When running Home Assistant as Home Assistant Container, the container needs access to the USB HID device. Instead of using privileged: true, you can pass through the device directly.
services:
homeassistant:
# ...
devices:
- /dev/hidraw0:/dev/hidraw0
volumes:
- /sys:/sys:roNote: The
hidrawdevice number can change after a replug. See Option 2 for a stable setup.
-
Find the Vendor/Product ID of your device on the host:
cat /sys/class/hidraw/hidraw*/device/uevent | grep HID_ID
This gives e.g.
HID_ID=0003:000004D9:0000A052— the last two parts are VID:PID. -
Create a udev rule on the host:
sudo nano /etc/udev/rules.d/99-airco2ntrol.rules
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", SYMLINK+="airco2ntrol", MODE="0666"sudo udevadm control --reload-rules sudo udevadm trigger
-
Update your
docker-compose.yaml:services: homeassistant: # ... devices: - /dev/airco2ntrol:/dev/airco2ntrol device_cgroup_rules: - 'c 240:* rmw'
-
In the integration config flow, enter
/dev/airco2ntrolas the device path.
This way, no privileged: true and no /sys mount are needed.
This is how your sensors measurement might look:
This integration should provide:
- CO2 values
- Temperature
- OPTIONAL: Humidity
Some devices appear to have a humidity readings. If they do so, then the humidity entity will be usable.
The pdf in this repository describes the usb protocol used by airco2ntrol device
