Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[miio] Add support for Smartmi Fresh Air System (zhimi.airfresh.va4&va2) #11164

Merged
merged 6 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 85 additions & 1 deletion bundles/org.openhab.binding.miio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ This will change the communication method and the Mi IO binding can communicate

# Mi IO Devices

Currently the miio binding supports more than 290 different models.
Currently the miio binding supports more than 300 different models.

| Device | ThingType | Device Model | Supported | Remark |
|------------------------------|------------------|------------------------|-----------|------------|
Expand Down Expand Up @@ -459,6 +459,8 @@ Currently the miio binding supports more than 290 different models.
| Mi Water Purifier v2 | miio:basic | [yunmi.waterpurifier.v2](#yunmi-waterpurifier-v2) | Yes | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
| Mi Water Purifier (Under sink) v3 | miio:basic | [yunmi.waterpurifier.v3](#yunmi-waterpurifier-v3) | Yes | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
| Mi Water Purifier v4 | miio:basic | [yunmi.waterpurifier.v4](#yunmi-waterpurifier-v4) | Yes | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
| Smartmi Ventilation System | miio:basic | [zhimi.airfresh.va2](#zhimi-airfresh-va2) | Yes | |
| Smartmi Fresh Air System (Heating) | miio:basic | [zhimi.airfresh.va4](#zhimi-airfresh-va4) | Yes | |
| Mi PM2.5 Air Quality Monitor | miio:basic | [zhimi.airmonitor.v1](#zhimi-airmonitor-v1) | Yes | |
| Mi Air Purifier 2 (mini) | miio:basic | [zhimi.airpurifier.m1](#zhimi-airpurifier-m1) | Yes | |
| Mi Air Purifier 2 | miio:basic | [zhimi.airpurifier.m2](#zhimi-airpurifier-m2) | Yes | |
Expand Down Expand Up @@ -4218,6 +4220,44 @@ Note, not all the values need to be in the json file, e.g. a subset of the param
| tds_out_avg | Number | Average TDS out | |
| lightMode | Number | Light Mode | Value mapping `["0"="Simple Mode","1"="Special Mode"]` |

### Smartmi Ventilation System (<a name="zhimi-airfresh-va2">zhimi.airfresh.va2</a>) Channels

| Channel | Type | Description | Comment |
|----------------------|----------------------|------------------------------------------|------------|
| power | Switch | Power | |
| heater | Switch | Heater | |
| mode | String | Mode | Value mapping `["interval"="Interval","silent"="Night","low"="1","middle"="2","strong"="3","auto"="Auto"]` |
| humidity | Number:Dimensionless | Humidity | |
| co2 | Number:Dimensionless | CO2 | |
| childLock | Switch | Child Lock | |
| buzzer | Switch | Buzzer | |
| aqi | Number | Air Quality Index | |
| averageaqi | Number | Average Air Quality Index | |
| filterhours | Number:Time | Filter Hours used | |
| usedhours | Number:Time | Run Time | |
| motorspeed | Number | Motor Speed | |
| led_level | Number | Led - Brightness | Value mapping `["0"="High","1"="Low","2"="Idle"]` |
| temperature | Number:Temperature | Temperature | |

### Smartmi Fresh Air System (Heating) (<a name="zhimi-airfresh-va4">zhimi.airfresh.va4</a>) Channels

| Channel | Type | Description | Comment |
|----------------------|----------------------|------------------------------------------|------------|
| power | Switch | Power | |
| heater | Switch | Heater | |
| mode | String | Mode | Value mapping `["interval"="Interval","silent"="Night","low"="1","middle"="2","strong"="3","auto"="Auto"]` |
| humidity | Number:Dimensionless | Humidity | |
| co2 | Number:Dimensionless | CO2 | |
| childLock | Switch | Child Lock | |
| buzzer | Switch | Buzzer | |
| aqi | Number | Air Quality Index | |
| averageaqi | Number | Average Air Quality Index | |
| filterhours | Number:Time | Filter Hours used | |
| usedhours | Number:Time | Run Time | |
| motorspeed | Number | Motor Speed | |
| led_level | Number | Led - Brightness | Value mapping `["0"="High","1"="Low","2"="Idle"]` |
| temperature | Number:Temperature | Temperature | |

### Mi PM2.5 Air Quality Monitor (<a name="zhimi-airmonitor-v1">zhimi.airmonitor.v1</a>) Channels

| Channel | Type | Description | Comment |
Expand Down Expand Up @@ -9537,6 +9577,50 @@ Number tds_out_avg "Average TDS out" (G_waterpurifier) {channel="miio:basic:wate
Number lightMode "Light Mode" (G_waterpurifier) {channel="miio:basic:waterpurifier:lightMode"}
```

### Smartmi Ventilation System (zhimi.airfresh.va2) item file lines

note: Autogenerated example. Replace the id (airfresh) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.

```
Group G_airfresh "Smartmi Ventilation System" <status>
Switch power "Power" (G_airfresh) {channel="miio:basic:airfresh:power"}
Switch heater "Heater" (G_airfresh) {channel="miio:basic:airfresh:heater"}
String mode "Mode" (G_airfresh) {channel="miio:basic:airfresh:mode"}
Number:Dimensionless humidity "Humidity" (G_airfresh) {channel="miio:basic:airfresh:humidity"}
Number:Dimensionless co2 "CO2" (G_airfresh) {channel="miio:basic:airfresh:co2"}
Switch childLock "Child Lock" (G_airfresh) {channel="miio:basic:airfresh:childLock"}
Switch buzzer "Buzzer" (G_airfresh) {channel="miio:basic:airfresh:buzzer"}
Number aqi "Air Quality Index" (G_airfresh) {channel="miio:basic:airfresh:aqi"}
Number averageaqi "Average Air Quality Index" (G_airfresh) {channel="miio:basic:airfresh:averageaqi"}
Number:Time filterhours "Filter Hours used" (G_airfresh) {channel="miio:basic:airfresh:filterhours"}
Number:Time usedhours "Run Time" (G_airfresh) {channel="miio:basic:airfresh:usedhours"}
Number motorspeed "Motor Speed" (G_airfresh) {channel="miio:basic:airfresh:motorspeed"}
Number led_level "Led - Brightness" (G_airfresh) {channel="miio:basic:airfresh:led_level"}
Number:Temperature temperature "Temperature" (G_airfresh) {channel="miio:basic:airfresh:temperature"}
```

### Smartmi Fresh Air System (Heating) (zhimi.airfresh.va4) item file lines

note: Autogenerated example. Replace the id (airfresh) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.

```
Group G_airfresh "Smartmi Fresh Air System (Heating)" <status>
Switch power "Power" (G_airfresh) {channel="miio:basic:airfresh:power"}
Switch heater "Heater" (G_airfresh) {channel="miio:basic:airfresh:heater"}
String mode "Mode" (G_airfresh) {channel="miio:basic:airfresh:mode"}
Number:Dimensionless humidity "Humidity" (G_airfresh) {channel="miio:basic:airfresh:humidity"}
Number:Dimensionless co2 "CO2" (G_airfresh) {channel="miio:basic:airfresh:co2"}
Switch childLock "Child Lock" (G_airfresh) {channel="miio:basic:airfresh:childLock"}
Switch buzzer "Buzzer" (G_airfresh) {channel="miio:basic:airfresh:buzzer"}
Number aqi "Air Quality Index" (G_airfresh) {channel="miio:basic:airfresh:aqi"}
Number averageaqi "Average Air Quality Index" (G_airfresh) {channel="miio:basic:airfresh:averageaqi"}
Number:Time filterhours "Filter Hours used" (G_airfresh) {channel="miio:basic:airfresh:filterhours"}
Number:Time usedhours "Run Time" (G_airfresh) {channel="miio:basic:airfresh:usedhours"}
Number motorspeed "Motor Speed" (G_airfresh) {channel="miio:basic:airfresh:motorspeed"}
Number led_level "Led - Brightness" (G_airfresh) {channel="miio:basic:airfresh:led_level"}
Number:Temperature temperature "Temperature" (G_airfresh) {channel="miio:basic:airfresh:temperature"}
```

### Mi PM2.5 Air Quality Monitor (zhimi.airmonitor.v1) 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ public enum MiIoDevices {
YUNMI_WATERPURIFIER_V2("yunmi.waterpurifier.v2", "Mi Water Purifier v2", THING_TYPE_BASIC),
YUNMI_WATERPURIFIER_V3("yunmi.waterpurifier.v3", "Mi Water Purifier (Under sink) v3", THING_TYPE_BASIC),
YUNMI_WATERPURIFIER_V4("yunmi.waterpurifier.v4", "Mi Water Purifier v4", THING_TYPE_BASIC),
ZHIMI_AIRFRESH_VA2("zhimi.airfresh.va2", "Smartmi Ventilation System", THING_TYPE_BASIC),
ZHIMI_AIRFRESH_VA4("zhimi.airfresh.va4", "Smartmi Fresh Air System (Heating)", THING_TYPE_BASIC),
ZHIMI_AIRMONITOR_V1("zhimi.airmonitor.v1", "Mi PM2.5 Air Quality Monitor", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_M1("zhimi.airpurifier.m1", "Mi Air Purifier 2 (mini)", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_M2("zhimi.airpurifier.m2", "Mi Air Purifier 2", THING_TYPE_BASIC),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
{
"deviceMapping": {
"id": [
"zhimi.airfresh.va2",
"zhimi.airfresh.va4"
],
"propertyMethod": "get_prop",
"maxProperties": 2,
"channels": [
{
"property": "power",
"friendlyName": "Power",
"channel": "power",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_power",
"parameterType": "ONOFF"
}
],
"category": "switch",
"tags": [
"Switch"
]
},
{
"property": "ptc_state",
"friendlyName": "Heater",
"channel": "heater",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_ptc_state",
"parameterType": "ONOFF"
}
]
},
{
"property": "mode",
"friendlyName": "Mode",
"channel": "mode",
"type": "String",
"stateDescription": {
"options": [
{
"value": "interval",
"label": "Interval"
},
{
"value": "silent",
"label": "Night"
},
{
"value": "low",
"label": "1"
},
{
"value": "middle",
"label": "2"
},
{
"value": "strong",
"label": "3"
},
{
"value": "auto",
"label": "Auto"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_mode",
"parameterType": "STRING"
}
],
"tags": [
"Control"
],
"readmeComment": "Value mapping `[\"interval\"\u003d\"Interval\",\"silent\"\u003d\"Night\",\"low\"\u003d\"1\",\"middle\"\u003d\"2\",\"strong\"\u003d\"3\",\"auto\"\u003d\"Auto\"]`"
},
{
"property": "humidity",
"friendlyName": "Humidity",
"channel": "humidity",
"type": "Number:Dimensionless",
"unit": "PERCENT",
"refresh": true,
"ChannelGroup": "Status",
"actions": [],
"category": "humidity",
"tags": [
"Measurement",
"Humidity"
]
},
{
"property": "co2",
"friendlyName": "CO2",
"channel": "co2",
"type": "Number:Dimensionless",
"unit": "ppm",
"stateDescription": {
"minimum": 0,
"maximum": 5000,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"ChannelGroup": "Status",
"actions": [],
"category": "co2",
"tags": [
"Measurement",
"CO2"
]
},
{
"property": "child_lock",
"friendlyName": "Child Lock",
"channel": "childLock",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_child_lock",
"parameterType": "ONOFFBOOL"
}
]
},
{
"property": "buzzer",
"friendlyName": "Buzzer",
"channel": "buzzer",
"type": "Switch",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_buzzer",
"parameterType": "ONOFF"
}
]
},
{
"property": "aqi",
"friendlyName": "Air Quality Index",
"channel": "aqi",
"type": "Number",
"stateDescription": {
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
"ChannelGroup": "Status",
"actions": [],
"tags": [
"Measurement"
]
},
{
"property": "average_aqi",
"friendlyName": "Average Air Quality Index",
"channel": "averageaqi",
"type": "Number",
"stateDescription": {
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
"ChannelGroup": "Status",
"actions": [],
"tags": [
"Measurement"
]
},
{
"property": "f1_hour_used",
"friendlyName": "Filter Hours used",
"channel": "filterhours",
"type": "Number:Time",
"unit": "hours",
"refresh": true,
"ChannelGroup": "Status",
"actions": [],
"category": "time"
},
{
"property": "use_time",
"friendlyName": "Run Time",
"channel": "usedhours",
"type": "Number:Time",
"unit": "hours",
"refresh": true,
"transformation": "SecondsToHours",
"ChannelGroup": "Status",
"actions": [],
"category": "time"
},
{
"property": "motor1_speed",
"friendlyName": "Motor Speed",
"channel": "motorspeed",
"type": "Number",
"stateDescription": {
"pattern": "%.0f rpm",
"readOnly": true
},
"refresh": true,
"ChannelGroup": "Status",
"actions": []
},
{
"property": "led_level",
"friendlyName": "Led - Brightness",
"channel": "led_level",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "High"
},
{
"value": "1",
"label": "Low"
},
{
"value": "2",
"label": "Idle"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_led_level",
"parameterType": "NUMBER"
}
],
"readmeComment": "Value mapping `[\"0\"\u003d\"High\",\"1\"\u003d\"Low\",\"2\"\u003d\"Idle\"]`"
},
{
"property": "temp_dec",
"friendlyName": "Temperature",
"channel": "temperature",
"type": "Number:Temperature",
"unit": "CELSIUS",
"stateDescription": {
"pattern": "%.1f %unit%",
"readOnly": true
},
"refresh": true,
"ChannelGroup": "Status",
"actions": [],
"category": "temperature",
"tags": [
"Measurement",
"Temperature"
]
}
]
}
}