# Newbie DHT11 question

**URL:** <https://discourse.nodered.org/t/newbie-dht11-question/29103>\
**Category:** General\
**Created:** [28 June 2020 09:10 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103 "2020-06-28T09:10:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rog\_Red](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Rog\_Red](https://discourse.nodered.org/u/Rog_Red)\
**Post date:** [28 June 2020 09:10 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/1 "2020-06-28T09:10:35Z")

</div>

Hi All..  
I'm new to Node Red and I am trying to figure out why my DHT11 payload is only whole numbers.  
Not so much that I miss the decimal point (accuracy is not that good anyway) but is this something that is coded in the node?

Cheers 🙂

---

<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:** [28 June 2020 09:23 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/2 "2020-06-28T09:23:58Z")

</div>

Hi Rog, welcome to the forum!

Which node are you using? Node-red-contrib-?????

Add a debug node (set to display the complete msg object) to the output of the dht11 node and paste the results in a reply.

---

<div class="post-metadata">

**Author:** ![Rog\_Red](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Rog\_Red](https://discourse.nodered.org/u/Rog_Red)\
**Post date:** [28 June 2020 09:28 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/3 "2020-06-28T09:28:59Z")

</div>

Thanks zenofmud. Here is the output.. but i am starting to suspect the sensor will not output decimal places as the accuracy is not high enough to warrant decimal places.. May have answered my own question 🙂

6/28/2020, 7:21:46 PM[node: ee65f59b.c867f8](http://192.168.0.54:1880/?#)rpi-dht22 : msg : Object

{ topic: "rpi-dht22", payload: "24.00", \_msgid: "1b3fb204.b900ee", humidity: "51.00", isValid: false … }

---

<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:** [28 June 2020 09:52 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/4 "2020-06-28T09:52:32Z")

</div>

- Do you have this connected to a Pi?
- what model pi and what os?
- if it is connected to the pi, how do you have it wired?
- which node are you using?
- what settings do you have in the node.

If you look at the debug, upi will see that the node is returning two decimal places, but they are both `.00`

the DHT11 and DHT22 are not very reliable and prone to fail (which is why they are so cheap). A better choice is a BMP280 or BME280.

---

<div class="post-metadata">

**Author:** ![Rog\_Red](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Rog\_Red](https://discourse.nodered.org/u/Rog_Red)\
**Post date:** [28 June 2020 10:07 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/5 "2020-06-28T10:07:25Z")

</div>

You are probably right.. it is a cheap sensor but I am just dipping my toe in Node Red so it looked like a good place to start. Yes, the .00 sort of gives it away so unless the node is restricting the output (I doubt it) I think there is no more data to be had from the sensor. This is my first project and my aim is to push some live data up on my public page.. thought that to be an interesting little task for me to attempt.

- Do you have this connected to a Pi? **Yes**
- what model pi and what os? **Raspbian GNU/Linux 8 (jessie)**
- if it is connected to the pi, how do you have it wired? **BCM GPIO 4**
- which node are you using? **rpi-dht22**
- what settings do you have in the node. **DHT-11**

---

<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:** [28 June 2020 10:12 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/6 "2020-06-28T10:12:54Z")

</div>

> [@Rog\_Red](#):
>
> push some live data up on my public page

Could you elaborate this. Are you sending the data to an outside website or are you opening up your network to the outside world (very, very bad idea unless you have secured it - do not open the pi to the outside world without securing it or you **will** get hacked

have you tried sending the data to the dashboard (node-red-node-dashboard) using a ui-text node? That way you could watch it realtime in a browser and you could breath on the sensor to watch the values.

I have a DHT22 connected to a WeMos (running ESPEasy) and am getting readings with decimals

---

<div class="post-metadata">

**Author:** ![Rog\_Red](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Rog\_Red](https://discourse.nodered.org/u/Rog_Red)\
**Post date:** [28 June 2020 10:19 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/7 "2020-06-28T10:19:38Z")

</div>

No, nothing going out yet 🙂 I realize it would have to use something like Ajax. As a first step I'd like to get some data to a page on my domain. It would be nice to access the data through Google Assistant as well but I have not worked out exactly how that would work.. still learning. 😉

---

<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:** [28 June 2020 10:26 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/8 "2020-06-28T10:26:51Z")

</div>

Well the sensor and the node should report decimal places as you can see in the [readme of node-red-contrib-dht-sensor](https://flows.nodered.org/node/node-red-contrib-dht-sensor)

> The message returned includes the temperature as the payload, and the humidity and the device ID as part of the message itself:
> 
> ![Returned message](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/21ee855b7f2b03caf401d1b25b26cbb59d99b1ea.jpeg)

Just to be sure, you did install the latest BCM2835 library...correct?

If you ave more than one sensor, you should try swapping them and see what readings you get.

---

<div class="post-metadata">

**Author:** ![Rog\_Red](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Rog\_Red](https://discourse.nodered.org/u/Rog_Red)\
**Post date:** [28 June 2020 10:36 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/9 "2020-06-28T10:36:06Z")

</div>

Ok, that's interesting. Not sure about the BCM2835 library.. I'll check. That's very helpful, Thanks 🙂

---

<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:** [27 August 2020 10:36 UTC](https://discourse.nodered.org/t/newbie-dht11-question/29103/10 "2020-08-27T10:36:09Z")

</div>

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