Telegraf - Mqtt Consumer

Hi there, I’m reading data from mqttt broker, but having problems with format. When I try to read these values in Grafana I get the following error:

InfluxDB Error: unsupported mean iterator type: *query.stringInterruptIterator

However it does work if I use count instead of mean, so I think it has to do with the data_type not being recognized for aggregation functions.

Topics is published in the following format:


An example of the output from Mqtt Explorer:

Screen Shot 2020-09-14 at 3.46.11 AM

This is the config file that I use in telegraf:

  flush_interval = "15s"
  interval = "15s"

  name_override = "shelly1"
  servers = ["tcp://"]
  qos = 2
  connection_timeout = "30s"
  topics = [ "shellies/shellyem-B9FXXX/emeter/0/power" ]
  topic_tag = "power"
  username = "hass"
  password = "xxxxxxxx"
  data_format = "value"
  data_type = "string" 

  database = "iot"
  urls = [ "http://influxdb:8086" ]
  username = "iotlnu"
  password = "xxxxxxxx"

Thanks in advance for your help!!!

I fix this by changing the data type to float. Now I can do mean operations inside Grafana without getting the error message.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.