node-red-contrib-periph-environmental 1.5.3 → 1.6.0
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 +4 -2
- package/examples/bme688/demo.json +175 -0
- package/nodes/bme688/bme688.html +160 -0
- package/nodes/bme688/bme688.js +70 -0
- package/package.json +19 -5
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# node-red-contrib-periph-environmental
|
|
2
2
|
|
|
3
|
-
Node-RED nodes for environmental sensor chips: AHT10, AHT20, AHT21, AM2315, AM2320, BME280, BME680 — part of the [Periph](https://github.com/tuhde/Periph) library.
|
|
3
|
+
Node-RED nodes for environmental sensor chips: AHT10, AHT20, AHT21, AM2315, AM2320, BME280, BME680, BME688 — part of the [Periph](https://github.com/tuhde/Periph) library.
|
|
4
4
|
|
|
5
|
-
**Supported chips (
|
|
5
|
+
**Supported chips (8):** AHT10, AHT20, AHT21, AM2315, AM2320, BME280, BME680, BME688.
|
|
6
6
|
|
|
7
7
|
Each chip has a sensor/actuator node plus a shared `-device` config node that holds the bus settings. Importable example flows are in [`examples/`](https://github.com/tuhde/Periph/tree/main/nodejs/packages/node-red-contrib-periph-environmental/examples).
|
|
8
8
|
|
|
@@ -34,6 +34,8 @@ npm install node-red-contrib-periph-environmental
|
|
|
34
34
|
| `bme280` | input | Reads temperature, pressure, humidity, altitude, and dew point from a BME280 combined humidity + pressure + temperature sensor. |
|
|
35
35
|
| `bme680-device` | config | Bus configuration for a BME680 |
|
|
36
36
|
| `bme680` | input | Reads temperature, pressure, humidity, gas resistance, altitude, and dew point from a BME680 4-in-1 environmental sensor. |
|
|
37
|
+
| `bme688-device` | config | Bus configuration for a BME688 |
|
|
38
|
+
| `bme688` | input | Reads temperature, pressure, humidity, gas resistance, altitude, and dew point from a BME688 4-in-1 environmental sensor. |
|
|
37
39
|
|
|
38
40
|
## Links
|
|
39
41
|
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "bme688-device-1",
|
|
4
|
+
"type": "bme688-device",
|
|
5
|
+
"name": "BME688 @ i2c-1",
|
|
6
|
+
"bus": "1",
|
|
7
|
+
"addr": "0x76",
|
|
8
|
+
"osrsT": "1",
|
|
9
|
+
"osrsP": "1",
|
|
10
|
+
"osrsH": "1",
|
|
11
|
+
"filter": "0",
|
|
12
|
+
"heaterTemp": "320",
|
|
13
|
+
"heaterDur": "150"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "bme688-read-1",
|
|
17
|
+
"type": "bme688",
|
|
18
|
+
"name": "BME688 Air Quality",
|
|
19
|
+
"device": "bme688-device-1",
|
|
20
|
+
"seaLevelHpa": "1013.25",
|
|
21
|
+
"wires": [["debug-1", "chart-temp-1", "chart-pres-1", "chart-hum-1", "chart-gas-1", "chart-alt-1", "chart-dew-1"]]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "inject-timer-1",
|
|
25
|
+
"type": "inject",
|
|
26
|
+
"name": "Every 10 seconds",
|
|
27
|
+
"topic": "",
|
|
28
|
+
"payload": "",
|
|
29
|
+
"payloadType": "date",
|
|
30
|
+
"repeat": "10",
|
|
31
|
+
"crontab": "",
|
|
32
|
+
"onceDelay": "0.1",
|
|
33
|
+
"wires": [["bme688-read-1"]]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "debug-1",
|
|
37
|
+
"type": "debug",
|
|
38
|
+
"name": "Debug output",
|
|
39
|
+
"active": true,
|
|
40
|
+
"tosideuit": false,
|
|
41
|
+
"console": "false",
|
|
42
|
+
"tostatus": "false",
|
|
43
|
+
"complete": "payload",
|
|
44
|
+
"targetType": "msg",
|
|
45
|
+
"x": 480,
|
|
46
|
+
"y": 200,
|
|
47
|
+
"wires": []
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "chart-temp-1",
|
|
51
|
+
"type": "ui_chart",
|
|
52
|
+
"name": "Temperature",
|
|
53
|
+
"group": "bme688-group-1",
|
|
54
|
+
"order": 1,
|
|
55
|
+
"width": 6,
|
|
56
|
+
"height": 4,
|
|
57
|
+
"label": "Temperature (°C)",
|
|
58
|
+
"chartType": "line",
|
|
59
|
+
"x": 480,
|
|
60
|
+
"y": 260,
|
|
61
|
+
"wires": []
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "chart-pres-1",
|
|
65
|
+
"type": "ui_chart",
|
|
66
|
+
"name": "Pressure",
|
|
67
|
+
"group": "bme688-group-1",
|
|
68
|
+
"order": 2,
|
|
69
|
+
"width": 6,
|
|
70
|
+
"height": 4,
|
|
71
|
+
"label": "Pressure (hPa)",
|
|
72
|
+
"chartType": "line",
|
|
73
|
+
"x": 480,
|
|
74
|
+
"y": 320,
|
|
75
|
+
"wires": []
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "chart-hum-1",
|
|
79
|
+
"type": "ui_chart",
|
|
80
|
+
"name": "Humidity",
|
|
81
|
+
"group": "bme688-group-1",
|
|
82
|
+
"order": 3,
|
|
83
|
+
"width": 6,
|
|
84
|
+
"height": 4,
|
|
85
|
+
"label": "Humidity (%RH)",
|
|
86
|
+
"chartType": "line",
|
|
87
|
+
"x": 480,
|
|
88
|
+
"y": 380,
|
|
89
|
+
"wires": []
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "chart-gas-1",
|
|
93
|
+
"type": "ui_chart",
|
|
94
|
+
"name": "Gas Resistance",
|
|
95
|
+
"group": "bme688-group-1",
|
|
96
|
+
"order": 4,
|
|
97
|
+
"width": 6,
|
|
98
|
+
"height": 4,
|
|
99
|
+
"label": "Gas Resistance (Ohm)",
|
|
100
|
+
"chartType": "line",
|
|
101
|
+
"x": 480,
|
|
102
|
+
"y": 440,
|
|
103
|
+
"wires": []
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "chart-alt-1",
|
|
107
|
+
"type": "ui_chart",
|
|
108
|
+
"name": "Altitude",
|
|
109
|
+
"group": "bme688-group-1",
|
|
110
|
+
"order": 5,
|
|
111
|
+
"width": 6,
|
|
112
|
+
"height": 4,
|
|
113
|
+
"label": "Altitude (m)",
|
|
114
|
+
"chartType": "line",
|
|
115
|
+
"x": 480,
|
|
116
|
+
"y": 500,
|
|
117
|
+
"wires": []
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "chart-dew-1",
|
|
121
|
+
"type": "ui_chart",
|
|
122
|
+
"name": "Dew Point",
|
|
123
|
+
"group": "bme688-group-1",
|
|
124
|
+
"order": 6,
|
|
125
|
+
"width": 6,
|
|
126
|
+
"height": 4,
|
|
127
|
+
"label": "Dew Point (°C)",
|
|
128
|
+
"chartType": "line",
|
|
129
|
+
"x": 480,
|
|
130
|
+
"y": 560,
|
|
131
|
+
"wires": []
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "voc-alert-1",
|
|
135
|
+
"type": "function",
|
|
136
|
+
"name": "VOC Alert",
|
|
137
|
+
"func": "var readings = context.get('readings') || [];\nreadings.push(msg.payload.gas_resistance);\nif (readings.length > 144) readings.shift();\ncontext.set('readings', readings);\nif (readings.length >= 10 && msg.payload.gas_resistance !== null) {\n var sorted = readings.slice().sort(function(a,b){return a-b;});\n var median = sorted[Math.floor(sorted.length/2)];\n if (msg.payload.gas_resistance < median * 0.8) {\n msg.payload = 'VOC concentration rising: ' + msg.payload.gas_resistance.toFixed(0) + ' Ohm (median: ' + median.toFixed(0) + ')';\n return msg;\n }\n}\nreturn null;",
|
|
138
|
+
"outputs": 1,
|
|
139
|
+
"noerr": 0,
|
|
140
|
+
"x": 480,
|
|
141
|
+
"y": 620,
|
|
142
|
+
"wires": [["debug-voc-1"]]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "debug-voc-1",
|
|
146
|
+
"type": "debug",
|
|
147
|
+
"name": "VOC Alert",
|
|
148
|
+
"active": true,
|
|
149
|
+
"tosideuit": false,
|
|
150
|
+
"console": "false",
|
|
151
|
+
"tostatus": "false",
|
|
152
|
+
"complete": "payload",
|
|
153
|
+
"targetType": "msg",
|
|
154
|
+
"x": 660,
|
|
155
|
+
"y": 620,
|
|
156
|
+
"wires": []
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "bme688-group-1",
|
|
160
|
+
"type": "ui_group",
|
|
161
|
+
"name": "BME688 Air Quality",
|
|
162
|
+
"tab": "bme688-tab-1",
|
|
163
|
+
"order": 1,
|
|
164
|
+
"disp": true,
|
|
165
|
+
"width": 12
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"id": "bme688-tab-1",
|
|
169
|
+
"type": "ui_tab",
|
|
170
|
+
"name": "BME688 Demo",
|
|
171
|
+
"icon": "dashboard",
|
|
172
|
+
"order": 1,
|
|
173
|
+
"info": "This flow demonstrates the BME688 4-in-1 environmental sensor (temperature, pressure, humidity, gas resistance).\n\nAn inject node fires every 10 seconds into the bme688 node. The output goes to a debug node and six ui_chart nodes showing temperature, pressure, humidity, gas resistance, altitude, and dew point.\n\nA VOC alert function node watches the gas-resistance trace — a sustained drop below 80% of the running 24-hour median triggers a \"VOC concentration rising\" alert. This demonstrates that even the raw uncalibrated gas reading is useful as a relative VOC indicator without the closed-source BSEC library.\n\nGas resistance drops when VOCs (isopropyl alcohol, marker pen fumes, cooking) are present near the sensor and recovers as the air clears."
|
|
174
|
+
}
|
|
175
|
+
]
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<!-- Config node: one instance per physical device -->
|
|
2
|
+
<script type="text/javascript">
|
|
3
|
+
RED.nodes.registerType('bme688-device', {
|
|
4
|
+
category: 'config',
|
|
5
|
+
defaults: {
|
|
6
|
+
name: { value: '' },
|
|
7
|
+
bus: { value: '1', required: true, validate: RED.validators.number() },
|
|
8
|
+
addr: { value: '0x76', required: true },
|
|
9
|
+
osrsT: { value: '1', required: true, validate: RED.validators.number() },
|
|
10
|
+
osrsP: { value: '1', required: true, validate: RED.validators.number() },
|
|
11
|
+
osrsH: { value: '1', required: true, validate: RED.validators.number() },
|
|
12
|
+
filter: { value: '0', required: true, validate: RED.validators.number() },
|
|
13
|
+
heaterTemp: { value: '320', required: true, validate: RED.validators.number() },
|
|
14
|
+
heaterDur: { value: '150', required: true, validate: RED.validators.number() }
|
|
15
|
+
},
|
|
16
|
+
label: function() {
|
|
17
|
+
return this.name || ('BME688 @ ' + this.addr + ' (bus ' + this.bus + ')');
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script type="text/html" data-template-name="bme688-device">
|
|
23
|
+
<div class="form-row">
|
|
24
|
+
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
25
|
+
<input type="text" id="node-config-input-name" placeholder="BME688">
|
|
26
|
+
</div>
|
|
27
|
+
<div class="form-row">
|
|
28
|
+
<label for="node-config-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
|
|
29
|
+
<input type="number" id="node-config-input-bus" min="0" style="width:80px"> (Linux /dev/i2c-N)
|
|
30
|
+
</div>
|
|
31
|
+
<div class="form-row">
|
|
32
|
+
<label for="node-config-input-addr"><i class="fa fa-microchip"></i> I²C address</label>
|
|
33
|
+
<select id="node-config-input-addr" style="width:100px">
|
|
34
|
+
<option value="0x76">0x76 (SDO=GND)</option>
|
|
35
|
+
<option value="0x77">0x77 (SDO=VDDIO)</option>
|
|
36
|
+
</select>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="form-row">
|
|
39
|
+
<label for="node-config-input-osrsT">Temperature oversampling</label>
|
|
40
|
+
<select id="node-config-input-osrsT" style="width:180px">
|
|
41
|
+
<option value="0">Skip</option>
|
|
42
|
+
<option value="1" selected>×1</option>
|
|
43
|
+
<option value="2">×2</option>
|
|
44
|
+
<option value="3">×4</option>
|
|
45
|
+
<option value="4">×8</option>
|
|
46
|
+
<option value="5">×16</option>
|
|
47
|
+
</select>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="form-row">
|
|
50
|
+
<label for="node-config-input-osrsP">Pressure oversampling</label>
|
|
51
|
+
<select id="node-config-input-osrsP" style="width:180px">
|
|
52
|
+
<option value="0">Skip</option>
|
|
53
|
+
<option value="1" selected>×1</option>
|
|
54
|
+
<option value="2">×2</option>
|
|
55
|
+
<option value="3">×4</option>
|
|
56
|
+
<option value="4">×8</option>
|
|
57
|
+
<option value="5">×16</option>
|
|
58
|
+
</select>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="form-row">
|
|
61
|
+
<label for="node-config-input-osrsH">Humidity oversampling</label>
|
|
62
|
+
<select id="node-config-input-osrsH" style="width:180px">
|
|
63
|
+
<option value="0">Skip</option>
|
|
64
|
+
<option value="1" selected>×1</option>
|
|
65
|
+
<option value="2">×2</option>
|
|
66
|
+
<option value="3">×4</option>
|
|
67
|
+
<option value="4">×8</option>
|
|
68
|
+
<option value="5">×16</option>
|
|
69
|
+
</select>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="form-row">
|
|
72
|
+
<label for="node-config-input-filter">IIR filter coefficient</label>
|
|
73
|
+
<select id="node-config-input-filter" style="width:180px">
|
|
74
|
+
<option value="0" selected>Off</option>
|
|
75
|
+
<option value="1">1</option>
|
|
76
|
+
<option value="2">3</option>
|
|
77
|
+
<option value="3">7</option>
|
|
78
|
+
<option value="4">15</option>
|
|
79
|
+
<option value="5">31</option>
|
|
80
|
+
<option value="6">63</option>
|
|
81
|
+
<option value="7">127</option>
|
|
82
|
+
</select>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="form-row">
|
|
85
|
+
<label for="node-config-input-heaterTemp">Heater target (°C)</label>
|
|
86
|
+
<input type="number" id="node-config-input-heaterTemp" min="200" max="400" style="width:80px">
|
|
87
|
+
</div>
|
|
88
|
+
<div class="form-row">
|
|
89
|
+
<label for="node-config-input-heaterDur">Heater duration (ms)</label>
|
|
90
|
+
<input type="number" id="node-config-input-heaterDur" min="1" max="4032" style="width:80px">
|
|
91
|
+
</div>
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<!-- Read node: trigger → measurements -->
|
|
95
|
+
<script type="text/javascript">
|
|
96
|
+
RED.nodes.registerType('bme688', {
|
|
97
|
+
category: 'Peripheral',
|
|
98
|
+
color: '#C084FC',
|
|
99
|
+
defaults: {
|
|
100
|
+
name: { value: '' },
|
|
101
|
+
device: { value: '', type: 'bme688-device', required: true },
|
|
102
|
+
seaLevelHpa: { value: '1013.25' }
|
|
103
|
+
},
|
|
104
|
+
inputs: 1,
|
|
105
|
+
outputs: 1,
|
|
106
|
+
icon: 'font-awesome/fa-tachometer',
|
|
107
|
+
label: function() { return this.name || 'BME688'; },
|
|
108
|
+
paletteLabel: 'BME688'
|
|
109
|
+
});
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<script type="text/html" data-template-name="bme688">
|
|
113
|
+
<div class="form-row">
|
|
114
|
+
<label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
|
|
115
|
+
<input type="text" id="node-input-device">
|
|
116
|
+
</div>
|
|
117
|
+
<div class="form-row">
|
|
118
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
119
|
+
<input type="text" id="node-input-name" placeholder="BME688">
|
|
120
|
+
</div>
|
|
121
|
+
<div class="form-row">
|
|
122
|
+
<label for="node-input-seaLevelHpa">Sea-level pressure (hPa)</label>
|
|
123
|
+
<input type="number" id="node-input-seaLevelHpa" min="800" max="1100" step="0.01" style="width:100px">
|
|
124
|
+
</div>
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
<script type="text/html" data-help-name="bme688">
|
|
128
|
+
<p>Reads temperature, pressure, humidity, gas resistance, altitude, and dew point
|
|
129
|
+
from a BME688 4-in-1 environmental sensor.</p>
|
|
130
|
+
<p>Any input message triggers a measurement. The device is configured via a <b>bme688-device</b> config node.</p>
|
|
131
|
+
|
|
132
|
+
<h3>Inputs</h3>
|
|
133
|
+
<dl class="message-properties">
|
|
134
|
+
<dt>payload <span class="property-type">any</span></dt>
|
|
135
|
+
<dd>Any incoming message triggers a measurement.</dd>
|
|
136
|
+
</dl>
|
|
137
|
+
|
|
138
|
+
<h3>Outputs</h3>
|
|
139
|
+
<dl class="message-properties">
|
|
140
|
+
<dt>payload.temperature <span class="property-type">number</span></dt>
|
|
141
|
+
<dd>Temperature in degrees Celsius.</dd>
|
|
142
|
+
<dt>payload.pressure <span class="property-type">number</span></dt>
|
|
143
|
+
<dd>Pressure in hPa.</dd>
|
|
144
|
+
<dt>payload.humidity <span class="property-type">number</span></dt>
|
|
145
|
+
<dd>Relative humidity in %RH.</dd>
|
|
146
|
+
<dt>payload.gas_resistance <span class="property-type">number | null</span></dt>
|
|
147
|
+
<dd>Gas sensor resistance in Ohms, or null if the reading was invalid.</dd>
|
|
148
|
+
<dt>payload.altitude <span class="property-type">number</span></dt>
|
|
149
|
+
<dd>Altitude in metres computed from the configured sea-level pressure.</dd>
|
|
150
|
+
<dt>payload.dew_point <span class="property-type">number</span></dt>
|
|
151
|
+
<dd>Dew point in degrees Celsius (Magnus-Tetens approximation).</dd>
|
|
152
|
+
</dl>
|
|
153
|
+
|
|
154
|
+
<h3>Configuration</h3>
|
|
155
|
+
<p>Set the I²C bus number, I²C address (<code>0x76</code> or <code>0x77</code>),
|
|
156
|
+
temperature, pressure, and humidity oversampling, IIR filter coefficient,
|
|
157
|
+
heater target temperature and duration in the device config node.
|
|
158
|
+
The sea-level reference pressure defaults to <code>1013.25</code> hPa and can be
|
|
159
|
+
adjusted in the read node config panel.</p>
|
|
160
|
+
</script>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = function(RED) {
|
|
4
|
+
const { I2CConnection } = require('periph/src/connection/i2c');
|
|
5
|
+
const { BME688Full } = require('periph/src/chips/environmental/bme688');
|
|
6
|
+
|
|
7
|
+
function BME688DeviceNode(config) {
|
|
8
|
+
RED.nodes.createNode(this, config);
|
|
9
|
+
const node = this;
|
|
10
|
+
try {
|
|
11
|
+
const addr = parseInt(config.addr) || 0x76;
|
|
12
|
+
const connection = new I2CConnection(parseInt(config.bus), addr);
|
|
13
|
+
node.driver = new BME688Full(connection);
|
|
14
|
+
node.driver.configure(
|
|
15
|
+
parseInt(config.osrsT) || 1,
|
|
16
|
+
parseInt(config.osrsP) || 1,
|
|
17
|
+
parseInt(config.osrsH) || 1,
|
|
18
|
+
1,
|
|
19
|
+
parseInt(config.filter) || 0
|
|
20
|
+
);
|
|
21
|
+
node.driver.setHeater(
|
|
22
|
+
parseInt(config.heaterTemp) || 320,
|
|
23
|
+
parseInt(config.heaterDur) || 150
|
|
24
|
+
);
|
|
25
|
+
node.connection = connection;
|
|
26
|
+
} catch (e) {
|
|
27
|
+
node.error('BME688 init failed: ' + e.message);
|
|
28
|
+
}
|
|
29
|
+
node.on('close', function() {
|
|
30
|
+
if (node.connection) node.connection.close();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
RED.nodes.registerType('bme688-device', BME688DeviceNode);
|
|
34
|
+
|
|
35
|
+
function BME688ReadNode(config) {
|
|
36
|
+
RED.nodes.createNode(this, config);
|
|
37
|
+
const node = this;
|
|
38
|
+
node.device = RED.nodes.getNode(config.device);
|
|
39
|
+
|
|
40
|
+
node.on('input', async function(msg, send, done) {
|
|
41
|
+
if (!node.device || !node.device.driver) {
|
|
42
|
+
node.error('No BME688 device configured', msg);
|
|
43
|
+
done();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const d = node.device.driver;
|
|
48
|
+
const r = await d.readAll();
|
|
49
|
+
const seaLevelHpa = parseFloat(config.seaLevelHpa) || 1013.25;
|
|
50
|
+
const altitude = 44330 * (1 - Math.pow(r.pressure / seaLevelHpa, 1 / 5.255));
|
|
51
|
+
const a = 17.62, b = 243.12;
|
|
52
|
+
const gamma = Math.log(r.humidity / 100) + (a * r.temperature) / (b + r.temperature);
|
|
53
|
+
const dewPoint = (b * gamma) / (a - gamma);
|
|
54
|
+
msg.payload = {
|
|
55
|
+
temperature: r.temperature,
|
|
56
|
+
pressure: r.pressure,
|
|
57
|
+
humidity: r.humidity,
|
|
58
|
+
gas_resistance: isNaN(r.gasResistance) ? null : r.gasResistance,
|
|
59
|
+
altitude: altitude,
|
|
60
|
+
dew_point: dewPoint
|
|
61
|
+
};
|
|
62
|
+
send(msg);
|
|
63
|
+
done();
|
|
64
|
+
} catch (e) {
|
|
65
|
+
done(e);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
RED.nodes.registerType('bme688', BME688ReadNode);
|
|
70
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-periph-environmental",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Node-RED nodes for environmental sensor chips: AHT10, AHT20, AHT21, AM2315, AM2320, BME280, BME680",
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "Node-RED nodes for environmental sensor chips: AHT10, AHT20, AHT21, AM2315, AM2320, BME280, BME680, BME688",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node-red",
|
|
7
7
|
"environmental",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"am2315",
|
|
17
17
|
"am2320",
|
|
18
18
|
"bme280",
|
|
19
|
-
"bme680"
|
|
19
|
+
"bme680",
|
|
20
|
+
"bme688"
|
|
20
21
|
],
|
|
21
22
|
"node-red": {
|
|
22
23
|
"version": ">=3.0.0",
|
|
@@ -27,11 +28,24 @@
|
|
|
27
28
|
"am2315": "nodes/am2315/am2315.js",
|
|
28
29
|
"am2320": "nodes/am2320/am2320.js",
|
|
29
30
|
"bme280": "nodes/bme280/bme280.js",
|
|
30
|
-
"bme680": "nodes/bme680/bme680.js"
|
|
31
|
+
"bme680": "nodes/bme680/bme680.js",
|
|
32
|
+
"bme688": "nodes/bme688/bme688.js"
|
|
31
33
|
}
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
36
|
"periph": "*"
|
|
35
37
|
},
|
|
36
|
-
"license": "MIT"
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/tuhde/Periph/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/tuhde/Periph/tree/main/nodejs/packages/node-red-contrib-periph-environmental#readme",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/tuhde/Periph.git",
|
|
49
|
+
"directory": "nodejs/packages/node-red-contrib-periph-environmental"
|
|
50
|
+
}
|
|
37
51
|
}
|