Skip to content

A configurable gateway to import MQTT topics from different sources into InfluxDB or TimescaleDB/PostgreSQL

License

Notifications You must be signed in to change notification settings

wuan/mqtt-gateway

Repository files navigation

Lines of Code Duplicated Lines (%) Coverage Technical Debt OpenSSF Scorecard

mqtt-gateway

This is an example for a gateway component which receives MQTT messages from

and writes the data into InfluxDB / TimescaleDB (PostgreSQL) time series databases.

Example configuration

File config.yml in root folder:

mqttUrl: "mqtt://<hostname>:1883"
mqttClientId: "sensors_gateway"
sources:
  - name: "Sensor data"
    type: "sensor"
    prefix: "sensors"
    targets:
      - type: "influxdb"
        url: "http://<host>:8086"
        database: "sensors"
      - type: "postgresql"
        host: "<postgres host>"
        port: 5432
        user: "<psql username>"
        password: "<psql password"
        database: "sensors"
  - name: "Shelly data"
    type: "shelly"
    prefix: "shellies"
    targets:
      - type: "influxdb"
        host: "<influx host>"
        port: 8086
        database: "shelly"
      - type: "postgresql"
        host: "<postgres host>"
        port: 5433
        user: "<psql username>"
        password: "<psql password>"
        database: "shelly"
  - name: "PV data"
    type: "opendtu"
    prefix: "solar"
    targets:
      - type: "influxdb"
        host: "<influx host>"
        port: 8086
        database: "solar"

About

A configurable gateway to import MQTT topics from different sources into InfluxDB or TimescaleDB/PostgreSQL

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •