[miio] add support for cgllc.airm.cgdn1 Qingping Air Monitor Lite (#10182)

* [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>
This commit is contained in:
Marcel 2021-04-10 09:58:57 +02:00 committed by GitHub
parent 035556bc55
commit 5ba64517ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 496 additions and 1 deletions

View File

@ -178,6 +178,7 @@ Currently the miio binding supports more than 280 different models.
| Device | ThingType | Device Model | Supported | Remark | | Device | ThingType | Device Model | Supported | Remark |
|------------------------------|------------------|------------------------|-----------|------------| |------------------------------|------------------|------------------------|-----------|------------|
| AUX Smart Air Conditioner | miio:unsupported | aux.aircondition.v1 | No | | | 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 | | | 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 | | | Qingping Air Monitor | miio:basic | [cgllc.airmonitor.s1](#cgllc-airmonitor-s1) | Yes | |
| Mi Universal Remote | miio:unsupported | chuangmi.ir.v2 | No | | | 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. 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 ### Mi Multifunction Air Monitor (<a name="cgllc-airmonitor-b1">cgllc.airmonitor.b1</a>) Channels
| Channel | Type | Description | Comment | | 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 ### 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. 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.

View File

@ -25,6 +25,7 @@ import org.openhab.core.thing.ThingTypeUID;
@NonNullByDefault @NonNullByDefault
public enum MiIoDevices { public enum MiIoDevices {
AUX_AIRCONDITION_V1("aux.aircondition.v1", "AUX Smart Air Conditioner", THING_TYPE_UNSUPPORTED), 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_B1("cgllc.airmonitor.b1", "Mi Multifunction Air Monitor", THING_TYPE_BASIC),
CGLLC_AIRMONITOR_S1("cgllc.airmonitor.s1", "Qingping 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), CHUANGMI_IR_V2("chuangmi.ir.v2", "Mi Universal Remote", THING_TYPE_UNSUPPORTED),

View File

@ -47,6 +47,7 @@ public enum MiIoQuantiyTypes {
AMPERE(Units.AMPERE), AMPERE(Units.AMPERE),
MILLI_AMPERE(MILLI(Units.AMPERE), "mA"), MILLI_AMPERE(MILLI(Units.AMPERE), "mA"),
VOLT(Units.VOLT), VOLT(Units.VOLT),
MILLI_VOLT(MILLI(Units.VOLT), "mV"),
WATT(Units.WATT), WATT(Units.WATT),
LITRE(Units.LITRE, "liter"), LITRE(Units.LITRE, "liter"),
LUX(Units.LUX), LUX(Units.LUX),
@ -55,7 +56,7 @@ public enum MiIoQuantiyTypes {
SQUARE_METRE(SIUnits.SQUARE_METRE, "square_meter", "squaremeter"), SQUARE_METRE(SIUnits.SQUARE_METRE, "square_meter", "squaremeter"),
PERCENT(Units.PERCENT, "percentage"), PERCENT(Units.PERCENT, "percentage"),
KGM3(Units.KILOGRAM_PER_CUBICMETRE, "kilogram_per_cubicmeter"), 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"), M3(SIUnits.CUBIC_METRE, "cubic_meter", "cubic_metre"),
LITER(Units.LITRE, "L", "litre"), LITER(Units.LITRE, "L", "litre"),
PPM(Units.PARTS_PER_MILLION, "parts_per_million"); PPM(Units.PARTS_PER_MILLION, "parts_per_million");

View File

@ -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."
}
}