node-red-contrib-periph-humidity 1.4.0 → 1.5.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/README.md +7 -0
- package/examples/hdc1008/demo.json +85 -0
- package/examples/hdc1080/demo.json +85 -0
- package/examples/hs30xx/demo.json +84 -0
- package/examples/hs40xx/demo.json +84 -0
- package/examples/htu21df/demo.json +86 -0
- package/examples/sht31/demo.json +85 -0
- package/examples/si7021/demo.json +86 -0
- package/nodes/hdc1008/hdc1008.html +63 -0
- package/nodes/hdc1008/hdc1008.js +51 -0
- package/nodes/hdc1080/hdc1080.html +63 -0
- package/nodes/hdc1080/hdc1080.js +51 -0
- package/nodes/hs30xx/hs30xx.html +53 -0
- package/nodes/hs30xx/hs30xx.js +39 -0
- package/nodes/hs40xx/hs40xx.html +65 -0
- package/nodes/hs40xx/hs40xx.js +44 -0
- package/nodes/htu21df/htu21df.html +67 -0
- package/nodes/htu21df/htu21df.js +52 -0
- package/nodes/sht31/sht31.html +64 -0
- package/nodes/sht31/sht31.js +48 -0
- package/nodes/si7021/si7021.html +68 -0
- package/nodes/si7021/si7021.js +51 -0
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -18,6 +18,13 @@ npm install node-red-contrib-periph-humidity
|
|
|
18
18
|
|------|------|-------------|
|
|
19
19
|
| `dht11-device` | config | Bus configuration for a DHT11 |
|
|
20
20
|
| `dht11` | input | Reads temperature and humidity from a DHT11 sensor over a single GPIO data line. |
|
|
21
|
+
| `periph-hdc1008` | input | Reads temperature and relative humidity from a Texas Instruments HDC1008 over I²C (addresses 0x40–0x43) with one sequence measurement (temperature then humidity) per message. |
|
|
22
|
+
| `periph-hdc1080` | input | Reads temperature and relative humidity from a Texas Instruments HDC1080 over I²C (address 0x40) with one sequence measurement (temperature then humidity) per message. |
|
|
23
|
+
| `periph-hs30xx` | input | Reads temperature and relative humidity from a Renesas HS3001, HS3002 or HS3003 (the HS30xx family, one protocol) over I²C (fixed address 0x44) with one measurement per message. |
|
|
24
|
+
| `periph-hs40xx` | input | Reads temperature and relative humidity from a Renesas HS4001 or HS4003 (the HS40xx family, one protocol) over I²C (fixed address 0x54) with one no-hold measurement per message. HS4002 and the HS401x variants are physically different versions of the same part and are not offered separately. |
|
|
25
|
+
| `periph-htu21df` | input | Reads temperature and relative humidity from a Measurement Specialties HTU21D-F over I²C (fixed address 0x40) with one temperature and one humidity measurement per message. The CRC of both results is verified. |
|
|
26
|
+
| `periph-sht31` | input | Reads temperature and relative humidity from a Sensirion SHT31 over I²C (0x44 with ADDR low, 0x45 with ADDR high) with one single-shot measurement per message. Both CRC bytes are verified. |
|
|
27
|
+
| `periph-si7021` | input | Reads relative humidity and temperature from a Silicon Labs Si7021 over I²C (fixed address 0x40) with one relative-humidity measurement per message; the temperature comes from the same conversion. The CRC of the humidity result is verified. |
|
|
21
28
|
|
|
22
29
|
## Links
|
|
23
30
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "hdc1008-tab",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "HDC1008 humidity logger",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "Reads temperature and relative humidity from an HDC1008 every 2 s and formats them. Demonstrates the sequence-mode measurement (temperature then humidity in one read)."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "hdc1008-inject",
|
|
11
|
+
"type": "inject",
|
|
12
|
+
"z": "hdc1008-tab",
|
|
13
|
+
"name": "2 s timer",
|
|
14
|
+
"props": [
|
|
15
|
+
{
|
|
16
|
+
"p": "payload"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"repeat": "2",
|
|
20
|
+
"crontab": "",
|
|
21
|
+
"once": false,
|
|
22
|
+
"onceDelay": 0.1,
|
|
23
|
+
"topic": "",
|
|
24
|
+
"payloadType": "date",
|
|
25
|
+
"x": 160,
|
|
26
|
+
"y": 160,
|
|
27
|
+
"wires": [
|
|
28
|
+
[
|
|
29
|
+
"hdc1008-node"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "hdc1008-node",
|
|
35
|
+
"type": "periph-hdc1008",
|
|
36
|
+
"z": "hdc1008-tab",
|
|
37
|
+
"name": "HDC1008",
|
|
38
|
+
"bus": "1",
|
|
39
|
+
"address": "0x40",
|
|
40
|
+
"x": 380,
|
|
41
|
+
"y": 160,
|
|
42
|
+
"wires": [
|
|
43
|
+
[
|
|
44
|
+
"hdc1008-format"
|
|
45
|
+
]
|
|
46
|
+
],
|
|
47
|
+
"resolution": "14/14"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "hdc1008-format",
|
|
51
|
+
"type": "function",
|
|
52
|
+
"z": "hdc1008-tab",
|
|
53
|
+
"name": "Format",
|
|
54
|
+
"func": "msg.payload = msg.payload.temperature_c.toFixed(2) + ' °C, ' + msg.payload.humidity_pct.toFixed(1) + ' %RH';\nreturn msg;",
|
|
55
|
+
"outputs": 1,
|
|
56
|
+
"noerr": 0,
|
|
57
|
+
"initialize": "",
|
|
58
|
+
"finalize": "",
|
|
59
|
+
"libs": [],
|
|
60
|
+
"x": 600,
|
|
61
|
+
"y": 160,
|
|
62
|
+
"wires": [
|
|
63
|
+
[
|
|
64
|
+
"hdc1008-debug"
|
|
65
|
+
]
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "hdc1008-debug",
|
|
70
|
+
"type": "debug",
|
|
71
|
+
"z": "hdc1008-tab",
|
|
72
|
+
"name": "Reading",
|
|
73
|
+
"active": true,
|
|
74
|
+
"tosidebar": true,
|
|
75
|
+
"console": false,
|
|
76
|
+
"tostatus": false,
|
|
77
|
+
"complete": "payload",
|
|
78
|
+
"targetType": "msg",
|
|
79
|
+
"statusVal": "",
|
|
80
|
+
"statusType": "auto",
|
|
81
|
+
"x": 800,
|
|
82
|
+
"y": 160,
|
|
83
|
+
"wires": []
|
|
84
|
+
}
|
|
85
|
+
]
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "hdc1080-tab",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "HDC1080 humidity logger",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "Reads temperature and relative humidity from an HDC1080 every 2 s and formats them. Demonstrates the sequence-mode measurement (temperature then humidity in one read)."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "hdc1080-inject",
|
|
11
|
+
"type": "inject",
|
|
12
|
+
"z": "hdc1080-tab",
|
|
13
|
+
"name": "2 s timer",
|
|
14
|
+
"props": [
|
|
15
|
+
{
|
|
16
|
+
"p": "payload"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"repeat": "2",
|
|
20
|
+
"crontab": "",
|
|
21
|
+
"once": false,
|
|
22
|
+
"onceDelay": 0.1,
|
|
23
|
+
"topic": "",
|
|
24
|
+
"payloadType": "date",
|
|
25
|
+
"x": 160,
|
|
26
|
+
"y": 160,
|
|
27
|
+
"wires": [
|
|
28
|
+
[
|
|
29
|
+
"hdc1080-node"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "hdc1080-node",
|
|
35
|
+
"type": "periph-hdc1080",
|
|
36
|
+
"z": "hdc1080-tab",
|
|
37
|
+
"name": "HDC1080",
|
|
38
|
+
"bus": "1",
|
|
39
|
+
"address": "0x40",
|
|
40
|
+
"x": 380,
|
|
41
|
+
"y": 160,
|
|
42
|
+
"wires": [
|
|
43
|
+
[
|
|
44
|
+
"hdc1080-format"
|
|
45
|
+
]
|
|
46
|
+
],
|
|
47
|
+
"resolution": "14/14"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "hdc1080-format",
|
|
51
|
+
"type": "function",
|
|
52
|
+
"z": "hdc1080-tab",
|
|
53
|
+
"name": "Format",
|
|
54
|
+
"func": "msg.payload = msg.payload.temperature_c.toFixed(2) + ' °C, ' + msg.payload.humidity_pct.toFixed(1) + ' %RH';\nreturn msg;",
|
|
55
|
+
"outputs": 1,
|
|
56
|
+
"noerr": 0,
|
|
57
|
+
"initialize": "",
|
|
58
|
+
"finalize": "",
|
|
59
|
+
"libs": [],
|
|
60
|
+
"x": 600,
|
|
61
|
+
"y": 160,
|
|
62
|
+
"wires": [
|
|
63
|
+
[
|
|
64
|
+
"hdc1080-debug"
|
|
65
|
+
]
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "hdc1080-debug",
|
|
70
|
+
"type": "debug",
|
|
71
|
+
"z": "hdc1080-tab",
|
|
72
|
+
"name": "Reading",
|
|
73
|
+
"active": true,
|
|
74
|
+
"tosidebar": true,
|
|
75
|
+
"console": false,
|
|
76
|
+
"tostatus": false,
|
|
77
|
+
"complete": "payload",
|
|
78
|
+
"targetType": "msg",
|
|
79
|
+
"statusVal": "",
|
|
80
|
+
"statusType": "auto",
|
|
81
|
+
"x": 800,
|
|
82
|
+
"y": 160,
|
|
83
|
+
"wires": []
|
|
84
|
+
}
|
|
85
|
+
]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "hs30xx-tab",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "HS30xx humidity logger",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "Reads temperature and relative humidity from an HS30xx (HS3001/HS3002/HS3003) every 2 s and formats them. Each message sends one measurement request, waits 40 ms and fetches the result."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "hs30xx-inject",
|
|
11
|
+
"type": "inject",
|
|
12
|
+
"z": "hs30xx-tab",
|
|
13
|
+
"name": "2 s timer",
|
|
14
|
+
"props": [
|
|
15
|
+
{
|
|
16
|
+
"p": "payload"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"repeat": "2",
|
|
20
|
+
"crontab": "",
|
|
21
|
+
"once": false,
|
|
22
|
+
"onceDelay": 0.1,
|
|
23
|
+
"topic": "",
|
|
24
|
+
"payloadType": "date",
|
|
25
|
+
"x": 160,
|
|
26
|
+
"y": 160,
|
|
27
|
+
"wires": [
|
|
28
|
+
[
|
|
29
|
+
"hs30xx-node"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "hs30xx-node",
|
|
35
|
+
"type": "periph-hs30xx",
|
|
36
|
+
"z": "hs30xx-tab",
|
|
37
|
+
"name": "HS30xx",
|
|
38
|
+
"bus": "1",
|
|
39
|
+
"address": "0x44",
|
|
40
|
+
"x": 380,
|
|
41
|
+
"y": 160,
|
|
42
|
+
"wires": [
|
|
43
|
+
[
|
|
44
|
+
"hs30xx-format"
|
|
45
|
+
]
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "hs30xx-format",
|
|
50
|
+
"type": "function",
|
|
51
|
+
"z": "hs30xx-tab",
|
|
52
|
+
"name": "Format",
|
|
53
|
+
"func": "msg.payload = msg.payload.temperature_c.toFixed(2) + ' °C, ' + msg.payload.humidity_pct.toFixed(1) + ' %RH';\nreturn msg;",
|
|
54
|
+
"outputs": 1,
|
|
55
|
+
"noerr": 0,
|
|
56
|
+
"initialize": "",
|
|
57
|
+
"finalize": "",
|
|
58
|
+
"libs": [],
|
|
59
|
+
"x": 600,
|
|
60
|
+
"y": 160,
|
|
61
|
+
"wires": [
|
|
62
|
+
[
|
|
63
|
+
"hs30xx-debug"
|
|
64
|
+
]
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "hs30xx-debug",
|
|
69
|
+
"type": "debug",
|
|
70
|
+
"z": "hs30xx-tab",
|
|
71
|
+
"name": "Reading",
|
|
72
|
+
"active": true,
|
|
73
|
+
"tosidebar": true,
|
|
74
|
+
"console": false,
|
|
75
|
+
"tostatus": false,
|
|
76
|
+
"complete": "payload",
|
|
77
|
+
"targetType": "msg",
|
|
78
|
+
"statusVal": "",
|
|
79
|
+
"statusType": "auto",
|
|
80
|
+
"x": 800,
|
|
81
|
+
"y": 160,
|
|
82
|
+
"wires": []
|
|
83
|
+
}
|
|
84
|
+
]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "hs40xx-tab",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "HS40xx humidity logger",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "Reads temperature and relative humidity from an HS40xx (HS4001/HS4003) every 2 s and formats them. Each message sends one no-hold measurement (0xF5), waits 3 ms, reads five bytes and checks the CRC."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "hs40xx-inject",
|
|
11
|
+
"type": "inject",
|
|
12
|
+
"z": "hs40xx-tab",
|
|
13
|
+
"name": "2 s timer",
|
|
14
|
+
"props": [
|
|
15
|
+
{
|
|
16
|
+
"p": "payload"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"repeat": "2",
|
|
20
|
+
"crontab": "",
|
|
21
|
+
"once": false,
|
|
22
|
+
"onceDelay": 0.1,
|
|
23
|
+
"topic": "",
|
|
24
|
+
"payloadType": "date",
|
|
25
|
+
"x": 160,
|
|
26
|
+
"y": 160,
|
|
27
|
+
"wires": [
|
|
28
|
+
[
|
|
29
|
+
"hs40xx-node"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "hs40xx-node",
|
|
35
|
+
"type": "periph-hs40xx",
|
|
36
|
+
"z": "hs40xx-tab",
|
|
37
|
+
"name": "HS40xx",
|
|
38
|
+
"bus": "1",
|
|
39
|
+
"address": "0x54",
|
|
40
|
+
"x": 380,
|
|
41
|
+
"y": 160,
|
|
42
|
+
"wires": [
|
|
43
|
+
[
|
|
44
|
+
"hs40xx-format"
|
|
45
|
+
]
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "hs40xx-format",
|
|
50
|
+
"type": "function",
|
|
51
|
+
"z": "hs40xx-tab",
|
|
52
|
+
"name": "Format",
|
|
53
|
+
"func": "msg.payload = msg.payload.temperature_c.toFixed(2) + ' °C, ' + msg.payload.humidity_pct.toFixed(1) + ' %RH';\nreturn msg;",
|
|
54
|
+
"outputs": 1,
|
|
55
|
+
"noerr": 0,
|
|
56
|
+
"initialize": "",
|
|
57
|
+
"finalize": "",
|
|
58
|
+
"libs": [],
|
|
59
|
+
"x": 600,
|
|
60
|
+
"y": 160,
|
|
61
|
+
"wires": [
|
|
62
|
+
[
|
|
63
|
+
"hs40xx-debug"
|
|
64
|
+
]
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "hs40xx-debug",
|
|
69
|
+
"type": "debug",
|
|
70
|
+
"z": "hs40xx-tab",
|
|
71
|
+
"name": "Reading",
|
|
72
|
+
"active": true,
|
|
73
|
+
"tosidebar": true,
|
|
74
|
+
"console": false,
|
|
75
|
+
"tostatus": false,
|
|
76
|
+
"complete": "payload",
|
|
77
|
+
"targetType": "msg",
|
|
78
|
+
"statusVal": "",
|
|
79
|
+
"statusType": "auto",
|
|
80
|
+
"x": 800,
|
|
81
|
+
"y": 160,
|
|
82
|
+
"wires": []
|
|
83
|
+
}
|
|
84
|
+
]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "htu21df-tab",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "HTU21D-F humidity logger",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "Reads temperature and relative humidity from an HTU21D-F every 2 s and formats them. Demonstrates the no-hold-master temperature and humidity measurements with CRC checking."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "htu21df-inject",
|
|
11
|
+
"type": "inject",
|
|
12
|
+
"z": "htu21df-tab",
|
|
13
|
+
"name": "2 s timer",
|
|
14
|
+
"props": [
|
|
15
|
+
{
|
|
16
|
+
"p": "payload"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"repeat": "2",
|
|
20
|
+
"crontab": "",
|
|
21
|
+
"once": false,
|
|
22
|
+
"onceDelay": 0.1,
|
|
23
|
+
"topic": "",
|
|
24
|
+
"payloadType": "date",
|
|
25
|
+
"x": 160,
|
|
26
|
+
"y": 160,
|
|
27
|
+
"wires": [
|
|
28
|
+
[
|
|
29
|
+
"htu21df-node"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "htu21df-node",
|
|
35
|
+
"type": "periph-htu21df",
|
|
36
|
+
"z": "htu21df-tab",
|
|
37
|
+
"name": "HTU21D-F",
|
|
38
|
+
"bus": "1",
|
|
39
|
+
"address": "0x40",
|
|
40
|
+
"x": 380,
|
|
41
|
+
"y": 160,
|
|
42
|
+
"wires": [
|
|
43
|
+
[
|
|
44
|
+
"htu21df-format"
|
|
45
|
+
]
|
|
46
|
+
],
|
|
47
|
+
"resolution": "12/14",
|
|
48
|
+
"heater": false
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "htu21df-format",
|
|
52
|
+
"type": "function",
|
|
53
|
+
"z": "htu21df-tab",
|
|
54
|
+
"name": "Format",
|
|
55
|
+
"func": "msg.payload = msg.payload.temperature_c.toFixed(2) + ' °C, ' + msg.payload.humidity_pct.toFixed(1) + ' %RH';\nreturn msg;",
|
|
56
|
+
"outputs": 1,
|
|
57
|
+
"noerr": 0,
|
|
58
|
+
"initialize": "",
|
|
59
|
+
"finalize": "",
|
|
60
|
+
"libs": [],
|
|
61
|
+
"x": 600,
|
|
62
|
+
"y": 160,
|
|
63
|
+
"wires": [
|
|
64
|
+
[
|
|
65
|
+
"htu21df-debug"
|
|
66
|
+
]
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "htu21df-debug",
|
|
71
|
+
"type": "debug",
|
|
72
|
+
"z": "htu21df-tab",
|
|
73
|
+
"name": "Reading",
|
|
74
|
+
"active": true,
|
|
75
|
+
"tosidebar": true,
|
|
76
|
+
"console": false,
|
|
77
|
+
"tostatus": false,
|
|
78
|
+
"complete": "payload",
|
|
79
|
+
"targetType": "msg",
|
|
80
|
+
"statusVal": "",
|
|
81
|
+
"statusType": "auto",
|
|
82
|
+
"x": 800,
|
|
83
|
+
"y": 160,
|
|
84
|
+
"wires": []
|
|
85
|
+
}
|
|
86
|
+
]
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "sht31-tab",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "SHT31 humidity logger",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "Reads temperature and relative humidity from an SHT31 every 2 s and formats them. Demonstrates the single-shot measurement with CRC checking."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "sht31-inject",
|
|
11
|
+
"type": "inject",
|
|
12
|
+
"z": "sht31-tab",
|
|
13
|
+
"name": "2 s timer",
|
|
14
|
+
"props": [
|
|
15
|
+
{
|
|
16
|
+
"p": "payload"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"repeat": "2",
|
|
20
|
+
"crontab": "",
|
|
21
|
+
"once": false,
|
|
22
|
+
"onceDelay": 0.1,
|
|
23
|
+
"topic": "",
|
|
24
|
+
"payloadType": "date",
|
|
25
|
+
"x": 160,
|
|
26
|
+
"y": 160,
|
|
27
|
+
"wires": [
|
|
28
|
+
[
|
|
29
|
+
"sht31-node"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "sht31-node",
|
|
35
|
+
"type": "periph-sht31",
|
|
36
|
+
"z": "sht31-tab",
|
|
37
|
+
"name": "SHT31",
|
|
38
|
+
"bus": "1",
|
|
39
|
+
"address": "0x44",
|
|
40
|
+
"repeatability": "high",
|
|
41
|
+
"x": 380,
|
|
42
|
+
"y": 160,
|
|
43
|
+
"wires": [
|
|
44
|
+
[
|
|
45
|
+
"sht31-format"
|
|
46
|
+
]
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "sht31-format",
|
|
51
|
+
"type": "function",
|
|
52
|
+
"z": "sht31-tab",
|
|
53
|
+
"name": "Format",
|
|
54
|
+
"func": "msg.payload = msg.payload.temperature.toFixed(2) + ' °C, ' + msg.payload.humidity.toFixed(1) + ' %RH';\\nreturn msg;",
|
|
55
|
+
"outputs": 1,
|
|
56
|
+
"noerr": 0,
|
|
57
|
+
"initialize": "",
|
|
58
|
+
"finalize": "",
|
|
59
|
+
"libs": [],
|
|
60
|
+
"x": 600,
|
|
61
|
+
"y": 160,
|
|
62
|
+
"wires": [
|
|
63
|
+
[
|
|
64
|
+
"sht31-debug"
|
|
65
|
+
]
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "sht31-debug",
|
|
70
|
+
"type": "debug",
|
|
71
|
+
"z": "sht31-tab",
|
|
72
|
+
"name": "Reading",
|
|
73
|
+
"active": true,
|
|
74
|
+
"tosidebar": true,
|
|
75
|
+
"console": false,
|
|
76
|
+
"tostatus": false,
|
|
77
|
+
"complete": "payload",
|
|
78
|
+
"targetType": "msg",
|
|
79
|
+
"statusVal": "",
|
|
80
|
+
"statusType": "auto",
|
|
81
|
+
"x": 800,
|
|
82
|
+
"y": 160,
|
|
83
|
+
"wires": []
|
|
84
|
+
}
|
|
85
|
+
]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "si7021-tab",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "Si7021 humidity logger",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "Reads relative humidity and temperature from an Si7021 every 2 s and formats them. Demonstrates the no-hold-master RH measurement with CRC checking and the temperature of the same conversion."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "si7021-inject",
|
|
11
|
+
"type": "inject",
|
|
12
|
+
"z": "si7021-tab",
|
|
13
|
+
"name": "2 s timer",
|
|
14
|
+
"props": [
|
|
15
|
+
{
|
|
16
|
+
"p": "payload"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"repeat": "2",
|
|
20
|
+
"crontab": "",
|
|
21
|
+
"once": false,
|
|
22
|
+
"onceDelay": 0.1,
|
|
23
|
+
"topic": "",
|
|
24
|
+
"payloadType": "date",
|
|
25
|
+
"x": 160,
|
|
26
|
+
"y": 160,
|
|
27
|
+
"wires": [
|
|
28
|
+
[
|
|
29
|
+
"si7021-node"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "si7021-node",
|
|
35
|
+
"type": "periph-si7021",
|
|
36
|
+
"z": "si7021-tab",
|
|
37
|
+
"name": "Si7021",
|
|
38
|
+
"bus": "1",
|
|
39
|
+
"address": "0x40",
|
|
40
|
+
"x": 380,
|
|
41
|
+
"y": 160,
|
|
42
|
+
"wires": [
|
|
43
|
+
[
|
|
44
|
+
"si7021-format"
|
|
45
|
+
]
|
|
46
|
+
],
|
|
47
|
+
"resolution": "12/14",
|
|
48
|
+
"heater": false
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "si7021-format",
|
|
52
|
+
"type": "function",
|
|
53
|
+
"z": "si7021-tab",
|
|
54
|
+
"name": "Format",
|
|
55
|
+
"func": "msg.payload = msg.payload.temperature_c.toFixed(2) + ' °C, ' + msg.payload.humidity_pct.toFixed(1) + ' %RH';\nreturn msg;",
|
|
56
|
+
"outputs": 1,
|
|
57
|
+
"noerr": 0,
|
|
58
|
+
"initialize": "",
|
|
59
|
+
"finalize": "",
|
|
60
|
+
"libs": [],
|
|
61
|
+
"x": 600,
|
|
62
|
+
"y": 160,
|
|
63
|
+
"wires": [
|
|
64
|
+
[
|
|
65
|
+
"si7021-debug"
|
|
66
|
+
]
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "si7021-debug",
|
|
71
|
+
"type": "debug",
|
|
72
|
+
"z": "si7021-tab",
|
|
73
|
+
"name": "Reading",
|
|
74
|
+
"active": true,
|
|
75
|
+
"tosidebar": true,
|
|
76
|
+
"console": false,
|
|
77
|
+
"tostatus": false,
|
|
78
|
+
"complete": "payload",
|
|
79
|
+
"targetType": "msg",
|
|
80
|
+
"statusVal": "",
|
|
81
|
+
"statusType": "auto",
|
|
82
|
+
"x": 800,
|
|
83
|
+
"y": 160,
|
|
84
|
+
"wires": []
|
|
85
|
+
}
|
|
86
|
+
]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType('periph-hdc1008', {
|
|
3
|
+
category: 'Peripheral',
|
|
4
|
+
color: '#C084FC',
|
|
5
|
+
defaults: {
|
|
6
|
+
name: { value: '' },
|
|
7
|
+
bus: { value: '1', required: true, validate: RED.validators.number() },
|
|
8
|
+
address: { value: '0x40' },
|
|
9
|
+
resolution: { value: '14/14' }
|
|
10
|
+
},
|
|
11
|
+
inputs: 1,
|
|
12
|
+
outputs: 1,
|
|
13
|
+
icon: 'bridge.svg',
|
|
14
|
+
label: function() {
|
|
15
|
+
return this.name || ('HDC1008 @ ' + this.address + ' (bus ' + this.bus + ')');
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script type="text/html" data-template-name="periph-hdc1008">
|
|
21
|
+
<div class="form-row">
|
|
22
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
23
|
+
<input type="text" id="node-input-name" placeholder="HDC1008">
|
|
24
|
+
</div>
|
|
25
|
+
<div class="form-row">
|
|
26
|
+
<label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
|
|
27
|
+
<input type="number" id="node-input-bus" min="0" style="width:80px"> (Linux /dev/i2c-N)
|
|
28
|
+
</div>
|
|
29
|
+
<div class="form-row">
|
|
30
|
+
<label for="node-input-address"><i class="fa fa-microchip"></i> I²C address</label>
|
|
31
|
+
<input type="text" id="node-input-address" style="width:80px" placeholder="0x40"> (0x40 – 0x43, set by ADR0/ADR1)
|
|
32
|
+
</div>
|
|
33
|
+
<div class="form-row">
|
|
34
|
+
<label for="node-input-resolution"><i class="fa fa-cog"></i> Resolution</label>
|
|
35
|
+
<select id="node-input-resolution" style="width:200px">
|
|
36
|
+
<option value="14/14" selected>T 14 bit / RH 14 bit</option>
|
|
37
|
+
<option value="14/11">T 14 bit / RH 11 bit</option>
|
|
38
|
+
<option value="14/8">T 14 bit / RH 8 bit</option>
|
|
39
|
+
<option value="11/14">T 11 bit / RH 14 bit</option>
|
|
40
|
+
<option value="11/11">T 11 bit / RH 11 bit</option>
|
|
41
|
+
<option value="11/8">T 11 bit / RH 8 bit</option>
|
|
42
|
+
</select>
|
|
43
|
+
</div>
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<script type="text/html" data-help-name="periph-hdc1008">
|
|
47
|
+
<p>Reads temperature and relative humidity from a Texas Instruments HDC1008 over I²C (addresses 0x40–0x43)
|
|
48
|
+
with one sequence measurement (temperature then humidity) per message.</p>
|
|
49
|
+
<h3>Inputs</h3>
|
|
50
|
+
<dl class="message-properties">
|
|
51
|
+
<dt>payload <span class="property-type">any</span></dt>
|
|
52
|
+
<dd>Any incoming message triggers one measurement.</dd>
|
|
53
|
+
</dl>
|
|
54
|
+
<h3>Outputs</h3>
|
|
55
|
+
<dl class="message-properties">
|
|
56
|
+
<dt>payload.temperature_c <span class="property-type">number</span></dt>
|
|
57
|
+
<dd>Temperature in °C.</dd>
|
|
58
|
+
<dt>payload.humidity_pct <span class="property-type">number</span></dt>
|
|
59
|
+
<dd>Relative humidity in %RH (0 to 100).</dd>
|
|
60
|
+
</dl>
|
|
61
|
+
<h3>Configuration</h3>
|
|
62
|
+
<p>I²C bus number, I²C address (0x40–0x43) and the temperature / humidity resolution (bits).</p>
|
|
63
|
+
</script>
|