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

**URL:** <https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093>\
**Category:** General\
**Tags:** database, mqtt\
**Created:** [16 October 2022 00:49 UTC](https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093 "2022-10-16T00:49:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TovstuiKohanchik](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tovstuikohanchik/32/69238_2.png) [@TovstuiKohanchik](https://discourse.nodered.org/u/TovstuiKohanchik)\
**Post date:** [16 October 2022 00:49 UTC](https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093/1 "2022-10-16T00:49:54Z")

</div>

Hi.  
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: }`

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/4/e47a25081fe2c75800dc1960be325684faf4d1f2.png)

---

<div class="post-metadata">

**Author:** ![Xenon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xenon/32/48893_2.png) [@Xenon](https://discourse.nodered.org/u/Xenon)\
**Post date:** [16 October 2022 06:24 UTC](https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093/2 "2022-10-16T06:24:21Z")

</div>

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

```auto
[
    {
        "Temperature": msg.payload.SI7021.Temperature,
        "Humidity": msg.payload.SI7021.Humidity
    },{
        "Sensor": msg.topic
    }
]

```

Hope this help,  
Giulio

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 October 2022 10:54 UTC](https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093/3 "2022-10-16T10:54:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 October 2022 13:37 UTC](https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093/4 "2022-10-16T13:37:50Z")

</div>

Do you mean this one? [Need more detailed information on influxdb - #4 by StefanSchmelz](https://discourse.nodered.org/t/need-more-detailed-information-on-influxdb/36885/4)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 October 2022 14:17 UTC](https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093/5 "2022-10-16T14:17:19Z")

</div>

Yes, that's the one, thanks. 😃

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 October 2022 18:03 UTC](https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093/6 "2022-10-16T18:03:18Z")

</div>

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:

> [@How to effectively use InfluxDB](https://discourse.nodered.org/t/how-to-effectively-use-influxdb/36885):
>
> Hi, I want to runn all my sensor values and things into an influxdb. I have looked into the documentation of node-red-contrib-influxdb and that left many questiuons open: I want to automatically retain all measurements for 3 months, retain an hourly average/median for 3 more months and Store Weekly averages indefinitely. What would I have to do to make this as easy as possible? Would you rather run influxdb on you raspberry or an old laptop? Would you rather create "tables" per measured val…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 December 2022 18:04 UTC](https://discourse.nodered.org/t/how-to-receive-humidity-data-from-sonoff-th10-si7021-to-infulxdb-trough-node-red/69093/7 "2022-12-15T18:04:00Z")

</div>

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