Several MQTT to one InfluxDB 2.0 bucket

Hello ,
I'm very newbie so apologize if the question seems weird !

i have 1 mqtt provider with 3 differents topics
I subscribe at each like this xxx/#
The payload for each sensors is like this :

chaudiere_1/T.EXTERNE/H.ext : msg.payload : number
50.7

I made change like this :
ksnip_20220601-145423

The msg.payload function :

[
    {
        "value": msg.payload
        },{
        "capteur": msg.topic
    }
]

Example of data send to influxdb2.0:

{
  "topic": "chaudiere_1/T.INTERNE/H.interne",
  "payload": [
    {
      "value": 37.8
    },
    {
      "capteur": "chaudiere_1/T.INTERNE/H.interne"
    }
  ],
  "_msgid": "d56418462e3d2b1b",
  "measurement": "chaudiere_1/T.INTERNE/H.interne"
}

And all datas go to influxdb2.0 bucket
As you can see below all data are under the same measurement.

How can i send data to have a different measurement for each subscribe topic ?

Thanks !

It is a little hard for me to fully understand your question. But here is a suggestion:
Try to group your measurements by physical unit. And then use tags for the different devices (e.g. a certain maschine or computer system ) of the measurement.
If an origin has also different sensors

{"measurement":"temperatures",
"tags":{
   "device": "T.INTERNE",
   "base": "claudiere_1"
},
"fields":{
   "chaude" : 12.3,
   "froid" : -10.3
   }
}

In this example the device "T.INTERNE" has 2 temperature sensors named "chaude" and "froid".

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