homie-influx 0.1.0

Service to connect to an MQTT broker and log properties of devices following the Homie convention to an InfluxDB database.
homie-influx-0.1.0 is not a library.

Homie device InfluxDB logger

crates.io page

homie-influx is a service to connect to an MQTT broker, discover devices following the Homie convention, and record their property value changes to an InfluxDB database.

See the main project readme for more details and background.

Installation

It is recommended to install the latest release from our Debian repository:

$ curl -L https://bintray.com/user/downloadSubjectPublicKey?username=homie-rs | sudo apt-key add -
$ echo "deb https://dl.bintray.com/homie-rs/homie-rs stable main" | sudo tee /etc/apt/sources.list.d/homie-rs.list
$ sudo apt update && sudo apt install homie-influx

Alternatively, you may install with cargo install, but that will require some more setup:

$ cargo install homie-influx

Usage

If you have installed the Debian package, the service will be set up with systemd for you already. Otherwise, copy the homie-influx binary to /usr/bin, copy debian-scripts/homie-influx.service to /lib/systemd/system, create a homie-influx user to run as, and create /etc/homie-influx for configuration files.

There should be two config files under /etc/homie-influx:

  • .env contains the main configuration for the service, such as which MQTT broker and InfluxDB server to connect to. See .env.example for an example of the settings that are supported.
  • mappings.conf contains a map of Homie base topics to InfluxDB databases. By default it will look for devices under the standard homie base topic and write to an InfluxDB database called test. You can add multiple base topics to handle multiple users.

After editing these config files you will need to restart the service:

$ sudo systemctl restart homie-influx.service

You may find it helpful to watch the logs to see whether it is managing to connect:

$ sudo journalctl -u homie-influx.service --output=cat --follow

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.