Newbie DHT11 question

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 :slight_smile:

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.

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 :slight_smile:

6/28/2020, 7:21:46 PMnode: ee65f59b.c867f8rpi-dht22 : msg : Object

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

  • 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.

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

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

No, nothing going out yet :slight_smile: 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. :wink:

Well the sensor and the node should report decimal places as you can see in the readme of 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

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.

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

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