node-red-contrib-iot4h-grovepi 1.1.0

Node Red nodes for the use of GrovePi+ sensors and actuators.

npm install node-red-contrib-iot4h-grovepi

IoT4H GrovePI Nodes

This project was developed and tested on Raspberry Pi 4 with GrovePi+ on Debian Bookworm (Rasperry Pi OS 12), Node 18.19.1 and npm 10.2.4.

Package on npm

Installation

  1. npm install node-red-contrib-iot4h-grovepi (in /home/pi/.node-red/node_modules/)
  2. node-red-restart

Nodes

See https://www.dexterindustries.com/GrovePi/engineering/port-description/

In addition to a node for each of the most common sensors, there are four “general” nodes.

  1. Digital Input, values: 0 or 1
  2. Analog Input, values: 0 to 1023
  3. Digital Output, values: 0 or 1
  4. Analog Output, values: 0 to 255

msg Properties

See https://nodered.org/docs/user-guide/messages

Usually, the "value" of a message is stored in its payload field. To make integration with other nodes easy, the payload of a sensor message only contains its values, all additional information is stored in other properties.

If a sensor returns multiple values (e.g. temperature and humidity), msg.payload is an array of these values.

In addition to that, msg.valueTypes is an array of value type specifications {unit: ..., name: ..., type: ...}.

This additional information is used for displaying sensor values on the LCD and when sending datapoints to the OpenDash platform.

The name and id values used in the open.DASH JSON object are stored in msg.sensorname and msg.sensorid.

user is set by the "RMQ Output" node and uses the "Username" value entered in the node configuration.

“Event Mode”

For some sensors, like the button, it might be useful to send an event only when the sensor value changes.

To do so, set the reading interval to a low value (e.g. 200ms), then connect the sensor to a "rbe" node.

This node only lets messages through if their payload has changed. It can be found at the bottom of the "Functions" section.

Inputs / Sensors

  1. Button
  2. Switch
  3. Rotary Angle
  4. Potentiometer
  5. DTH11 Temperature & Humidity
  6. DTH21 Temperature & Humidity
  7. DTH22 Temperature & Humidity
  8. Analog Input
  9. Digital Input
  10. Water
  11. Moisture
  12. Piezo Vibration
  13. Gas
  14. Ultrasonic Ranger
  15. Air Quality
  16. Light

Outputs / Actuators

  1. LCD RGB-Backlight
  2. LED
  3. PWM LED
  4. Buzzer
  5. Analog Output
  6. Digital Output

I2C Sensors

When connecting a I2C sensor, it doesn't matter which pin is used.

Troubleshooting

If a sensor returns false instead of a numeric value, check if the red LED on the GrovePI board is on.

In that case, disconnect all sensors from the board, detach the GrovePI board and put it back on.

Credits

Package contents obtained in part from node-red-contrib-od-grovepi and extended with own nodes for easier access to complex functionality. The main purpose is to avoid using written code at all.

Salvaged packages for existing sensor nodes for NodeRed:

Node Info

Version: 1.1.0
Updated 1 week, 4 days ago
License: Apache-2.0
Rating: not yet rated

Categories

Actions

Rate:

Downloads

27 in the last week

Nodes

  • grovepi-button
  • grovepi-switch
  • grovepi-rotary
  • grovepi-potentiometer
  • grovepi-analog-input
  • grovepi-digital-input
  • grovepi-rgblcd
  • grovepi-led
  • grovepi-pwm-led
  • grovepi-buzzer
  • grovepi-analog-output
  • grovepi-digital-output
  • grovepi-dht11
  • grovepi-dht21
  • grovepi-dht22
  • grovepi-water
  • grovepi-moisture
  • grovepi-piezo
  • grovepi-gas-sensor
  • grovepi-ultrasonic
  • grovepi-air-quality
  • grovepi-light-sensor

Keywords

  • node-red
  • iot
  • grovepi
  • IoT4H

Maintainers