I have a mqtt device publishing on a number of topics and outputting mainly two types of messages:
[1631474359,6731204,"Wh"] =>unix timestamp, consumed power, the unit being watthours. This is being sent, like every 20 seconds.
A second type of message being sent out nearly every second:
[1631474357,562,"W"] => unix timestamp, current power consumption, the unit being watts.
I setup influxdb and telegraf using containers, but I’m not sure how to have telegraf interprete the data. I get the following error in the telegraf logs:
> [inputs.mqtt_consumer] Error in plugin: metric parse error: expected tag at 1:16: "[1631477178,431,\"W\"]"
So I’m sure Telegraf receives the messages, but I can’t figure out which data format I need to specify to be able to parse the messages and insert them into influxdb.
I have no control over the device sending the messages, so I can’t change them to JSON formatting for example.