/mqtt_logger

Simple application that logs MQTT data into files

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

mqtt_logger

A simple application that logs MQTT data into a file.

Requirements

The following Python modules are required:

Installation

Install required modules - e.g. using your distribtion package manger:

# apt-get install python3-yaml python3-paho-mqtt

Alternatively you can use pip instead:

$ pip install -r requirements.txt

If 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.py

Edit mqtt_logger.service and specify a valid configuration, e.g.:

...
[Service]
ExecStart=/opt/mqtt_logger.py -c /opt/homelab.yml

Finally, 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