node-red-contrib-sht41 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +138 -0
- package/package.json +10 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WigglyWire
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# node-red-contrib-sht41
|
|
2
|
+
A Node-RED node for interfacing with the Sensirion SHT41 temperature and humidity sensor over I²C. This node reads temperature and relative humidity from an SHT41 sensor when triggered by an input message. Temperature units are user-selectable between °C and °F.
|
|
3
|
+
|
|
4
|
+
## Features:
|
|
5
|
+
* I²C communication with SHT41
|
|
6
|
+
* Temperature output in:
|
|
7
|
+
* Degrees Celsius (°C)
|
|
8
|
+
* Degrees Fahrenheit (°F)
|
|
9
|
+
* Relative humidity output (%RH)
|
|
10
|
+
* Triggered by standard Node-RED input message
|
|
11
|
+
* Designed for Raspberry Pi and other Linux SBCs
|
|
12
|
+
|
|
13
|
+
## Installation:
|
|
14
|
+
## From Node-RED (Recommended):
|
|
15
|
+
1. Open Node-RED
|
|
16
|
+
2. Go to Menu → Manage Palette
|
|
17
|
+
3. Select the Install tab
|
|
18
|
+
4. Search for:
|
|
19
|
+
|
|
20
|
+
node-red-contrib-sht41
|
|
21
|
+
6. Click Install
|
|
22
|
+
|
|
23
|
+
### From Command Line:
|
|
24
|
+
|
|
25
|
+
Run the following in your Node-RED user directory (typically `~/.node-red`):
|
|
26
|
+
|
|
27
|
+
npm install node-red-contrib-sht41
|
|
28
|
+
|
|
29
|
+
Restart Node-RED.
|
|
30
|
+
|
|
31
|
+
## Hardware Requirements
|
|
32
|
+
* Sensirion SHT41 Temperature & Humidity Sensor
|
|
33
|
+
* I²C enabled system (e.g., Raspberry Pi)
|
|
34
|
+
|
|
35
|
+
**Enable I²C (Raspberry Pi)**
|
|
36
|
+
|
|
37
|
+
sudo raspi-config
|
|
38
|
+
|
|
39
|
+
Navigate to:
|
|
40
|
+
|
|
41
|
+
Interface Options → I2C → Enable
|
|
42
|
+
|
|
43
|
+
Install I²C tools if needed:
|
|
44
|
+
|
|
45
|
+
sudo apt install -y i2c-tools
|
|
46
|
+
|
|
47
|
+
Verify the sensor is detected:
|
|
48
|
+
|
|
49
|
+
i2cdetect -y 1
|
|
50
|
+
|
|
51
|
+
The SHT41 default I²C address is:
|
|
52
|
+
|
|
53
|
+
0x44
|
|
54
|
+
|
|
55
|
+
## Node Configuration
|
|
56
|
+
### Properties
|
|
57
|
+
**I²C Bus** - Typically 1 on Raspberry Pi
|
|
58
|
+
|
|
59
|
+
**I²C Address** - Default: 0x44
|
|
60
|
+
|
|
61
|
+
**Temperature Unit** - °C or °F
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
1. Add an Inject node.
|
|
66
|
+
2. Connect it to the SHT41 node.
|
|
67
|
+
3. Connect a Debug node to view the output.
|
|
68
|
+
4. Deploy.
|
|
69
|
+
5. Click Inject.
|
|
70
|
+
|
|
71
|
+
## Output
|
|
72
|
+
|
|
73
|
+
When triggered, the node outputs a message object:
|
|
74
|
+
|
|
75
|
+
{
|
|
76
|
+
"payload": {
|
|
77
|
+
"temperature": 23.41,
|
|
78
|
+
"humidity": 45.12,
|
|
79
|
+
"unit": "C"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
If Fahrenheit is selected:
|
|
84
|
+
|
|
85
|
+
{
|
|
86
|
+
"payload": {
|
|
87
|
+
"temperature": 74.14,
|
|
88
|
+
"humidity": 45.12,
|
|
89
|
+
"unit": "F"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
Example Flow
|
|
94
|
+
|
|
95
|
+
[
|
|
96
|
+
{
|
|
97
|
+
"id": "sht41",
|
|
98
|
+
"type": "SHT41",
|
|
99
|
+
"name": "",
|
|
100
|
+
"busNum": "1",
|
|
101
|
+
"address": "0x44",
|
|
102
|
+
"precision": "high",
|
|
103
|
+
"unit": "C",
|
|
104
|
+
"x": 720,
|
|
105
|
+
"y": 260,
|
|
106
|
+
"wires": [
|
|
107
|
+
[
|
|
108
|
+
"debug"
|
|
109
|
+
]
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "inject",
|
|
114
|
+
"type": "inject",
|
|
115
|
+
"name": "Read Sensor",
|
|
116
|
+
"repeat": "",
|
|
117
|
+
"x": 490,
|
|
118
|
+
"y": 260,
|
|
119
|
+
"wires": [
|
|
120
|
+
[
|
|
121
|
+
"sht41"
|
|
122
|
+
]
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "debug",
|
|
127
|
+
"type": "debug",
|
|
128
|
+
"name": "SHT Output",
|
|
129
|
+
"x": 950,
|
|
130
|
+
"y": 260,
|
|
131
|
+
"wires": []
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
## Dependencies
|
|
136
|
+
* Node.js ≥ 16
|
|
137
|
+
* Node-RED ≥ 3.x
|
|
138
|
+
* I²C support on host device
|
package/package.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-sht41",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Node-RED node to read temperature and humidity from Sensirion SHT41 sensors over I2C",
|
|
5
|
-
"keywords": [
|
|
6
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"node-red",
|
|
7
|
+
"sht41",
|
|
8
|
+
"temperature",
|
|
9
|
+
"humidity",
|
|
10
|
+
"i2c",
|
|
11
|
+
"sensor"
|
|
12
|
+
],
|
|
13
|
+
"author": "Matt Love <Matt@WigglyWire.com>",
|
|
7
14
|
"license": "MIT",
|
|
8
15
|
"dependencies": {
|
|
9
16
|
"i2c-bus": "^5.2.2"
|