diff --git a/bundles/org.openhab.binding.miio/README.md b/bundles/org.openhab.binding.miio/README.md index f2677ea1d..b280c4433 100644 --- a/bundles/org.openhab.binding.miio/README.md +++ b/bundles/org.openhab.binding.miio/README.md @@ -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
`action{"did":"settings-set-start-time","siid":9,"aiid":2,"in":[2.0]}`
`action{"did":"settings-set-end-time","siid":9,"aiid":3,"in":[3.0]}`
`action{"did":"settings-set-frequency","siid":9,"aiid":4,"in":[4.0]}`
`action{"did":"settings-set-screen-off","siid":9,"aiid":5,"in":[5.0]}`
`action{"did":"settings-set-device-off","siid":9,"aiid":6,"in":[6.0]}`
`action{"did":"settings-set-temp-unit","siid":9,"aiid":7,"in":[7.0]}`
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 (cgllc.airm.cgdn1) 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 (cgllc.airmonitor.b1) 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" +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. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java index e998e004f..16f871fc5 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java @@ -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), diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoQuantiyTypes.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoQuantiyTypes.java index 5a07f8f74..9b931a91c 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoQuantiyTypes.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoQuantiyTypes.java @@ -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 index 000000000..ae9bc7fa3 --- /dev/null +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/cgllc.airm.cgdn1-miot.json @@ -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." + } +}