collectd / collectd

The system statistics collection daemon. Please send Pull Requests here!
http://collectd.org
Other
3.19k stars 1.23k forks source link

mqtt plugin: Unknown type: #4100

Open ves1820 opened 1 year ago

ves1820 commented 1 year ago

Expected behavior

read data from mqtt-broker and write data to RRD plugin

(Description of the behavior / output that you expected) Subscribe is working data received:

stat/tasmota_9292EF/RESULT {"POWER1":"off"}
stat/tasmota_9292EF/POWER1 off
stat/tasmota_9292EF/RESULT {"POWER1":"on"}
stat/tasmota_9292EF/POWER1 on

Actual behavior

the data where not recognized:

mqtt plugin: Unknown type: "RESULT".
mqtt plugin: Unknown type: "POWER1".

(Description of the behavior / output that you observed)

Steps to reproduce

eero-t commented 1 year ago

Thanks for reporting this!

PR fixing the issue would be welcome. Otherwise it can take a long time until there's a fix for the issue.

(There are only few active developers, and they primarily look into plugins that they use / can test themselves.)

viulian commented 1 year ago

I would argue that this is not a bug.

The mqtt.c plugin expects to find a data set called RESULT (or POWER1) here:

  ds = plugin_get_ds(vl.type);
  if (ds == NULL) {
    ERROR("mqtt plugin: Unknown type: \"%s\".", vl.type);
    return;
  }

(for a direct link): https://github.com/collectd/collectd/blob/9369ed71450430266ebd7ca410022c2b1b548fb4/src/mqtt.c#L207

Which, means that collectd expects to find a data set called POWER1 or RESULT into types.db - which, if you just installed collectd, most likely are not defined.