]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] add support for cgllc.airm.cgdn1 Qingping Air Monitor Lite (#10182)
authorMarcel <marcel@verpaalen.com>
Sat, 10 Apr 2021 07:58:57 +0000 (09:58 +0200)
committerGitHub <noreply@github.com>
Sat, 10 Apr 2021 07:58:57 +0000 (09:58 +0200)
* [miio] add support for cgllc.airm.cgdn1 Qingping Air Monitor Lite

close #10152

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
* [miio] remove expiremental

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
* Improve readme

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
* [miio] improve qty types

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
* [miio] remove unknown element

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
bundles/org.openhab.binding.miio/README.md
bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java
bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoQuantiyTypes.java
bundles/org.openhab.binding.miio/src/main/resources/database/cgllc.airm.cgdn1-miot.json [new file with mode: 0644]

index f2677ea1d5e3213d8e1bd18bdfd3b165522770be..b280c4433323c80e3cb81ca739a4248a20bc5ef6 100644 (file)
@@ -178,6 +178,7 @@ Currently the miio binding supports more than 280 different models.
 | Device                       | ThingType        | Device Model           | Supported | Remark     |
 |------------------------------|------------------|------------------------|-----------|------------|
 | AUX Smart Air Conditioner    | miio:unsupported | aux.aircondition.v1    | No        |            |
+| Qingping Air Monitor Lite    | miio:basic       | [cgllc.airm.cgdn1](#cgllc-airm-cgdn1) | Yes       | Identified manual actions for execution<br />`action{"did":"settings-set-start-time","siid":9,"aiid":2,"in":[2.0]}`<br />`action{"did":"settings-set-end-time","siid":9,"aiid":3,"in":[3.0]}`<br />`action{"did":"settings-set-frequency","siid":9,"aiid":4,"in":[4.0]}`<br />`action{"did":"settings-set-screen-off","siid":9,"aiid":5,"in":[5.0]}`<br />`action{"did":"settings-set-device-off","siid":9,"aiid":6,"in":[6.0]}`<br />`action{"did":"settings-set-temp-unit","siid":9,"aiid":7,"in":[7.0]}`<br />Please test and feedback if they are working to they can be linked to a channel. |
 | Mi Multifunction Air Monitor | miio:basic       | [cgllc.airmonitor.b1](#cgllc-airmonitor-b1) | Yes       |            |
 | Qingping Air Monitor         | miio:basic       | [cgllc.airmonitor.s1](#cgllc-airmonitor-s1) | Yes       |            |
 | Mi Universal Remote          | miio:unsupported | chuangmi.ir.v2         | No        |            |
@@ -507,6 +508,25 @@ note: the ADVANCED  `actions#commands` and `actions#rpc` channels can be used to
 e.g. `openhab:send actionCommand 'upd_timer["1498595904821", "on"]'` would enable a pre-configured timer. See https://github.com/marcelrv/XiaomiRobotVacuumProtocol for all known available commands.
 
 
+### Qingping Air Monitor Lite (<a name="cgllc-airm-cgdn1">cgllc.airm.cgdn1</a>) Channels
+
+| Channel              | Type                 | Description                              | Comment    |
+|----------------------|----------------------|------------------------------------------|------------|
+| actions              | String               | Actions                                  | Value mapping ["settings-set-start-time"="Set Start Time","settings-set-end-time"="Set End Time","settings-set-frequency"="Set Frequency","settings-set-screen-off"="Set Screen Off","settings-set-device-off"="Set Device Off","settings-set-temp-unit"="Set Temp Unit"] |
+| relative_humidity    | Number:Dimensionless | Environment - Relative Humidity          |            |
+| pm2_5_density        | Number:Density       | Environment - PM2 5 Density              |            |
+| pm10_density         | Number:Density       | Environment - PM10 Density               |            |
+| temperature          | Number:Temperature   | Environment - Temperature                |            |
+| co2_density          | Number:Density       | Environment - CO2 Density                |            |
+| battery_level        | Number:Dimensionless | Battery - Battery Level                  |            |
+| charging_state       | Number               | Battery - Charging State                 | Value mapping ["1"="Charging","2"="Not charging","3"="Not chargeable"] |
+| voltage              | Number:ElectricPotential | Battery - Voltage                        |            |
+| mac                  | String               | Mac - Mac                                |            |
+| monitoring_frequency | Number:Time          | Settings - Monitoring Frequency          | Value mapping ["1"="Second","60"="Second","300"="Second","600"="Second","0"="Null"] |
+| screen_off           | Number:Time          | Settings - Screen Off                    | Value mapping ["15"="Second","30"="Second","60"="Second","300"="Second","0"="Null"] |
+| device_off           | Number:Time          | Settings - Device Off                    | Value mapping ["15"="Minute","30"="Minute","60"="Minute","0"="Null"] |
+| tempature_unit       | String               | Settings - Tempature Unit                |            |
+
 ### Mi Multifunction Air Monitor (<a name="cgllc-airmonitor-b1">cgllc.airmonitor.b1</a>) Channels
 
 | Channel              | Type                 | Description                              | Comment    |
@@ -4945,6 +4965,28 @@ Additionally depending on the capabilities of your robot vacuum other channels m
 
 
 
+### Qingping Air Monitor Lite (cgllc.airm.cgdn1) item file lines
+
+note: Autogenerated example. Replace the id (airm) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.
+
+```
+Group G_airm "Qingping Air Monitor Lite" <status>
+String actions "Actions" (G_airm) {channel="miio:basic:airm:actions"}
+Number:Dimensionless relative_humidity "Environment - Relative Humidity" (G_airm) {channel="miio:basic:airm:relative_humidity"}
+Number:Density pm2_5_density "Environment - PM2 5 Density" (G_airm) {channel="miio:basic:airm:pm2_5_density"}
+Number:Density pm10_density "Environment - PM10 Density" (G_airm) {channel="miio:basic:airm:pm10_density"}
+Number:Temperature temperature "Environment - Temperature" (G_airm) {channel="miio:basic:airm:temperature"}
+Number:Density co2_density "Environment - CO2 Density" (G_airm) {channel="miio:basic:airm:co2_density"}
+Number:Dimensionless battery_level "Battery - Battery Level" (G_airm) {channel="miio:basic:airm:battery_level"}
+Number charging_state "Battery - Charging State" (G_airm) {channel="miio:basic:airm:charging_state"}
+Number:ElectricPotential voltage "Battery - Voltage" (G_airm) {channel="miio:basic:airm:voltage"}
+String mac "Mac - Mac" (G_airm) {channel="miio:basic:airm:mac"}
+Number:Time monitoring_frequency "Settings - Monitoring Frequency" (G_airm) {channel="miio:basic:airm:monitoring_frequency"}
+Number:Time screen_off "Settings - Screen Off" (G_airm) {channel="miio:basic:airm:screen_off"}
+Number:Time device_off "Settings - Device Off" (G_airm) {channel="miio:basic:airm:device_off"}
+String tempature_unit "Settings - Tempature Unit" (G_airm) {channel="miio:basic:airm:tempature_unit"}
+```
+
 ### Mi Multifunction Air Monitor (cgllc.airmonitor.b1) item file lines
 
 note: Autogenerated example. Replace the id (airmonitor) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.
index e998e004f4a1fd2f9ce8f14650fceaa28b00d507..16f871fc5f3b6330e6730f00f1a0d357caa3be69 100644 (file)
@@ -25,6 +25,7 @@ import org.openhab.core.thing.ThingTypeUID;
 @NonNullByDefault
 public enum MiIoDevices {
     AUX_AIRCONDITION_V1("aux.aircondition.v1", "AUX Smart Air Conditioner", THING_TYPE_UNSUPPORTED),
+    CGLLC_AIRM_CGDN1("cgllc.airm.cgdn1", "Qingping Air Monitor Lite", THING_TYPE_BASIC),
     CGLLC_AIRMONITOR_B1("cgllc.airmonitor.b1", "Mi Multifunction Air Monitor", THING_TYPE_BASIC),
     CGLLC_AIRMONITOR_S1("cgllc.airmonitor.s1", "Qingping Air Monitor", THING_TYPE_BASIC),
     CHUANGMI_IR_V2("chuangmi.ir.v2", "Mi Universal Remote", THING_TYPE_UNSUPPORTED),
index 5a07f8f746bb66791ee294fb5860e1de4cc6d2d6..9b931a91c2a2944ac3cb5e2daf036adf99f43459 100644 (file)
@@ -47,6 +47,7 @@ public enum MiIoQuantiyTypes {
     AMPERE(Units.AMPERE),
     MILLI_AMPERE(MILLI(Units.AMPERE), "mA"),
     VOLT(Units.VOLT),
+    MILLI_VOLT(MILLI(Units.VOLT), "mV"),
     WATT(Units.WATT),
     LITRE(Units.LITRE, "liter"),
     LUX(Units.LUX),
@@ -55,7 +56,7 @@ public enum MiIoQuantiyTypes {
     SQUARE_METRE(SIUnits.SQUARE_METRE, "square_meter", "squaremeter"),
     PERCENT(Units.PERCENT, "percentage"),
     KGM3(Units.KILOGRAM_PER_CUBICMETRE, "kilogram_per_cubicmeter"),
-    UGM3(Units.MICROGRAM_PER_CUBICMETRE, "microgram_per_cubicmeter"),
+    UGM3(Units.MICROGRAM_PER_CUBICMETRE, "microgram_per_cubicmeter", "μg/m3"),
     M3(SIUnits.CUBIC_METRE, "cubic_meter", "cubic_metre"),
     LITER(Units.LITRE, "L", "litre"),
     PPM(Units.PARTS_PER_MILLION, "parts_per_million");
diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/cgllc.airm.cgdn1-miot.json b/bundles/org.openhab.binding.miio/src/main/resources/database/cgllc.airm.cgdn1-miot.json
new file mode 100644 (file)
index 0000000..ae9bc7f
--- /dev/null
@@ -0,0 +1,451 @@
+{
+       "deviceMapping": {
+               "id": [
+                       "cgllc.airm.cgdn1"
+               ],
+               "propertyMethod": "get_properties",
+               "maxProperties": 1,
+               "channels": [
+                       {
+                               "property": "",
+                               "friendlyName": "Actions",
+                               "channel": "actions",
+                               "type": "String",
+                               "stateDescription": {
+                                       "options": [
+                                               {
+                                                       "value": "settings-set-start-time",
+                                                       "label": "Set Start Time"
+                                               },
+                                               {
+                                                       "value": "settings-set-end-time",
+                                                       "label": "Set End Time"
+                                               },
+                                               {
+                                                       "value": "settings-set-frequency",
+                                                       "label": "Set Frequency"
+                                               },
+                                               {
+                                                       "value": "settings-set-screen-off",
+                                                       "label": "Set Screen Off"
+                                               },
+                                               {
+                                                       "value": "settings-set-device-off",
+                                                       "label": "Set Device Off"
+                                               },
+                                               {
+                                                       "value": "settings-set-temp-unit",
+                                                       "label": "Set Temp Unit"
+                                               }
+                                       ]
+                               },
+                               "actions": [
+                                       {
+                                               "command": "action",
+                                               "parameterType": "NUMBER",
+                                               "parameters": [
+                                                       2.0
+                                               ],
+                                               "siid": 9,
+                                               "aiid": 2,
+                                               "condition": {
+                                                       "name": "matchValue",
+                                                       "parameters": [
+                                                               {
+                                                                       "matchValue": "settings-set-start-time"
+                                                               }
+                                                       ]
+                                               }
+                                       },
+                                       {
+                                               "command": "action",
+                                               "parameterType": "NUMBER",
+                                               "parameters": [
+                                                       3.0
+                                               ],
+                                               "siid": 9,
+                                               "aiid": 3,
+                                               "condition": {
+                                                       "name": "matchValue",
+                                                       "parameters": [
+                                                               {
+                                                                       "matchValue": "settings-set-end-time"
+                                                               }
+                                                       ]
+                                               }
+                                       },
+                                       {
+                                               "command": "action",
+                                               "parameterType": "NUMBER",
+                                               "parameters": [
+                                                       4.0
+                                               ],
+                                               "siid": 9,
+                                               "aiid": 4,
+                                               "condition": {
+                                                       "name": "matchValue",
+                                                       "parameters": [
+                                                               {
+                                                                       "matchValue": "settings-set-frequency"
+                                                               }
+                                                       ]
+                                               }
+                                       },
+                                       {
+                                               "command": "action",
+                                               "parameterType": "NUMBER",
+                                               "parameters": [
+                                                       5.0
+                                               ],
+                                               "siid": 9,
+                                               "aiid": 5,
+                                               "condition": {
+                                                       "name": "matchValue",
+                                                       "parameters": [
+                                                               {
+                                                                       "matchValue": "settings-set-screen-off"
+                                                               }
+                                                       ]
+                                               }
+                                       },
+                                       {
+                                               "command": "action",
+                                               "parameterType": "NUMBER",
+                                               "parameters": [
+                                                       6.0
+                                               ],
+                                               "siid": 9,
+                                               "aiid": 6,
+                                               "condition": {
+                                                       "name": "matchValue",
+                                                       "parameters": [
+                                                               {
+                                                                       "matchValue": "settings-set-device-off"
+                                                               }
+                                                       ]
+                                               }
+                                       },
+                                       {
+                                               "command": "action",
+                                               "parameterType": "NUMBER",
+                                               "parameters": [
+                                                       7.0
+                                               ],
+                                               "siid": 9,
+                                               "aiid": 7,
+                                               "condition": {
+                                                       "name": "matchValue",
+                                                       "parameters": [
+                                                               {
+                                                                       "matchValue": "settings-set-temp-unit"
+                                                               }
+                                                       ]
+                                               }
+                                       }
+                               ],
+                               "readmeComment": "Value mapping [\"settings-set-start-time\"\u003d\"Set Start Time\",\"settings-set-end-time\"\u003d\"Set End Time\",\"settings-set-frequency\"\u003d\"Set Frequency\",\"settings-set-screen-off\"\u003d\"Set Screen Off\",\"settings-set-device-off\"\u003d\"Set Device Off\",\"settings-set-temp-unit\"\u003d\"Set Temp Unit\"]"
+                       },
+                       {
+                               "property": "relative-humidity",
+                               "siid": 3,
+                               "piid": 1,
+                               "friendlyName": "Environment - Relative Humidity",
+                               "channel": "relative_humidity",
+                               "type": "Number:Dimensionless",
+                               "unit": "percentage",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 100,
+                                       "step": 1,
+                                       "pattern": "%.0f %unit%",
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "pm2.5-density",
+                               "siid": 3,
+                               "piid": 4,
+                               "friendlyName": "Environment - PM2 5 Density",
+                               "channel": "pm2_5_density",
+                               "type": "Number:Density",
+                               "unit": "μg/m3",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 1000,
+                                       "step": 1,
+                                       "pattern": "%.0f",
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "pm10-density",
+                               "siid": 3,
+                               "piid": 5,
+                               "friendlyName": "Environment - PM10 Density",
+                               "channel": "pm10_density",
+                               "type": "Number:Density",
+                               "unit": "μg/m3",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 1000,
+                                       "step": 1,
+                                       "pattern": "%.0f",
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "temperature",
+                               "siid": 3,
+                               "piid": 7,
+                               "friendlyName": "Environment - Temperature",
+                               "channel": "temperature",
+                               "type": "Number:Temperature",
+                               "unit": "celsius",
+                               "stateDescription": {
+                                       "minimum": -30,
+                                       "maximum": 100,
+                                       "pattern": "%.1f %unit%",
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "co2-density",
+                               "siid": 3,
+                               "piid": 8,
+                               "friendlyName": "Environment - CO2 Density",
+                               "channel": "co2_density",
+                               "type": "Number:Density",
+                               "unit": "ppm",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 9999,
+                                       "step": 1,
+                                       "pattern": "%.0f %unit%",
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "battery-level",
+                               "siid": 4,
+                               "piid": 1,
+                               "friendlyName": "Battery - Battery Level",
+                               "channel": "battery_level",
+                               "type": "Number:Dimensionless",
+                               "unit": "percentage",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 100,
+                                       "step": 1,
+                                       "pattern": "%.0f %unit%",
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "charging-state",
+                               "siid": 4,
+                               "piid": 2,
+                               "friendlyName": "Battery - Charging State",
+                               "channel": "charging_state",
+                               "type": "Number",
+                               "stateDescription": {
+                                       "readOnly": true,
+                                       "options": [
+                                               {
+                                                       "value": "1",
+                                                       "label": "Charging"
+                                               },
+                                               {
+                                                       "value": "2",
+                                                       "label": "Not charging"
+                                               },
+                                               {
+                                                       "value": "3",
+                                                       "label": "Not chargeable"
+                                               }
+                                       ]
+                               },
+                               "refresh": true,
+                               "actions": [],
+                               "readmeComment": "Value mapping [\"1\"\u003d\"Charging\",\"2\"\u003d\"Not charging\",\"3\"\u003d\"Not chargeable\"]"
+                       },
+                       {
+                               "property": "voltage",
+                               "siid": 4,
+                               "piid": 3,
+                               "friendlyName": "Battery - Voltage",
+                               "channel": "voltage",
+                               "type": "Number:ElectricPotential",
+                               "unit": "mV",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 65535,
+                                       "step": 1,
+                                       "pattern": "%.2f",
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "mac",
+                               "siid": 8,
+                               "piid": 1,
+                               "friendlyName": "Mac - Mac",
+                               "channel": "mac",
+                               "type": "String",
+                               "stateDescription": {
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "monitoring-frequency",
+                               "siid": 9,
+                               "piid": 4,
+                               "friendlyName": "Settings - Monitoring Frequency",
+                               "channel": "monitoring_frequency",
+                               "type": "Number:Time",
+                               "unit": "seconds",
+                               "stateDescription": {
+                                       "options": [
+                                               {
+                                                       "value": "1",
+                                                       "label": "Second"
+                                               },
+                                               {
+                                                       "value": "60",
+                                                       "label": "Second"
+                                               },
+                                               {
+                                                       "value": "300",
+                                                       "label": "Second"
+                                               },
+                                               {
+                                                       "value": "600",
+                                                       "label": "Second"
+                                               },
+                                               {
+                                                       "value": "0",
+                                                       "label": "Null"
+                                               }
+                                       ]
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "STRING"
+                                       }
+                               ],
+                               "readmeComment": "Value mapping [\"1\"\u003d\"Second\",\"60\"\u003d\"Second\",\"300\"\u003d\"Second\",\"600\"\u003d\"Second\",\"0\"\u003d\"Null\"]"
+                       },
+                       {
+                               "property": "screen-off",
+                               "siid": 9,
+                               "piid": 5,
+                               "friendlyName": "Settings - Screen Off",
+                               "channel": "screen_off",
+                               "type": "Number:Time",
+                               "unit": "seconds",
+                               "stateDescription": {
+                                       "options": [
+                                               {
+                                                       "value": "15",
+                                                       "label": "Second"
+                                               },
+                                               {
+                                                       "value": "30",
+                                                       "label": "Second"
+                                               },
+                                               {
+                                                       "value": "60",
+                                                       "label": "Second"
+                                               },
+                                               {
+                                                       "value": "300",
+                                                       "label": "Second"
+                                               },
+                                               {
+                                                       "value": "0",
+                                                       "label": "Null"
+                                               }
+                                       ]
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "STRING"
+                                       }
+                               ],
+                               "readmeComment": "Value mapping [\"15\"\u003d\"Second\",\"30\"\u003d\"Second\",\"60\"\u003d\"Second\",\"300\"\u003d\"Second\",\"0\"\u003d\"Null\"]"
+                       },
+                       {
+                               "property": "device-off",
+                               "siid": 9,
+                               "piid": 6,
+                               "friendlyName": "Settings - Device Off",
+                               "channel": "device_off",
+                               "type": "Number:Time",
+                               "unit": "minutes",
+                               "stateDescription": {
+                                       "options": [
+                                               {
+                                                       "value": "15",
+                                                       "label": "Minute"
+                                               },
+                                               {
+                                                       "value": "30",
+                                                       "label": "Minute"
+                                               },
+                                               {
+                                                       "value": "60",
+                                                       "label": "Minute"
+                                               },
+                                               {
+                                                       "value": "0",
+                                                       "label": "Null"
+                                               }
+                                       ]
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "STRING"
+                                       }
+                               ],
+                               "readmeComment": "Value mapping [\"15\"\u003d\"Minute\",\"30\"\u003d\"Minute\",\"60\"\u003d\"Minute\",\"0\"\u003d\"Null\"]"
+                       },
+                       {
+                               "property": "tempature-unit",
+                               "siid": 9,
+                               "piid": 7,
+                               "friendlyName": "Settings - Tempature Unit",
+                               "channel": "tempature_unit",
+                               "type": "String",
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "STRING"
+                                       }
+                               ]
+                       }
+               ],
+               "readmeComment": "Identified manual actions for execution\u003cbr /\u003e`action{\"did\":\"settings-set-start-time\",\"siid\":9,\"aiid\":2,\"in\":[2.0]}`\u003cbr /\u003e`action{\"did\":\"settings-set-end-time\",\"siid\":9,\"aiid\":3,\"in\":[3.0]}`\u003cbr /\u003e`action{\"did\":\"settings-set-frequency\",\"siid\":9,\"aiid\":4,\"in\":[4.0]}`\u003cbr /\u003e`action{\"did\":\"settings-set-screen-off\",\"siid\":9,\"aiid\":5,\"in\":[5.0]}`\u003cbr /\u003e`action{\"did\":\"settings-set-device-off\",\"siid\":9,\"aiid\":6,\"in\":[6.0]}`\u003cbr /\u003e`action{\"did\":\"settings-set-temp-unit\",\"siid\":9,\"aiid\":7,\"in\":[7.0]}`\u003cbr /\u003ePlease test and feedback if they are working to they can be linked to a channel."
+       }
+}