How to receive Humidity data from Sonoff TH10 (SI7021) to InfulxDB trough Node-red?

I created little project where i wanna connect the following chain:
MQTT Brocker > Node-RED > InfluxDB >Grafana .
I still dont understand what must be right Measurement request and I get next error:

Error: A 400 Bad Request error occurred: {"error":"unable to parse '{\"SI7021\":{\"Temperature\",\"Humidity\",\"DewPoint\"} topic: \"tele/tasmota_00152F/SENSOR\", payload: object, qos: 0, retain: false, _msgid: \"9802c834c83fc21b\" } SI7021=[object Object],TempUnit=\"C\",Time=\"2022-10-16T01:45:10\"': missing tag value"}

My Measurement request:

{"SI7021":{"Temperature","Humidity","DewPoint"} topic: "tele/tasmota_00152F/SENSOR", payload: object, qos: 0, retain: false, _msgid: }

I usually trasform the value retrievied from sensor by "change node" and JSONata, an example below using your sensor data:

        "Temperature": msg.payload.SI7021.Temperature,
        "Humidity": msg.payload.SI7021.Humidity
        "Sensor": msg.topic

Hope this help,

1 Like

There is a post from me in the FAQ's section somewhere where I describe some good practices for such measurements. For example, you should probably include a "location" tag so that you can easily chart outputs by a human readable location. I also describe how to keep the data to a reasonable size over time.

Do you mean this one? Need more detailed information on influxdb - #4 by StefanSchmelz

1 Like

Yes, that's the one, thanks. :smiley:

Paul rightly reminded me that the thread I mentioned was not, in fact in the FAQ's. Thanks for that Paul.

However, it is now:

1 Like

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