Zwave2mqtt: [feat]MQTT Payload addition - for Better telegraf/influxdb support

Created on 23 Mar 2020  路  8Comments  路  Source: OpenZWave/Zwave2Mqtt

Currently a payload is looking like:

{
  "value_id": "52-32-1-0",
  "node_id": 52,
  "class_id": 32,
  "type": "byte",
  "genre": "basic",
  "instance": 1,
  "index": 0,
  "label": "Basic",
  "units": "",
  "help": "Basic status of the node",
  "read_only": false,
  "write_only": false,
  "min": 0,
  "max": 255,
  "is_polled": false,
  "value": 0,
  "lastUpdate": 1584636017962
}

Telegraf supports parsing json payload to influxdb. this way I can directly make graphs and get info using mqtt's consumer..
Having the posibility to push measurements using the class_id is the best approach. Because Class_id is int/float this is not possible for telegraf.
Another way would be to also translate class_id to class name! (Sensor_binary etc...)

I also saw there is a list of class_names already in the z2m.

I want to add this class_name in this payload. but I do not know how, if this was added, then telegraf can push this measurements, and been able to make metrics on top of this would make the experience. from AWESOME to SUPER DUPER!

enhancement

All 8 comments

So you would like something like this:

{
  "value_id": "52-32-1-0",
  "node_id": 52,
  "class_id": 32,
   "className": "ClassNameHere", // <----- this 
  "type": "byte",
  "genre": "basic",
  "instance": 1,
  "index": 0,
  "label": "Basic",
  "units": "",
  "help": "Basic status of the node",
  "read_only": false,
  "write_only": false,
  "min": 0,
  "max": 255,
  "is_polled": false,
  "value": 0,
  "lastUpdate": 1584636017962
}

or class_name to keep it sane!

@robertsLando can you point me, where I would be able to add this? :)
I could also keep a fork for using it by myself if this is not for generic implementation :)

add here

data.class_name = Constants.commandClass(valueId.class_id)

trying it. If this works, want me to pull request this on the mail project or not?

Nope, If I add this I need to add a dedicated option in the UI :)

thanks! :)

@billiaz You welcome! let me know if it's working!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raspberrypython picture raspberrypython  路  5Comments

larstobi picture larstobi  路  8Comments

cyclops1982 picture cyclops1982  路  8Comments

CaCu15 picture CaCu15  路  9Comments

dooz127 picture dooz127  路  3Comments