]> git.basschouten.com Git - openhab-addons.git/commitdiff
[airq] Add health/performance channels in percent, add UoM, refine unit hints and...
authorFabian Wolter <github@fabian-wolter.de>
Wed, 1 May 2024 17:51:22 +0000 (19:51 +0200)
committerGitHub <noreply@github.com>
Wed, 1 May 2024 17:51:22 +0000 (19:51 +0200)
Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
bundles/org.openhab.binding.airq/README.md
bundles/org.openhab.binding.airq/src/main/java/org/openhab/binding/airq/internal/AirqHandler.java
bundles/org.openhab.binding.airq/src/main/resources/OH-INF/i18n/airq.properties
bundles/org.openhab.binding.airq/src/main/resources/OH-INF/thing/thing-types.xml
bundles/org.openhab.binding.airq/src/main/resources/OH-INF/update/update.xml

index 82dc2fb3311244c24cff0983563d03e92924f12a..6466a485b4c5961ac0fc6f2ff95c2f7fc4514e22 100644 (file)
@@ -53,26 +53,28 @@ The rw column is empty if the channel is only readable, w if the channel can be
 | fineDustCnt02_5           | Number:Dimensionless |    | Fine Dust >2,5 µm                                                   |
 | fineDustCnt05             | Number:Dimensionless |    | Fine Dust >5 µm                                                     |
 | fineDustCnt10             | Number:Dimensionless |    | Fine Dust >10 µm                                                    |
-| co                        | Number               |    | CO concentration                                                    |
-| co2                       | Number:Dimensionless |    | CO₂ concentration                                                   |
+| co                        | Number:Density       |    | Carbon monoxide (CO) concentration                                  |
+| co2                       | Number:Dimensionless |    | Carbon dioxide (CO₂) concentration                                  |
 | dCO2dt                    | Number               |    | Change of CO₂ concentration                                         |
 | dHdt                      | Number               |    | Change of Humidity                                                  |
 | dewpt                     | Number:Temperature   |    | Dew Point                                                           |
 | doorEvent                 | Number               |    | Door Event (experimental, might not work reliably)                  |
 | h2s                       | Number:Density       |    | Hydrogen sulfide (H₂S)                                              |
+| healthIndex               | Number:Dimensionless |    | Health Index in percent                                             |
 | health                    | Number:Dimensionless |    | Health Index (0 to 1000, -200 for gas alarm, -800 for fire alarm)   |
 | humidityRelative          | Number:Dimensionless |    | Humidity in percent                                                 |
-| humidityAbsolute          | Number               |    | Absolute Humidity                                                   |
+| humidityAbsolute          | Number:Density       |    | Absolute Humidity                                                   |
 | measureTime               | Number:Time          |    | Milliseconds needed for measurement                                 |
-| no2                       | Number               |    | NO₂ concentration                                                   |
-| o3                        | Number               |    | Ozone (O₃) concentration                                            |
+| no2                       | Number:Density       |    | Nitrogen Dioxide (NO₂) concentration                                |
+| o3                        | Number:Density       |    | Ozone (O₃) concentration                                            |
 | o2                        | Number:Dimensionless |    | Oxygen (O₂) concentration                                           |
+| performanceIndex          | Number:Dimensionless |    | Performance Index in percent                                        |
 | performance               | Number:Dimensionless |    | Performance Index (0 to 1000)                                       |
 | fineDustConc01            | Number               |    | Fine Dust concentration >1 µm                                       |
 | fineDustConc02_5          | Number               |    | Fine Dust concentration >2.5 µm                                     |
 | fineDustConc10            | Number               |    | Fine Dust concentration >10 µm                                      |
-| pressure                  | Number:Pressure      |    | Pressure                                                            |
-| so2                       | Number               |    | SO₂ concentration                                                   |
+| pressure                  | Number:Pressure      |    | Barometric Pressure                                                 |
+| so2                       | Number               |    | Sulfur dioxide (SO₂) concentration                                  |
 | sound                     | Number:Dimensionless |    | Noise                                                               |
 | temperature               | Number:Temperature   |    | Temperature                                                         |
 | timestamp                 | DateTime             |    | Timestamp of measurement                                            |
