I want to use Home Assistant instead of prometheus scraping. I'll either need MQTT or some other native way to integrate with HA. This should be an optional add-on so existing usage can be left as-is.
I was doing some digging if I could run this more easily in Docker, and realized that there's an hid package using libhid that would allow the code to just pick up the CO2 sensor when it gets plugged in, no configuration/udev needed (udev would just be to start/stop the service when it gets plugged in or unplugged). However, this would add an extra dependency and needs some system dependencies (libhid) to be installed.
Hi thanks for pointing out that these devices have data logging.
I've taken some of your stuff and added them to https://github.com/pepijndevos/rs-co2mon and thought you might be interested to steal my udev/systemd setup, which is hot-pluggable. It seems your udev rule just sets the permissions and the service just runs at startup, while with my rules, udev launches the service when the device is plugged in.
Also the Rust code I forked seems to just open a specific VID:PID rather than taking a device path, which seems more reliable to me. I'd expect Python to also have this option.