This is a MQTT interface for the Holtek USB-zyTemp chipset which is used in inexpensive CO2 monitors, such as co2Meter.com or TFA Dostmann.
-
Clone the repository
git clone https://github.com/patrislav1/zytemp_mqtt.git
-
Install the Python module
sudo pip3 install .
-
Run the install script to create the service user and the systemd service.
sudo ./install.sh
The configuration file can be in $HOME/.config/zytempmqtt/config.yaml
or zytempmqtt/config.yaml
.
It contains following configuration:
mqtt_host: homeassistant.local # MQTT server
mqtt_port: 1883 # MQTT port (default: 1883)
mqtt_username: user # MQTT username
mqtt_password: pass # MQTT password
mqtt_client_id: foobar # MQTT client ID (default: zytemp-mqtt)
mqtt_topic: /foo/bar # MQTT topic (default: zytemp-mqtt)
friendly_name: aircontrol # Friendly name for HomeAssistant (default: zytemp-mqtt)
discovery_prefix: homeassistant # Discovery prefix for HomeAssistant (default: homeassistant)
decrypt: False # Decrypt data from zyTemp, may be needed for some devices (default: False)
On startup, zytemp-mqtt
performs MQTT Discovery so that the sensors magically show up in the Home Assistant system without any manual configuration: