Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including influx4mqtt with all npm packages installed. Try it out:

var influx4mqtt = require("influx4mqtt")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

influx4mqtt v1.0.0

Insert incoming MQTT values into InfluxDB. Follows mqtt-smarthome architecture.


mqtt-smarthome NPM version Dependency Status Build Status XO code style License

Insert incoming MQTT values into InfluxDB.


Removes the mqtt-smarthome status from the topic (e.g. hm/status/lamp gets replaced by hm//lamp). Inserts numeric value only to InfluxDB, booleans are converted to 0.0 respectively 1.0. Strings are ignored.

Install & Usage

$ sudo npm install -g influx4mqtt

I suggest to use pm2 to manage the influx4mqtt process (start on system boot, manage log files, ...)

Command Line Parameters

Usage: influx4mqtt [options]
  -n, --name         instance name. used as prefix for connection-state topic
                                                             [default: "influx"]
  -v, --verbosity    possible values: "error", "warn", "info", "debug"
                                                               [default: "info"]
  -u, --url          mqtt broker url. May contain user/password
                                                   [default: "mqtt://"]
  -k, --insecure     allow ssl connections with invalid certs          [boolean]
  --buf-length       maximum number of buffered messages         [default: 1000]
  --buf-interval     maximum age of buffered messages in seconds   [default: 30]
  --replace-sys      replace $SYS/ by           [default: "$SYS/BastisMacBook/"]
  -h, --help         Show help                                         [boolean]
  --version          Show version number                               [boolean]
  -s, --subscribe    topics to subscribe to (may be repeated)         [required]
  -i, --influx-host                                       [default: ""]
  -p, --influx-port                                              [default: 8086]
  -d, --influx-db                                              [default: "mqtt"]


MIT © Sebastian Raff


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free