Skip to content

Commit 9225b9b

Browse files
authored
Add SPS30 sensors (#678)
* added sps30 to models and routes * remove logs and bump models version * added sps30 to the documentation
1 parent 99442a9 commit 9225b9b

File tree

10 files changed

+63
-10
lines changed

10 files changed

+63
-10
lines changed

packages/api/lib/controllers/boxesController.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ const getBox = async function getBox (req, res) {
393393
* @apiParam (RequestBody) {Location} location the coordinates of this senseBox.
394394
* @apiParam (RequestBody) {String="homeV2Lora","homeV2Ethernet","homeV2Wifi","homeEthernet","homeWifi","homeEthernetFeinstaub","homeWifiFeinstaub","luftdaten_sds011","luftdaten_sds011_dht11","luftdaten_sds011_dht22","luftdaten_sds011_bmp180","luftdaten_sds011_bme280","hackair_home_v2"} [model] specify the model if you want to use a predefined senseBox model, autocreating sensor definitions.
395395
* @apiParam (RequestBody) {Sensor[]} [sensors] an array containing the sensors of this senseBox. Only use if `model` is unspecified.
396-
* @apiParam (RequestBody) {String[]="hdc1080","bmp280","tsl45315","veml6070","sds011","bme680","smt50","soundlevelmeter","windspeed","scd30","dps310"} [sensorTemplates] Specify which sensors should be included.
396+
* @apiParam (RequestBody) {String[]="hdc1080","bmp280","tsl45315","veml6070","sds011","bme680","smt50","soundlevelmeter","windspeed","scd30","dps310","sps30"} [sensorTemplates] Specify which sensors should be included.
397397
* @apiParam (RequestBody) {Object} [mqtt] specify parameters of the MQTT integration for external measurement upload. Please see below for the accepted parameters
398398
* @apiParam (RequestBody) {Object} [ttn] specify parameters for the TTN integration for measurement from TheThingsNetwork.org upload. Please see below for the accepted parameters
399399
* @apiParam (RequestBody) {Boolean="true","false"} [useAuth] whether to use access_token or not for authentication
@@ -745,6 +745,7 @@ module.exports = {
745745
'windspeed',
746746
'scd30',
747747
'dps310',
748+
'sps30'
748749
],
749750
},
750751
{

packages/models/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
- Added `findLatestMeasurementsForSensorsWithCount` static method to Measurement schema (#588)
2121
- Added `sharedBoxes` functionality (#605)
2222

23+
## v1.3.1
24+
- Add SPS30 sensor
25+
- Update @sensebox/node-sketch-templater to v1.13.0
26+
2327
## v1.2.0
2428

2529
- Extend `luftdatenHandler` (#578)

packages/models/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"@grpc/grpc-js": "^1.3.7",
99
"@grpc/proto-loader": "^0.6.4",
1010
"@sensebox/osem-protos": "^1.1.0",
11-
"@sensebox/sketch-templater": "1.12.1",
11+
"@sensebox/sketch-templater": "1.13.0",
1212
"bcrypt": "^5.1.0",
1313
"config": "^3.3.6",
1414
"got": "^11.8.2",

packages/models/src/box/sensorLayouts/sensebox.home.mcu.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const {
1919
soundlevelmeter,
2020
windspeed,
2121
scd30_co2,
22-
dps310_pressure
22+
dps310_pressure,
23+
sps30_pm1,
24+
sps30_pm25,
25+
sps30_pm4,
26+
sps30_pm10
2327
} = sensorDefinitions;
2428

2529
module.exports = [
@@ -40,4 +44,8 @@ module.exports = [
4044
windspeed,
4145
scd30_co2,
4246
dps310_pressure,
47+
sps30_pm1,
48+
sps30_pm25,
49+
sps30_pm4,
50+
sps30_pm10
4351
];

packages/models/src/box/sensorLayouts/sensorDefinitions/index.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
34
const veml6070_uvintensity = require('./veml6070_uvintensity'),
45
tsl45315_lightintensity = require('./tsl45315_lightintensity'),
56
bmp280_pressure = require('./bmp280_pressure'),
@@ -42,8 +43,11 @@ const veml6070_uvintensity = require('./veml6070_uvintensity'),
4243
windspeed = require('./windspeed'),
4344
scd30_co2 = require('./scd30_co2'),
4445
dps310_temperature = require('./dps310_temperature'),
45-
dps310_pressure = require('./dps310_pressure');
46-
46+
dps310_pressure = require('./dps310_pressure'),
47+
sps30_pm1 = require('./sps30_pm1'),
48+
sps30_pm25 = require('./sps30_pm25'),
49+
sps30_pm4 = require('./sps30_pm4'),
50+
sps30_pm10 = require('./sps30_pm10');
4751
module.exports = {
4852
hdc1008_temperature,
4953
hdc1080_temperature,
@@ -87,5 +91,9 @@ module.exports = {
8791
windspeed,
8892
scd30_co2,
8993
dps310_temperature,
90-
dps310_pressure
94+
dps310_pressure,
95+
sps30_pm1,
96+
sps30_pm25,
97+
sps30_pm4,
98+
sps30_pm10
9199
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
module.exports = {
4+
title: 'PM1',
5+
unit: 'µg/m³',
6+
sensorType: 'SPS30',
7+
icon: 'osem-cloud'
8+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
module.exports = {
4+
title: 'PM10',
5+
unit: 'µg/m³',
6+
sensorType: 'SPS30',
7+
icon: 'osem-cloud'
8+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
module.exports = {
4+
title: 'PM2.5',
5+
unit: 'µg/m³',
6+
sensorType: 'SPS30',
7+
icon: 'osem-cloud'
8+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
module.exports = {
4+
title: 'PM4',
5+
unit: 'µg/m³',
6+
sensorType: 'SPS30',
7+
icon: 'osem-cloud'
8+
};

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@
143143
resolved "https://registry.yarnpkg.com/@sensebox/osem-protos/-/osem-protos-1.1.0.tgz#a7de8bc6be867953f1309181a012063c23299e79"
144144
integrity sha512-H+nUVcWlT0dvIqfJnYHuX9JBcCkP1ZKGE5YTRNWPbAEdZ11h+srpQsmeI58wK5hJcdukaZAjc4Dy96IeGM77aA==
145145

146-
"@sensebox/sketch-templater@1.12.1":
147-
version "1.12.1"
148-
resolved "https://registry.yarnpkg.com/@sensebox/sketch-templater/-/sketch-templater-1.12.1.tgz#4640fc22d5ae652d00b9ab7c590488bf25da2cee"
149-
integrity sha512-LtHyUPsZSFTDIqzSce8Rgh25CRhZkj2NIVjNUrMFeB7WgoNwYJuq+aYr1QDGaL0AkREKL3JsUi+O4rjji3Uw3w==
146+
"@sensebox/sketch-templater@1.13.0":
147+
version "1.13.0"
148+
resolved "https://registry.yarnpkg.com/@sensebox/sketch-templater/-/sketch-templater-1.13.0.tgz#f2af96a67014cb6e7fe1d1f9e48aad433a98e2b2"
149+
integrity sha512-8ZYvXlhrTiVXpD5tuf8nhYCk8iR/uxI5fiYQO9e3mR20aHiVIVlsEI4QysGhVxAsOsgntHD5IOOikpY7XaC2Ig==
150150
dependencies:
151151
config "^3.3.7"
152152
dedent "^0.7.0"

0 commit comments

Comments
 (0)