index e4334788abd5662efa09767a06921327005d5b32..a293a62f7d809bbf64063287ae0cfdaa9b827f84 100644 (file)
@@ -488,8 +488,10 @@ public class AirqHandler extends BaseThingHandler {
             processType(decObj, "dCO2dt", "dCO2dt", "number");
             processType(decObj, "dHdt", "dHdt", "number");
             processType(decObj, "door_event", "doorEvent", "number");
+            processType(decObj, "health", "healthIndex", "index");
             processType(decObj, "health", "health", "number");
             processType(decObj, "measuretime", "measureTime", "number");
+            processType(decObj, "performance", "performanceIndex", "index");
             processType(decObj, "performance", "performance", "number");
             processType(decObj, "timestamp", "timestamp", "datetime");
             processType(decObj, "uptime", "uptime", "numberTimePeriod");
@@ -626,6 +628,10 @@ public class AirqHandler extends BaseThingHandler {
                     updateState(channelName, new QuantityType<>(pairDB.getValue(), Units.DECIBEL));
                     updateState(channelName + "_maxerr", new DecimalType(pairDB.getMaxdev()));
                     break;
+                case "index":
+                    double rawValue = Double.parseDouble(dec.get(airqName).toString());
+                    updateState(channelName, new QuantityType<>(rawValue / 10, Units.PERCENT));
+                    break;
                 case "datetime":
                     Long timest = Long.valueOf(dec.get(airqName).toString());
                     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
index 69266f327f0257d719da6e11fa7c453d8bd1aaad..a316c648dddcff383585c8c9e38524c7308d15cd 100644 (file)
@@ -44,20 +44,20 @@ channel-type.airq.WarmupPhase.label = Send data as in Warmup Phase
 channel-type.airq.Wifi.label = Use WLAN
 channel-type.airq.WifiInfo.label = Show WLAN Status with LED
 channel-type.airq.cloudUpload.label = Upload to air-Q Cloud
-channel-type.airq.cnt0_3.label = Fine Dust >0,3 μm
+channel-type.airq.cnt0_3.label = Fine Dust Count 0.3μm
 channel-type.airq.cnt0_3_maxerr.label = Max. Error Fine Dust >0,3μm
-channel-type.airq.cnt0_5.label = Fine Dust >0,5 μm
+channel-type.airq.cnt0_5.label = Fine Dust Count 0.5 μm
 channel-type.airq.cnt0_5_maxerr.label = Max. Error Fine Dust >0,5μm
-channel-type.airq.cnt1.label = Fine Dust >1 μm
-channel-type.airq.cnt10.label = Fine Dust >10 μm
+channel-type.airq.cnt1.label = Fine Dust Count 1μm
+channel-type.airq.cnt10.label = Fine Dust Count 10μm
 channel-type.airq.cnt10_maxerr.label = Max. Error Fine Dust >10μm
 channel-type.airq.cnt1_maxerr.label = Max. Error Fine Dust >1μm
-channel-type.airq.cnt2_5.label = Fine Dust >2,5 μm
+channel-type.airq.cnt2_5.label = Fine Dust Count 2.5μm
 channel-type.airq.cnt2_5_maxerr.label = Max. Error Fine Dust >2,5μm
-channel-type.airq.cnt5.label = Fine Dust >5 μm
+channel-type.airq.cnt5.label = Fine Dust Count 5μm
 channel-type.airq.cnt5_maxerr.label = Max. Error Fine Dust >5μm
-channel-type.airq.co.label = CO Concentration
-channel-type.airq.co2.label = CO₂ Concentration
+channel-type.airq.co.label = Carbon Monoxide (CO)
+channel-type.airq.co2.label = Carbon Dioxide (CO₂)
 channel-type.airq.co2_maxerr.label = Max. Error CO₂ Conc.
 channel-type.airq.co_maxerr.label = Max. Error CO Conc.
 channel-type.airq.dco2dt.label = Change of CO₂ Concentr.
@@ -69,7 +69,8 @@ channel-type.airq.door.label = Door Event (exp)
 channel-type.airq.geopos.label = Location of air-Q Device
 channel-type.airq.h2s.label = Hydrogen Sulfide (H₂S)
 channel-type.airq.h2s_maxerr.label = Max. Error H₂S Conc.
-channel-type.airq.health.label = Health Index
+channel-type.airq.health.label = Health Index Raw
+channel-type.airq.health_index.label = Health Index
 channel-type.airq.humidity.label = Humidity
 channel-type.airq.humidity_abs.label = Absolute Humidity
 channel-type.airq.humidity_abs_maxerr.label = Max. Error Abs. Humidity
@@ -81,22 +82,23 @@ channel-type.airq.nightmodeFanNightOff.label = Switch Off Fan at Night
 channel-type.airq.nightmodeStartDay.label = Start of Day Operation
 channel-type.airq.nightmodeStartNight.label = End of Day Operation
 channel-type.airq.nightmodeWifiNightOff.label = Switch Off WLAN at Night
-channel-type.airq.no2.label = NO₂ Concentration
+channel-type.airq.no2.label = Nitrogen Dioxide (NO₂)
 channel-type.airq.no2_maxerr.label = Max. Error NO₂ Conc.
-channel-type.airq.o3.label = O₃ Concentration
+channel-type.airq.o3.label = Ozone (O₃)
 channel-type.airq.o3_maxerr.label = Max. Error O₃ Conc.
-channel-type.airq.oxygen.label = Oxygen Concentration
+channel-type.airq.oxygen.label = Oxygen (O₂)
 channel-type.airq.oxygen_maxerr.label = Max. Error Oxygen Conc.
 channel-type.airq.pass.label = Device Password
-channel-type.airq.performance.label = Performance Index
-channel-type.airq.pm1.label = Fine Dust Concentr. >1μ
-channel-type.airq.pm10.label = Fine Dust Concentr. >10μ
+channel-type.airq.performance.label = Performance Index Raw
+channel-type.airq.performance_index.label = Performance Index
+channel-type.airq.pm1.label = Fine Dust 1μm
+channel-type.airq.pm10.label = Fine Dust 10μm
 channel-type.airq.pm10_maxerr.label = Max. Error Fine Dust Conc. >10μm
 channel-type.airq.pm1_maxerr.label = Max. Error Fine Dust Conc. >1μm
-channel-type.airq.pm2_5.label = Fine Dust Concentr. >2,5μ
+channel-type.airq.pm2_5.label = Fine Dust 2.5μm
 channel-type.airq.pm2_5_maxerr.label = Max. Error Fine Dust Conc. >2,5μm
 channel-type.airq.ppm_and_ppb.label = Values in Particles
-channel-type.airq.pressure.label = Pressure
+channel-type.airq.pressure.label = Barometric Pressure
 channel-type.airq.pressure_maxerr.label = Max. Error Pressure
 channel-type.airq.so2.label = SO₂ Concentration
 channel-type.airq.so2_maxerr.label = Max. Error SO₂ Conc.
@@ -106,7 +108,7 @@ channel-type.airq.status.label = Status of Sensors
 channel-type.airq.temperature.label = Temperature
 channel-type.airq.temperature_maxerr.label = Max. Error Temperature
 channel-type.airq.timestamp.label = Time Stamp
-channel-type.airq.tvoc.label = VOC Concentration
+channel-type.airq.tvoc.label = Volatile Organic Compounds (VOC)
 channel-type.airq.tvoc_maxerr.label = Max. Error VOC Conc.
 channel-type.airq.typps.label = Average Size of Fine Dust
 channel-type.airq.uptime.label = Uptime
index 8ecda458a2bcbbe7445005368f77fc66000fbb2e..6baacb283b9fa20b76cbf387678ef3df71085bbf 100644 (file)
@@ -25,6 +25,7 @@
                        <channel id="dewpt" typeId="dewpt"/>
                        <channel id="doorEvent" typeId="door"/>
                        <channel id="h2s" typeId="h2s"/>
+                       <channel id="healthIndex" typeId="health_index"/>
                        <channel id="health" typeId="health"/>
                        <channel id="humidityRelative" typeId="humidity"/>
                        <channel id="humidityAbsolute" typeId="humidity_abs"/>
@@ -32,6 +33,7 @@
                        <channel id="no2" typeId="no2"/>
                        <channel id="o3" typeId="o3"/>
                        <channel id="o2" typeId="oxygen"/>
+                       <channel id="performanceIndex" typeId="performance_index"/>
                        <channel id="performance" typeId="performance"/>
                        <channel id="fineDustConc01" typeId="pm1"/>
                        <channel id="fineDustConc02_5" typeId="pm2_5"/>
                        <property name="sensorList">Unknown sensor list</property>
                        <property name="sensorInfo">No info about sensors</property>
                        <property name="industry">No industry info</property>
-                       <property name="thingTypeVersion">1</property>
+                       <property name="thingTypeVersion">2</property>
                </properties>
 
                <config-description>
        </channel-type>
 
        <channel-type id="typps" advanced="false">
-               <item-type>Number:Length</item-type>
+               <item-type unitHint="µm">Number:Length</item-type>
                <label>Average Size of Fine Dust</label>
-               <state readOnly="true" pattern="%.2f μm"></state>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
-       <channel-type id="cnt0_3" advanced="false">
+       <channel-type id="cnt0_3" advanced="true">
                <item-type>Number:Dimensionless</item-type>
-               <label>Fine Dust >0,3 μm</label>
+               <label>Fine Dust Count 0.3μm</label>
                <state readOnly="true" pattern="%.0f"></state>
        </channel-type>
 
-       <channel-type id="cnt0_5" advanced="false">
+       <channel-type id="cnt0_5" advanced="true">
                <item-type>Number:Dimensionless</item-type>
-               <label>Fine Dust >0,5 μm</label>
+               <label>Fine Dust Count 0.5 μm</label>
                <state readOnly="true" pattern="%.0f"></state>
        </channel-type>
 
-       <channel-type id="cnt1" advanced="false">
+       <channel-type id="cnt1" advanced="true">
                <item-type>Number:Dimensionless</item-type>
-               <label>Fine Dust >1 μm</label>
+               <label>Fine Dust Count 1μm</label>
                <state readOnly="true" pattern="%.0f"></state>
        </channel-type>
 
-       <channel-type id="cnt2_5" advanced="false">
+       <channel-type id="cnt2_5" advanced="true">
                <item-type>Number:Dimensionless</item-type>
-               <label>Fine Dust >2,5 μm</label>
+               <label>Fine Dust Count 2.5μm</label>
                <state readOnly="true" pattern="%.0f"></state>
        </channel-type>
 
-       <channel-type id="cnt5" advanced="false">
+       <channel-type id="cnt5" advanced="true">
                <item-type>Number:Dimensionless</item-type>
-               <label>Fine Dust >5 μm</label>
+               <label>Fine Dust Count 5μm</label>
                <state readOnly="true" pattern="%.0f"></state>
        </channel-type>
 
-       <channel-type id="cnt10" advanced="false">
+       <channel-type id="cnt10" advanced="true">
                <item-type>Number:Dimensionless</item-type>
-               <label>Fine Dust >10 μm</label>
+               <label>Fine Dust Count 10μm</label>
                <state readOnly="true" pattern="%.0f"></state>
        </channel-type>
 
        <channel-type id="co" advanced="false">
-               <item-type>Number</item-type>
-               <label>CO Concentration</label>
-               <state readOnly="true" pattern="%.0f mg/m³"></state>
+               <item-type unitHint="mg/m³">Number:Density</item-type>
+               <label>Carbon Monoxide (CO)</label>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
        <channel-type id="co2" advanced="false">
-               <item-type>Number:Dimensionless</item-type>
-               <label>CO₂ Concentration</label>
+               <item-type unitHint="ppm">Number:Dimensionless</item-type>
+               <label>Carbon Dioxide (CO₂)</label>
                <state readOnly="true" pattern="%.0f %unit%"></state>
        </channel-type>
 
        <channel-type id="dewpt" advanced="false">
                <item-type>Number:Temperature</item-type>
                <label>Dew Point</label>
-               <state readOnly="true" pattern="%.3f %unit%"></state>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
        <channel-type id="door" advanced="false">
                <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
-       <channel-type id="health" advanced="false">
-               <item-type>Number:Dimensionless</item-type>
+       <channel-type id="health_index" advanced="false">
+               <item-type unitHint="%">Number:Dimensionless</item-type>
                <label>Health Index</label>
+               <state readOnly="true" pattern="%.0f %unit%"></state>
+       </channel-type>
+
+       <channel-type id="health" advanced="true">
+               <item-type>Number:Dimensionless</item-type>
+               <label>Health Index Raw</label>
                <state readOnly="true"></state>
        </channel-type>
 
        <channel-type id="humidity" advanced="false">
                <item-type unitHint="%">Number:Dimensionless</item-type>
                <label>Humidity</label>
-               <state readOnly="true" pattern="%.2f %%"></state>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
        <channel-type id="humidity_abs" advanced="false">
-               <item-type>Number</item-type>
+               <item-type unitHint="g/m³">Number:Density</item-type>
                <label>Absolute Humidity</label>
-               <state readOnly="true" pattern="%.3f g/m³"></state>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
        <channel-type id="mtime" advanced="true">
        </channel-type>
 
        <channel-type id="no2" advanced="false">
-               <item-type>Number</item-type>
-               <label>NO₂ Concentration</label>
-               <state readOnly="true" pattern="%.2f μg/m³"></state>
+               <item-type unitHint="μg/m³">Number:Density</item-type>
+               <label>Nitrogen Dioxide (NO₂)</label>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
        <channel-type id="o3" advanced="false">
-               <item-type>Number</item-type>
-               <label>O₃ Concentration</label>
-               <state readOnly="true" pattern="%.2f μg/m³"></state>
+               <item-type unitHint="µg/m³">Number:Density</item-type>
+               <label>Ozone (O₃)</label>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
        <channel-type id="oxygen" advanced="false">
-               <item-type>Number:Dimensionless</item-type>
-               <label>Oxygen Concentration</label>
-               <state readOnly="true" pattern="%.3f %%"></state>
+               <item-type unitHint="%">Number:Dimensionless</item-type>
+               <label>Oxygen (O₂)</label>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
-       <channel-type id="performance" advanced="false">
-               <item-type>Number:Dimensionless</item-type>
+       <channel-type id="performance_index" advanced="false">
+               <item-type unitHint="%">Number:Dimensionless</item-type>
                <label>Performance Index</label>
+               <state readOnly="true" pattern="%.0f %unit%"></state>
+       </channel-type>
+
+       <channel-type id="performance" advanced="true">
+               <item-type>Number:Dimensionless</item-type>
+               <label>Performance Index Raw</label>
                <state readOnly="true"></state>
        </channel-type>
 
        <channel-type id="pm1" advanced="false">
-               <item-type>Number</item-type>
-               <label>Fine Dust Concentr. >1μ</label>
-               <state readOnly="true" pattern="%.0f μg/m³"></state>
+               <item-type unitHint="μg/m³">Number:Density</item-type>
+               <label>Fine Dust 1μm</label>
+               <state readOnly="true" pattern="%.0f %unit%"></state>
        </channel-type>
 
        <channel-type id="pm10" advanced="false">
-               <item-type>Number</item-type>
-               <label>Fine Dust Concentr. >10μ</label>
-               <state readOnly="true" pattern="%.0f μg/m³"></state>
+               <item-type unitHint="μg/m³">Number:Density</item-type>
+               <label>Fine Dust 10μm</label>
+               <state readOnly="true" pattern="%.0f %unit%"></state>
        </channel-type>
 
        <channel-type id="pm2_5" advanced="false">
-               <item-type>Number</item-type>
-               <label>Fine Dust Concentr. >2,5μ</label>
-               <state readOnly="true" pattern="%.0f μg/m³"></state>
+               <item-type unitHint="μg/m³">Number:Density</item-type>
+               <label>Fine Dust 2.5μm</label>
+               <state readOnly="true" pattern="%.0f %unit%"></state>
        </channel-type>
 
        <channel-type id="pressure" advanced="false">
-               <item-type>Number:Pressure</item-type>
-               <label>Pressure</label>
-               <state readOnly="true" pattern="%.2f hPa"></state>
+               <item-type unitHint="hPa">Number:Pressure</item-type>
+               <label>Barometric Pressure</label>
+               <state readOnly="true" pattern="%.2f %unit%"></state>
        </channel-type>
 
        <channel-type id="so2" advanced="false">
        </channel-type>
 
        <channel-type id="tvoc" advanced="false">
-               <item-type>Number:Dimensionless</item-type>
-               <label>VOC Concentration</label>
+               <item-type unitHint="ppb">Number:Dimensionless</item-type>
+               <label>Volatile Organic Compounds (VOC)</label>
                <state readOnly="true" pattern="%.0f %unit%"></state>
        </channel-type>
 
index 17176bde5d25a5e3af86067bc660bd962b08fc89..ce06ce5b7e1273b0352eee5925fb2ca46a317a22 100644 (file)
                                <label>Max. Error H₂S Conc.</label>
                        </add-channel>
                </instruction-set>
+               <instruction-set targetVersion="2">
+                       <add-channel id="healthIndex">
+                               <type>airq:health_index</type>
+                               <label>Health Index</label>
+                       </add-channel>
+                       <add-channel id="performanceIndex">
+                               <type>airq:performance_index</type>
+                               <label>Performance Index</label>
+                       </add-channel>
+
+                       <update-channel id="co">
+                               <type>airq:co</type>
+                               <label>Carbon Monoxide (CO)</label>
+                       </update-channel>
+                       <update-channel id="no2">
+                               <type>airq:no2</type>
+                               <label>Nitrogen Dioxide (NO₂)</label>
+                       </update-channel>
+                       <update-channel id="o3">
+                               <type>airq:o3</type>
+                               <label>Ozone (O₃)</label>
+                       </update-channel>
+
+                       <update-channel id="fineDustConc01">
+                               <type>airq:pm1</type>
+                               <label>Fine Dust 1μm</label>
+                       </update-channel>
+                       <update-channel id="fineDustConc02_5">
+                               <type>airq:pm2_5</type>
+                               <label>Fine Dust 2.5μm</label>
+                       </update-channel>
+                       <update-channel id="fineDustConc10">
+                               <type>airq:pm10</type>
+                               <label>Fine Dust 10μm</label>
+                       </update-channel>
+
+                       <update-channel id="fineDustCnt00_3">
+                               <type>airq:cnt0_3</type>
+                               <label>Fine Dust Count 0.3μm</label>
+                       </update-channel>
+                       <update-channel id="fineDustCnt00_5">
+                               <type>airq:cnt0_5</type>
+                               <label>Fine Dust Count 0.5μm</label>
+                       </update-channel>
+                       <update-channel id="fineDustCnt01">
+                               <type>airq:cnt1</type>
+                               <label>Fine Dust Count 1μm</label>
+                       </update-channel>
+                       <update-channel id="fineDustCnt02_5">
+                               <type>airq:cnt2_5</type>
+                               <label>Fine Dust Count 2.5μm</label>
+                       </update-channel>
+                       <update-channel id="fineDustCnt05">
+                               <type>airq:cnt5</type>
+                               <label>Fine Dust Count 5μm</label>
+                       </update-channel>
+                       <update-channel id="fineDustCnt10">
+                               <type>airq:cnt10</type>
+                               <label>Fine Dust Count 10μm</label>
+                       </update-channel>
+               </instruction-set>
        </thing-type>
 
 </update:update-descriptions>