Importing multiple Tasmota Sensors per device data to Influxdbv1

tasmotizer
Wed, 20 Mar 2024 21:11:02 +0000
Telegraf

Hello,

i’m using actual tasmota device with 3 sensors + mqtt → mosquitto mqtt server → telegraf + influxdbv1
Everything if working great except the one host who has 3 sensors of same type (DS18B20) and only the last one (id 000006C03A66) is written to influxdb. Here are my configs:

tasmota output:

22:03:27.223 MQT: tele/tasmota_5E2BC2/SENSOR = {"Time":"2024-03-20T22:03:27","DS18B20-1":{"Id":"000005DFDF04","Temperature":21.3},"DS18B20-2":{"Id":"000006473CA6","Temperature":43.6},"DS18B20-3":{"Id":"000006C03A66","Temperature":44.3},"TempUnit":"C"}

mqtt server:
/etc/mosquitto/mosquitto.conf

allow_anonymous true
listener 1883 0.0.0.0
log_type error
log_type warning
log_type notice
log_type information

telegraf:

[[inputs.mqtt_consumer]]
    servers = ["tcp://192.168.20.14:1883"]
    topics = [
        "cmnd/#",
        "tele/#",
    ]
    qos = 0
  data_format = "xpath_json"
  xpath_native_types = true

  [[inputs.mqtt_consumer.xpath]]
    metric_name = "'logging_data'"
    metric_selection = "child::*"
        #    field_selection = "*"
        #https://community.influxdata.com/t/reading-all-the-fields-from-xpath-in-one-go-without-defining-each-field/24195/4
        field_selection = "descendant::*[not(*)]"

Only the last of the three sensors how up in influx. What can i do to get the data of all three sensors ?

Thanks and best regards
Marcel

10 posts - 2 participants