Skip to content

Commit

Permalink
Add SPS30 sensors (#678)
Browse files Browse the repository at this point in the history
* added sps30 to models and routes

* remove logs and bump models version

* added sps30 to the documentation
  • Loading branch information
Thiemann96 authored Feb 7, 2023
1 parent 99442a9 commit 9225b9b
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 10 deletions.
3 changes: 2 additions & 1 deletion packages/api/lib/controllers/boxesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ const getBox = async function getBox (req, res) {
* @apiParam (RequestBody) {Location} location the coordinates of this senseBox.
* @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.
* @apiParam (RequestBody) {Sensor[]} [sensors] an array containing the sensors of this senseBox. Only use if `model` is unspecified.
* @apiParam (RequestBody) {String[]="hdc1080","bmp280","tsl45315","veml6070","sds011","bme680","smt50","soundlevelmeter","windspeed","scd30","dps310"} [sensorTemplates] Specify which sensors should be included.
* @apiParam (RequestBody) {String[]="hdc1080","bmp280","tsl45315","veml6070","sds011","bme680","smt50","soundlevelmeter","windspeed","scd30","dps310","sps30"} [sensorTemplates] Specify which sensors should be included.
* @apiParam (RequestBody) {Object} [mqtt] specify parameters of the MQTT integration for external measurement upload. Please see below for the accepted parameters
* @apiParam (RequestBody) {Object} [ttn] specify parameters for the TTN integration for measurement from TheThingsNetwork.org upload. Please see below for the accepted parameters
* @apiParam (RequestBody) {Boolean="true","false"} [useAuth] whether to use access_token or not for authentication
Expand Down Expand Up @@ -745,6 +745,7 @@ module.exports = {
'windspeed',
'scd30',
'dps310',
'sps30'
],
},
{
Expand Down
4 changes: 4 additions & 0 deletions packages/models/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
- Added `findLatestMeasurementsForSensorsWithCount` static method to Measurement schema (#588)
- Added `sharedBoxes` functionality (#605)

## v1.3.1
- Add SPS30 sensor
- Update @sensebox/node-sketch-templater to v1.13.0

## v1.2.0

- Extend `luftdatenHandler` (#578)
Expand Down
2 changes: 1 addition & 1 deletion packages/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@grpc/grpc-js": "^1.3.7",
"@grpc/proto-loader": "^0.6.4",
"@sensebox/osem-protos": "^1.1.0",
"@sensebox/sketch-templater": "1.12.1",
"@sensebox/sketch-templater": "1.13.0",
"bcrypt": "^5.1.0",
"config": "^3.3.6",
"got": "^11.8.2",
Expand Down
10 changes: 9 additions & 1 deletion packages/models/src/box/sensorLayouts/sensebox.home.mcu.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ const {
soundlevelmeter,
windspeed,
scd30_co2,
dps310_pressure
dps310_pressure,
sps30_pm1,
sps30_pm25,
sps30_pm4,
sps30_pm10
} = sensorDefinitions;

module.exports = [
Expand All @@ -40,4 +44,8 @@ module.exports = [
windspeed,
scd30_co2,
dps310_pressure,
sps30_pm1,
sps30_pm25,
sps30_pm4,
sps30_pm10
];
14 changes: 11 additions & 3 deletions packages/models/src/box/sensorLayouts/sensorDefinitions/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';


const veml6070_uvintensity = require('./veml6070_uvintensity'),
tsl45315_lightintensity = require('./tsl45315_lightintensity'),
bmp280_pressure = require('./bmp280_pressure'),
Expand Down Expand Up @@ -42,8 +43,11 @@ const veml6070_uvintensity = require('./veml6070_uvintensity'),
windspeed = require('./windspeed'),
scd30_co2 = require('./scd30_co2'),
dps310_temperature = require('./dps310_temperature'),
dps310_pressure = require('./dps310_pressure');

dps310_pressure = require('./dps310_pressure'),
sps30_pm1 = require('./sps30_pm1'),
sps30_pm25 = require('./sps30_pm25'),
sps30_pm4 = require('./sps30_pm4'),
sps30_pm10 = require('./sps30_pm10');
module.exports = {
hdc1008_temperature,
hdc1080_temperature,
Expand Down Expand Up @@ -87,5 +91,9 @@ module.exports = {
windspeed,
scd30_co2,
dps310_temperature,
dps310_pressure
dps310_pressure,
sps30_pm1,
sps30_pm25,
sps30_pm4,
sps30_pm10
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports = {
title: 'PM1',
unit: 'µg/m³',
sensorType: 'SPS30',
icon: 'osem-cloud'
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports = {
title: 'PM10',
unit: 'µg/m³',
sensorType: 'SPS30',
icon: 'osem-cloud'
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports = {
title: 'PM2.5',
unit: 'µg/m³',
sensorType: 'SPS30',
icon: 'osem-cloud'
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports = {
title: 'PM4',
unit: 'µg/m³',
sensorType: 'SPS30',
icon: 'osem-cloud'
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@
resolved "https://registry.yarnpkg.com/@sensebox/osem-protos/-/osem-protos-1.1.0.tgz#a7de8bc6be867953f1309181a012063c23299e79"
integrity sha512-H+nUVcWlT0dvIqfJnYHuX9JBcCkP1ZKGE5YTRNWPbAEdZ11h+srpQsmeI58wK5hJcdukaZAjc4Dy96IeGM77aA==

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

0 comments on commit 9225b9b

Please sign in to comment.