marcofl / influknx

NodeJS KNX to InfluxDB metric logger
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

InfluKNX

A KNX to InfluxDB metrics logger written in NodeJS.

Installation

npm install

Getting full stack up and running in docker

Get full stack with InfluxDB and Grafana up and running

app.js

The actual application that listens to configured datapoints on the bus, decodes values and sends them to InfluxDB.

config.yml example

See https://bitbucket.org/ekarak/knx.js/src/master/README-datapoints.md for supported data types. The datatype must match the data type of the group address in KNX ETS.

---
knx:
  gateway_ip: 10.10.0.105 # IP of your KNX gateway
  gateway_port: 3671
influxdb:
  host: influxdb
  # username: influknx
  # password: influknx
  database: influknx

datapoints:
  '7/0/0':                        # KNX group address
    description: 'House (Power)'  # used to generate the influxdb tag, should be unique
    type: 'DPT14'                 # important to select carefully, otherwise you'll get garbage values only!
    measurement: power            # name of the measurement in influxdb, group similar things together
  '7/0/1':
    description: 'Somethingelse2 (Power)'
    type: 'DPT14'
    measurement: power
    name: Somethingelse_Power     # overwrite the tag generated from `description` if you change description
  '7/0/21':
    description: 'Haus (Wirkenergie, T2)'
    type: 'DPT12'
    measurement: energy

dp-testing.js

Test script to make sure you selected the correct DPT (data point type) before actually sending anything to InfluxDB any might messing up your data.

csv-importer.js

A simple csv to InfluxDB importer. Can work with 2 column CSV without headers, in the format of <unixtimestamp>,<value> to import existing historical data

Example

node csv-importer.js Haus_Wirkleistung power 38779.hour.csv
# node csv-importer.js <tag> <measurement> <csv file path>

Special Credit