node-red-contrib-periph-environmental 1.5.1 → 1.5.2
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 +6 -4
- package/examples/am2315/demo.json +10 -4
- package/examples/am2320/demo.json +10 -4
- package/examples/bme280/demo.json +2 -2
- package/examples/bme680/demo.json +2 -2
- package/nodes/am2315/am2315.html +39 -14
- package/nodes/am2315/am2315.js +15 -8
- package/nodes/am2320/am2320.html +39 -14
- package/nodes/am2320/am2320.js +15 -8
- package/nodes/bme280/bme280.html +3 -3
- package/nodes/bme280/bme280.js +1 -1
- package/nodes/bme680/bme680.html +3 -3
- package/nodes/bme680/bme680.js +1 -1
- package/package.json +1 -2
- package/index.js +0 -11
package/README.md
CHANGED
|
@@ -22,12 +22,14 @@ npm install node-red-contrib-periph-environmental
|
|
|
22
22
|
| `aht20` | input | Reads temperature and humidity from an AHT20 environmental sensor over I²C. |
|
|
23
23
|
| `aht21-device` | config | I²C bus and address for an AHT21 |
|
|
24
24
|
| `aht21` | input | Reads temperature and humidity from an AHT21 environmental sensor over I²C. |
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
25
|
+
| `am2315-device` | config | I²C bus and address for an AM2315 |
|
|
26
|
+
| `am2315` | input | Reads temperature and relative humidity from an Aosong AM2315 over I²C (fixed address 0x5C). The sensor sleeps between transactions and returns the result of the previous measurement; the node keeps transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay. Every response is CRC-16 checked. |
|
|
27
|
+
| `am2320-device` | config | I²C bus and address for an AM2320 |
|
|
28
|
+
| `am2320` | input | Reads temperature and relative humidity from an Aosong AM2320 over I²C (fixed address 0x5C). The sensor sleeps between transactions and returns the result of the previous measurement; the node keeps transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay. Every response is CRC-16 checked. |
|
|
27
29
|
| `bme280-device` | config | Bus configuration for a BME280 |
|
|
28
|
-
| `
|
|
30
|
+
| `bme280` | input | Reads temperature, pressure, humidity, altitude, and dew point from a BME280 combined humidity + pressure + temperature sensor. |
|
|
29
31
|
| `bme680-device` | config | Bus configuration for a BME680 |
|
|
30
|
-
| `
|
|
32
|
+
| `bme680` | input | Reads temperature, pressure, humidity, gas resistance, altitude, and dew point from a BME680 4-in-1 environmental sensor. |
|
|
31
33
|
|
|
32
34
|
## Links
|
|
33
35
|
|
|
@@ -30,20 +30,26 @@
|
|
|
30
30
|
]
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
"id": "am2315-device-1",
|
|
35
|
+
"type": "am2315-device",
|
|
36
|
+
"name": "AM2315",
|
|
37
|
+
"address": "0x5C",
|
|
38
|
+
"bus": "1"
|
|
39
|
+
},
|
|
33
40
|
{
|
|
34
41
|
"id": "am2315-node",
|
|
35
|
-
"type": "
|
|
42
|
+
"type": "am2315",
|
|
36
43
|
"z": "am2315-tab",
|
|
37
44
|
"name": "AM2315",
|
|
38
|
-
"bus": "1",
|
|
39
|
-
"address": "0x5C",
|
|
40
45
|
"x": 380,
|
|
41
46
|
"y": 160,
|
|
42
47
|
"wires": [
|
|
43
48
|
[
|
|
44
49
|
"am2315-format"
|
|
45
50
|
]
|
|
46
|
-
]
|
|
51
|
+
],
|
|
52
|
+
"device": "am2315-device-1"
|
|
47
53
|
},
|
|
48
54
|
{
|
|
49
55
|
"id": "am2315-format",
|
|
@@ -30,20 +30,26 @@
|
|
|
30
30
|
]
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
"id": "am2320-device-1",
|
|
35
|
+
"type": "am2320-device",
|
|
36
|
+
"name": "AM2320",
|
|
37
|
+
"address": "0x5C",
|
|
38
|
+
"bus": "1"
|
|
39
|
+
},
|
|
33
40
|
{
|
|
34
41
|
"id": "am2320-node",
|
|
35
|
-
"type": "
|
|
42
|
+
"type": "am2320",
|
|
36
43
|
"z": "am2320-tab",
|
|
37
44
|
"name": "AM2320",
|
|
38
|
-
"bus": "1",
|
|
39
|
-
"address": "0x5C",
|
|
40
45
|
"x": 380,
|
|
41
46
|
"y": 160,
|
|
42
47
|
"wires": [
|
|
43
48
|
[
|
|
44
49
|
"am2320-format"
|
|
45
50
|
]
|
|
46
|
-
]
|
|
51
|
+
],
|
|
52
|
+
"device": "am2320-device-1"
|
|
47
53
|
},
|
|
48
54
|
{
|
|
49
55
|
"id": "am2320-format",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"id": "bme280-read-1",
|
|
17
|
-
"type": "
|
|
17
|
+
"type": "bme280",
|
|
18
18
|
"name": "BME280 Indoor",
|
|
19
19
|
"device": "bme280-device-1",
|
|
20
20
|
"seaLevelHpa": "1013.25",
|
|
@@ -156,6 +156,6 @@
|
|
|
156
156
|
"name": "BME280 Demo",
|
|
157
157
|
"icon": "dashboard",
|
|
158
158
|
"order": 1,
|
|
159
|
-
"info": "This flow demonstrates the BME280 combined humidity + pressure + temperature sensor.\n\nAn inject node fires every 10 seconds into the
|
|
159
|
+
"info": "This flow demonstrates the BME280 combined humidity + pressure + temperature sensor.\n\nAn inject node fires every 10 seconds into the bme280 node. The output goes to a debug node and five ui_chart nodes showing temperature, pressure, humidity, altitude, and dew point over time.\n\nA condensation-alert function node watches the dew-point trace and emits a 'Condensation likely' alert when temperature minus dew point falls below 2 °C — useful for HVAC, greenhouse, and crawl-space monitoring where surface condensation can damage equipment or promote mould.\n\nThe BME280 combines three sensors (BMP280 pressure/temperature plus a humidity front-end) in one package, making it ideal for indoor air quality, weather stations, and HVAC applications where a separate humidity sensor would otherwise be needed."
|
|
160
160
|
}
|
|
161
161
|
]
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"id": "bme680-read-1",
|
|
17
|
-
"type": "
|
|
17
|
+
"type": "bme680",
|
|
18
18
|
"name": "BME680 Air Quality",
|
|
19
19
|
"device": "bme680-device-1",
|
|
20
20
|
"seaLevelHpa": "1013.25",
|
|
@@ -170,6 +170,6 @@
|
|
|
170
170
|
"name": "BME680 Demo",
|
|
171
171
|
"icon": "dashboard",
|
|
172
172
|
"order": 1,
|
|
173
|
-
"info": "This flow demonstrates the BME680 4-in-1 environmental sensor (temperature, pressure, humidity, gas resistance).\n\nAn inject node fires every 10 seconds into the
|
|
173
|
+
"info": "This flow demonstrates the BME680 4-in-1 environmental sensor (temperature, pressure, humidity, gas resistance).\n\nAn inject node fires every 10 seconds into the bme680 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
174
|
}
|
|
175
175
|
]
|
package/nodes/am2315/am2315.html
CHANGED
|
@@ -1,37 +1,62 @@
|
|
|
1
|
+
<!-- Config node: one instance per physical device -->
|
|
1
2
|
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType('
|
|
3
|
-
category:
|
|
4
|
-
color: '#C084FC',
|
|
3
|
+
RED.nodes.registerType('am2315-device', {
|
|
4
|
+
category: 'config',
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: '' },
|
|
7
7
|
bus: { value: '1', required: true, validate: RED.validators.number() },
|
|
8
8
|
address: { value: '0x5C' }
|
|
9
9
|
},
|
|
10
|
-
inputs: 1,
|
|
11
|
-
outputs: 1,
|
|
12
|
-
icon: 'bridge.svg',
|
|
13
10
|
label: function() {
|
|
14
11
|
return this.name || ('AM2315 @ ' + this.address + ' (bus ' + this.bus + ')');
|
|
15
12
|
}
|
|
16
13
|
});
|
|
17
14
|
</script>
|
|
18
15
|
|
|
19
|
-
<script type="text/html" data-template-name="
|
|
16
|
+
<script type="text/html" data-template-name="am2315-device">
|
|
20
17
|
<div class="form-row">
|
|
21
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
22
|
-
<input type="text" id="node-input-name" placeholder="AM2315">
|
|
18
|
+
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
19
|
+
<input type="text" id="node-config-input-name" placeholder="AM2315">
|
|
23
20
|
</div>
|
|
24
21
|
<div class="form-row">
|
|
25
|
-
<label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
|
|
26
|
-
<input type="number" id="node-input-bus" min="0" style="width:80px"> (Linux /dev/i2c-N, standard mode)
|
|
22
|
+
<label for="node-config-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
|
|
23
|
+
<input type="number" id="node-config-input-bus" min="0" style="width:80px"> (Linux /dev/i2c-N, standard mode)
|
|
24
|
+
</div>
|
|
25
|
+
<div class="form-row">
|
|
26
|
+
<label for="node-config-input-address"><i class="fa fa-microchip"></i> I²C address</label>
|
|
27
|
+
<input type="text" id="node-config-input-address" style="width:80px" placeholder="0x5C"> (fixed, 0x5C)
|
|
28
|
+
</div>
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<!-- Read node -->
|
|
32
|
+
<script type="text/javascript">
|
|
33
|
+
RED.nodes.registerType('am2315', {
|
|
34
|
+
category: 'Peripheral',
|
|
35
|
+
color: '#C084FC',
|
|
36
|
+
defaults: {
|
|
37
|
+
name: { value: '' },
|
|
38
|
+
device: { value: '', type: 'am2315-device', required: true }
|
|
39
|
+
},
|
|
40
|
+
inputs: 1,
|
|
41
|
+
outputs: 1,
|
|
42
|
+
icon: 'bridge.svg',
|
|
43
|
+
label: function() { return this.name || 'AM2315'; },
|
|
44
|
+
paletteLabel: 'AM2315'
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<script type="text/html" data-template-name="am2315">
|
|
49
|
+
<div class="form-row">
|
|
50
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
51
|
+
<input type="text" id="node-input-name" placeholder="AM2315">
|
|
27
52
|
</div>
|
|
28
53
|
<div class="form-row">
|
|
29
|
-
<label for="node-input-
|
|
30
|
-
<input type="text" id="node-input-
|
|
54
|
+
<label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
|
|
55
|
+
<input type="text" id="node-input-device">
|
|
31
56
|
</div>
|
|
32
57
|
</script>
|
|
33
58
|
|
|
34
|
-
<script type="text/html" data-help-name="
|
|
59
|
+
<script type="text/html" data-help-name="am2315">
|
|
35
60
|
<p>Reads temperature and relative humidity from an Aosong AM2315 over I²C (fixed address 0x5C). The sensor
|
|
36
61
|
sleeps between transactions and returns the result of the <em>previous</em> measurement; the node keeps
|
|
37
62
|
transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay.
|
package/nodes/am2315/am2315.js
CHANGED
|
@@ -4,7 +4,7 @@ module.exports = function(RED) {
|
|
|
4
4
|
const { I2CConnection } = require('periph/src/connection/i2c');
|
|
5
5
|
const { AM2315Full } = require('periph/src/chips/environmental/am2315');
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function AM2315DeviceNode(config) {
|
|
8
8
|
RED.nodes.createNode(this, config);
|
|
9
9
|
const node = this;
|
|
10
10
|
try {
|
|
@@ -16,17 +16,28 @@ module.exports = function(RED) {
|
|
|
16
16
|
node.error('AM2315 init failed: ' + e.message);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
node.on('close', function() {
|
|
20
|
+
if (node.connection) node.connection.close();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
RED.nodes.registerType('am2315-device', AM2315DeviceNode);
|
|
24
|
+
|
|
25
|
+
function AM2315ReadNode(config) {
|
|
26
|
+
RED.nodes.createNode(this, config);
|
|
27
|
+
const node = this;
|
|
28
|
+
const deviceNode = RED.nodes.getNode(config.device) || {};
|
|
29
|
+
|
|
19
30
|
// Messages are handled one at a time; the driver itself waits the >= 2 s between transactions.
|
|
20
31
|
let queue = Promise.resolve();
|
|
21
32
|
node.on('input', function(msg, send, done) {
|
|
22
|
-
if (!
|
|
33
|
+
if (!deviceNode.driver) {
|
|
23
34
|
node.error('AM2315 not initialised', msg);
|
|
24
35
|
done();
|
|
25
36
|
return;
|
|
26
37
|
}
|
|
27
38
|
queue = queue.then(async () => {
|
|
28
39
|
try {
|
|
29
|
-
msg.payload = await
|
|
40
|
+
msg.payload = await deviceNode.driver.read();
|
|
30
41
|
send(msg);
|
|
31
42
|
done();
|
|
32
43
|
} catch (e) {
|
|
@@ -34,10 +45,6 @@ module.exports = function(RED) {
|
|
|
34
45
|
}
|
|
35
46
|
});
|
|
36
47
|
});
|
|
37
|
-
|
|
38
|
-
node.on('close', function() {
|
|
39
|
-
if (node.connection) node.connection.close();
|
|
40
|
-
});
|
|
41
48
|
}
|
|
42
|
-
RED.nodes.registerType('
|
|
49
|
+
RED.nodes.registerType('am2315', AM2315ReadNode);
|
|
43
50
|
};
|
package/nodes/am2320/am2320.html
CHANGED
|
@@ -1,37 +1,62 @@
|
|
|
1
|
+
<!-- Config node: one instance per physical device -->
|
|
1
2
|
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType('
|
|
3
|
-
category:
|
|
4
|
-
color: '#C084FC',
|
|
3
|
+
RED.nodes.registerType('am2320-device', {
|
|
4
|
+
category: 'config',
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: '' },
|
|
7
7
|
bus: { value: '1', required: true, validate: RED.validators.number() },
|
|
8
8
|
address: { value: '0x5C' }
|
|
9
9
|
},
|
|
10
|
-
inputs: 1,
|
|
11
|
-
outputs: 1,
|
|
12
|
-
icon: 'bridge.svg',
|
|
13
10
|
label: function() {
|
|
14
11
|
return this.name || ('AM2320 @ ' + this.address + ' (bus ' + this.bus + ')');
|
|
15
12
|
}
|
|
16
13
|
});
|
|
17
14
|
</script>
|
|
18
15
|
|
|
19
|
-
<script type="text/html" data-template-name="
|
|
16
|
+
<script type="text/html" data-template-name="am2320-device">
|
|
20
17
|
<div class="form-row">
|
|
21
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
22
|
-
<input type="text" id="node-input-name" placeholder="AM2320">
|
|
18
|
+
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
19
|
+
<input type="text" id="node-config-input-name" placeholder="AM2320">
|
|
23
20
|
</div>
|
|
24
21
|
<div class="form-row">
|
|
25
|
-
<label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
|
|
26
|
-
<input type="number" id="node-input-bus" min="0" style="width:80px"> (Linux /dev/i2c-N, standard mode)
|
|
22
|
+
<label for="node-config-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
|
|
23
|
+
<input type="number" id="node-config-input-bus" min="0" style="width:80px"> (Linux /dev/i2c-N, standard mode)
|
|
24
|
+
</div>
|
|
25
|
+
<div class="form-row">
|
|
26
|
+
<label for="node-config-input-address"><i class="fa fa-microchip"></i> I²C address</label>
|
|
27
|
+
<input type="text" id="node-config-input-address" style="width:80px" placeholder="0x5C"> (fixed, 0x5C)
|
|
28
|
+
</div>
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<!-- Read node -->
|
|
32
|
+
<script type="text/javascript">
|
|
33
|
+
RED.nodes.registerType('am2320', {
|
|
34
|
+
category: 'Peripheral',
|
|
35
|
+
color: '#C084FC',
|
|
36
|
+
defaults: {
|
|
37
|
+
name: { value: '' },
|
|
38
|
+
device: { value: '', type: 'am2320-device', required: true }
|
|
39
|
+
},
|
|
40
|
+
inputs: 1,
|
|
41
|
+
outputs: 1,
|
|
42
|
+
icon: 'bridge.svg',
|
|
43
|
+
label: function() { return this.name || 'AM2320'; },
|
|
44
|
+
paletteLabel: 'AM2320'
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<script type="text/html" data-template-name="am2320">
|
|
49
|
+
<div class="form-row">
|
|
50
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
51
|
+
<input type="text" id="node-input-name" placeholder="AM2320">
|
|
27
52
|
</div>
|
|
28
53
|
<div class="form-row">
|
|
29
|
-
<label for="node-input-
|
|
30
|
-
<input type="text" id="node-input-
|
|
54
|
+
<label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
|
|
55
|
+
<input type="text" id="node-input-device">
|
|
31
56
|
</div>
|
|
32
57
|
</script>
|
|
33
58
|
|
|
34
|
-
<script type="text/html" data-help-name="
|
|
59
|
+
<script type="text/html" data-help-name="am2320">
|
|
35
60
|
<p>Reads temperature and relative humidity from an Aosong AM2320 over I²C (fixed address 0x5C). The sensor
|
|
36
61
|
sleeps between transactions and returns the result of the <em>previous</em> measurement; the node keeps
|
|
37
62
|
transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay.
|
package/nodes/am2320/am2320.js
CHANGED
|
@@ -4,7 +4,7 @@ module.exports = function(RED) {
|
|
|
4
4
|
const { I2CConnection } = require('periph/src/connection/i2c');
|
|
5
5
|
const { AM2320Full } = require('periph/src/chips/environmental/am2320');
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function AM2320DeviceNode(config) {
|
|
8
8
|
RED.nodes.createNode(this, config);
|
|
9
9
|
const node = this;
|
|
10
10
|
try {
|
|
@@ -16,17 +16,28 @@ module.exports = function(RED) {
|
|
|
16
16
|
node.error('AM2320 init failed: ' + e.message);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
node.on('close', function() {
|
|
20
|
+
if (node.connection) node.connection.close();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
RED.nodes.registerType('am2320-device', AM2320DeviceNode);
|
|
24
|
+
|
|
25
|
+
function AM2320ReadNode(config) {
|
|
26
|
+
RED.nodes.createNode(this, config);
|
|
27
|
+
const node = this;
|
|
28
|
+
const deviceNode = RED.nodes.getNode(config.device) || {};
|
|
29
|
+
|
|
19
30
|
// Messages are handled one at a time; the driver itself waits the >= 2 s between transactions.
|
|
20
31
|
let queue = Promise.resolve();
|
|
21
32
|
node.on('input', function(msg, send, done) {
|
|
22
|
-
if (!
|
|
33
|
+
if (!deviceNode.driver) {
|
|
23
34
|
node.error('AM2320 not initialised', msg);
|
|
24
35
|
done();
|
|
25
36
|
return;
|
|
26
37
|
}
|
|
27
38
|
queue = queue.then(async () => {
|
|
28
39
|
try {
|
|
29
|
-
msg.payload = await
|
|
40
|
+
msg.payload = await deviceNode.driver.read();
|
|
30
41
|
send(msg);
|
|
31
42
|
done();
|
|
32
43
|
} catch (e) {
|
|
@@ -34,10 +45,6 @@ module.exports = function(RED) {
|
|
|
34
45
|
}
|
|
35
46
|
});
|
|
36
47
|
});
|
|
37
|
-
|
|
38
|
-
node.on('close', function() {
|
|
39
|
-
if (node.connection) node.connection.close();
|
|
40
|
-
});
|
|
41
48
|
}
|
|
42
|
-
RED.nodes.registerType('
|
|
49
|
+
RED.nodes.registerType('am2320', AM2320ReadNode);
|
|
43
50
|
};
|
package/nodes/bme280/bme280.html
CHANGED
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
<!-- Read node: trigger → measurements -->
|
|
105
105
|
<script type="text/javascript">
|
|
106
|
-
RED.nodes.registerType('
|
|
106
|
+
RED.nodes.registerType('bme280', {
|
|
107
107
|
category: 'Peripheral',
|
|
108
108
|
color: '#C084FC',
|
|
109
109
|
defaults: {
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
});
|
|
120
120
|
</script>
|
|
121
121
|
|
|
122
|
-
<script type="text/html" data-template-name="
|
|
122
|
+
<script type="text/html" data-template-name="bme280">
|
|
123
123
|
<div class="form-row">
|
|
124
124
|
<label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
|
|
125
125
|
<input type="text" id="node-input-device">
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
</div>
|
|
135
135
|
</script>
|
|
136
136
|
|
|
137
|
-
<script type="text/html" data-help-name="
|
|
137
|
+
<script type="text/html" data-help-name="bme280">
|
|
138
138
|
<p>Reads temperature, pressure, humidity, altitude, and dew point
|
|
139
139
|
from a BME280 combined humidity + pressure + temperature sensor.</p>
|
|
140
140
|
<p>Any input message triggers a measurement. The device is configured via a <b>bme280-device</b> config node.</p>
|
package/nodes/bme280/bme280.js
CHANGED
package/nodes/bme680/bme680.html
CHANGED
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
|
|
94
94
|
<!-- Read node: trigger → measurements -->
|
|
95
95
|
<script type="text/javascript">
|
|
96
|
-
RED.nodes.registerType('
|
|
96
|
+
RED.nodes.registerType('bme680', {
|
|
97
97
|
category: 'Peripheral',
|
|
98
98
|
color: '#C084FC',
|
|
99
99
|
defaults: {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
});
|
|
110
110
|
</script>
|
|
111
111
|
|
|
112
|
-
<script type="text/html" data-template-name="
|
|
112
|
+
<script type="text/html" data-template-name="bme680">
|
|
113
113
|
<div class="form-row">
|
|
114
114
|
<label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
|
|
115
115
|
<input type="text" id="node-input-device">
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
</div>
|
|
125
125
|
</script>
|
|
126
126
|
|
|
127
|
-
<script type="text/html" data-help-name="
|
|
127
|
+
<script type="text/html" data-help-name="bme680">
|
|
128
128
|
<p>Reads temperature, pressure, humidity, gas resistance, altitude, and dew point
|
|
129
129
|
from a BME680 4-in-1 environmental sensor.</p>
|
|
130
130
|
<p>Any input message triggers a measurement. The device is configured via a <b>bme680-device</b> config node.</p>
|
package/nodes/bme680/bme680.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-periph-environmental",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Node-RED nodes for environmental sensor chips",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node-red",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"sensor",
|
|
11
11
|
"peripheral"
|
|
12
12
|
],
|
|
13
|
-
"main": "index.js",
|
|
14
13
|
"node-red": {
|
|
15
14
|
"nodes": {
|
|
16
15
|
"aht10": "nodes/aht10/aht10.js",
|
package/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
module.exports = function(RED) {
|
|
5
|
-
const nodesDir = path.join(__dirname, 'nodes');
|
|
6
|
-
if (!fs.existsSync(nodesDir)) return;
|
|
7
|
-
fs.readdirSync(nodesDir).forEach(function(chip) {
|
|
8
|
-
const nodeFile = path.join(nodesDir, chip, chip + '.js');
|
|
9
|
-
if (fs.existsSync(nodeFile)) require(nodeFile)(RED);
|
|
10
|
-
});
|
|
11
|
-
};
|