This is a Node Red node to manage connection to a DHT11 or DHT22 sensor on a Raspberry Pi. It allows you to specify the variables that define the connections to the sensor.
This node is added to the Raspberry Pi section.
This node requires that node-dht-sensor is installed and accessible from Node Red. Since this requires accesss to low-level parts of the Raspberry Pi, you must run your flow with superuser access.
Installing this node requires three steps:
sudo npm install -g node-dht-sensor
sudo npm install -g node-red-contrib-dht-sensor
You can specify the following, as seen in the picture here:
The node is added to the Raspberry Pi section of the Node-RED pallette, and it can be used in a flow as usual:
The message returned includes the temperature as the payload, and the humidity and the device ID as part of the message itself:
While not having the humidity as part of the payload may seem awkward, it was done with the explicit intention to preserve compatability with the node-red-controb-ds18b20-sensor node. ### Notes: