A simple application that logs MQTT data into a file.
The following Python modules are required:
Install required modules - e.g. using your distribtion package manger:
# apt-get install python3-yaml python3-paho-mqttAlternatively you can use pip instead:
$ pip install -r requirements.txtIf you want to use this as systemd unit, copy the software to a directory such as /opt:
# cp mqtt_logger.py /opt
# chmod +x /opt/mqtt_logger.pyEdit mqtt_logger.service and specify a valid configuration, e.g.:
...
[Service]
ExecStart=/opt/mqtt_logger.py -c /opt/homelab.ymlFinally, copy the configuration and systemd unit file before enabling it:
# cp homelab.yml /opt
# cp mqtt_logger.service /etc/systemd/system
# systemctl daemon-reload
# systemctl enable --now mqtt_logger.service