Rework air quliaty interfaces

Removes the indoorairquality and airquality interfaces as the
plugin isn't the right place for these sort of voncersion.
Instead, this PR specifies the individual compounds that
for the base for air quality measurements and ties them down
to export raw data.

It's the client apps responsibility to translate those values
into Air Quality Index scales based on the location of user. I.e.
while Europe would use the CAQI (Common Air Quality Index), the
US would use the EPA AQI etc.
This commit is contained in:
Michael Zanetti 2022-10-10 23:11:36 +02:00
parent b4e396fae9
commit 7c7955b66b
12 changed files with 86 additions and 54 deletions

View File

@ -1,24 +0,0 @@
{
"description": "Air quality sensors. Describes the current quality of the air. As air quality index the PM2.5 measurment (particles pollution level) will be used.",
"extends": "sensor",
"states": [
{
"name": "airQuality",
"type": "QString",
"logged": true,
"possibleValues": [
"Good",
"Moderate",
"Unhealthy for Sensitive Groups",
"Unhealthy",
"Very unhealthy",
"Hazardous"
]
},
{
"name": "airQualityIndex",
"type": "uint",
"logged": true
}
]
}

View File

@ -6,6 +6,8 @@
"name": "co",
"type": "double",
"unit": "PartsPerMillion",
"minValue": 0,
"maxValue": 255,
"logged": true
}
]

View File

@ -1,24 +0,0 @@
{
"description": "Indoor air quality sensors. Describes the current quality of the air in a room. As air quality index the Volatile organic compounds (VOC) measurment will be used.",
"extends": "sensor",
"states": [
{
"name": "indoorAirQuality",
"type": "QString",
"logged": true,
"possibleValues": [
"Excellent",
"Good",
"Moderate",
"Poor",
"Unhealthy"
]
},
{
"name": "voc",
"type": "uint",
"unit": "PartsPerMillion",
"logged": true
}
]
}

View File

@ -45,6 +45,10 @@
<file>cosensor.json</file>
<file>co2sensor.json</file>
<file>o2sensor.json</file>
<file>no2sensor.json</file>
<file>o3sensor.json</file>
<file>pm25sensor.json</file>
<file>pm10sensor.json</file>
<file>gassensor.json</file>
<file>orpsensor.json</file>
<file>conductivitysensor.json</file>
@ -87,8 +91,7 @@
<file>venetianblind.json</file>
<file>update.json</file>
<file>cleaningrobot.json</file>
<file>airquality.json</file>
<file>indoorairquality.json</file>
<file>vocsensor.json</file>
<file>energystorage.json</file>
<file>heatpump.json</file>
<file>smartgridheatpump.json</file>

View File

@ -0,0 +1,14 @@
{
"description": "Interface for nitrogen dioxide sensors. NO2 is measured in µg/m3.",
"extends": "sensor",
"states": [
{
"name": "no2",
"type": "double",
"unit": "MicroGrammPerCubicalMeter",
"minValue": 0,
"maxValue": 800,
"logged": true
}
]
}

View File

@ -0,0 +1,14 @@
{
"extends": "sensor",
"description": "O3 (ozone) sensors. Measures o3 in parts per million.",
"states": [
{
"name": "o3",
"type": "double",
"unit": "MicroGrammPerCubicalMeter",
"minValue": 0,
"maxValue": 500,
"logged": true
}
]
}

View File

@ -0,0 +1,14 @@
{
"extends": "sensor",
"description": "PM10 (Coarse particles) sensors. Measures PM10 particles in µg/m3.",
"states": [
{
"name": "pm10",
"type": "double",
"unit": "MicroGrammPerCubicalMeter",
"minValue": 0,
"maxValue": 500,
"logged": true
}
]
}

View File

@ -0,0 +1,14 @@
{
"extends": "sensor",
"description": "PM2.5 (Fine particles) sensors. Measures PM2.5 particles in µg/m3.",
"states": [
{
"name": "pm25",
"type": "double",
"unit": "MicroGrammPerCubicalMeter",
"minValue": 0,
"maxValue": 500,
"logged": true
}
]
}

View File

@ -0,0 +1,14 @@
{
"description": "Sensor for volatile organic compounds (VOC).",
"extends": "sensor",
"states": [
{
"name": "voc",
"type": "uint",
"unit": "PartsPerBillion",
"minValue": 0,
"maxValue": 65353,
"logged": true
}
]
}

View File

@ -126,6 +126,7 @@ public:
UnitEuroCentPerKiloWattHour,
UnitPercentage,
UnitPartsPerMillion,
UnitPartsPerBillion,
UnitEuro,
UnitDollar,
UnitHertz,
@ -144,6 +145,7 @@ public:
UnitRpm,
UnitMilligramPerLiter,
UnitLiter,
UnitMicroGrammPerCubicalMeter,
};
Q_ENUM(Unit)

View File

@ -5,7 +5,7 @@ NYMEA_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"
# define protocol versions
JSON_PROTOCOL_VERSION_MAJOR=6
JSON_PROTOCOL_VERSION_MINOR=1
JSON_PROTOCOL_VERSION_MINOR=2
JSON_PROTOCOL_VERSION="$${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}"
LIBNYMEA_API_VERSION_MAJOR=7
LIBNYMEA_API_VERSION_MINOR=3

View File

@ -1,4 +1,4 @@
6.1
6.2
{
"enums": {
"BasicType": [
@ -154,7 +154,8 @@
"NetworkManagerErrorWirelessNetworkingDisabled",
"NetworkManagerErrorWirelessConnectionFailed",
"NetworkManagerErrorNetworkingDisabled",
"NetworkManagerErrorNetworkManagerNotAvailable"
"NetworkManagerErrorNetworkManagerNotAvailable",
"NetworkManagerErrorInvalidConfiguration"
],
"NetworkManagerState": [
"NetworkManagerStateUnknown",
@ -339,6 +340,7 @@
"UnitEuroCentPerKiloWattHour",
"UnitPercentage",
"UnitPartsPerMillion",
"UnitPartsPerBillion",
"UnitEuro",
"UnitDollar",
"UnitHertz",
@ -356,7 +358,8 @@
"UnitNewtonMeter",
"UnitRpm",
"UnitMilligramPerLiter",
"UnitLiter"
"UnitLiter",
"UnitMicroGrammPerCubicalMeter"
],
"UserError": [
"UserErrorNoError",