stas-dovgodko/mqtt-influx

dev-master 2017-06-13 19:07 UTC

This package is auto-updated.

Last update: 2024-04-23 21:30:47 UTC


README

PHP-React based mqtt to influxdb gateway.

For IoT diy stuff to upload and visualize data in grafana

Please add local config just like config/default.yml somewhere near and run:

php daemon.phar --config=my_config.yml

or put config to config.local.yml

php daemon.phar

Can use plain daemon.php instead of phar too

Config example:

influxdb:
  database: test_db
  server:
    host: influxdb
    port: 8086
    
mqtt:
  broker:
    host: m12.cloudmqtt.com
    port: 14775
    user: zxcsec
    password: xcvdx5xcv

subscribe:
   - topic: "#"
     qos: 0
     topics:
       - {pattern: "'(.*?\/vq_0)'", measurement: "$1", tags: {}, type: percent}
       - {pattern: "'(.*?\/rms_0)'", measurement: "$1", tags: {}, type: int}
       - {pattern: "'(.*?\/trms_0)'", measurement: "$1", tags: {}, type: int}
       - {pattern: "'(.*?\/wifi-signal)'", measurement: "$1", tags: {}, type: float}