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

## Installation

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

## Nodes
## `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.

## Nodes List

1. Save Variable
2. Load Variable
3. Timestamp
4. Comparison Filter
5. Moving Average
6. Array Index
7. Gate
8. Gate Switch
9. Transmission TB telemetry
10. Transmission TB attributes
11. Retrieval TB telemetry
12. Retrieval TB attributes

![IoT4H Nodes Screenshot](nodes_screenshot.png)