I´m using OpenDTU with MQTT and want to write all data to influxdb.
The configuration I´m using I found here.
[[inputs.mqtt_consumer]]
name_override = "openDTU"
servers = ["tcp://mosquitto:1883"]
topics = ["solar/#"]
data_format = "value"
data_type = "float"
tagexclude = ["host","topic"]
[[inputs.mqtt_consumer.topic_parsing]]
topic = "solar/+/+/+"
tags = "_/name/channel/field"
[[inputs.mqtt_consumer.topic_parsing]]
topic = "solar/+/+"
tags = "_/name/field"
[[processors.pivot]]
tag_key = "field"
value_key = "value"
Description of MQTT-Topics
Most of the topics are float
but some of them are strings
, for example
solar/dtu/ip
solar/dtu/hostname
solar/<inverter_serial>/name
solar/<inverter_serial>device/fwbuilddatetime
Therefore the configuration produces errors like
E! [inputs.mqtt_consumer] Error in plugin: strconv.ParseFloat: parsing "OpenDTU-xxxxxx": invalid syntax
My idea is to simply drop these values because they aren´t needed. But I don´t know how to implement this!