Skip to content

Commit

Permalink
[miio] Support of Smartmi Air Purifier zhimi.airpurifier.za1 (#10534)
Browse files Browse the repository at this point in the history
Closes #10526

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
  • Loading branch information
marcelrv authored Apr 27, 2021
1 parent 2110e13 commit 61a3705
Show file tree
Hide file tree
Showing 5 changed files with 741 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.miio/README.base.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,4 +528,4 @@ Mapping of countries in mihome app to server:
| Yemen | YE | sg |
| Zambia | ZM | sg |
| Zimbabwe | ZW | sg |
| Åland Islands | AX | de |
| Åland Islands | AX | de |
78 changes: 78 additions & 0 deletions bundles/org.openhab.binding.miio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ Currently the miio binding supports more than 280 different models.
| Mi Air Purifier Pro H | miio:basic | [zhimi.airpurifier.vb2](#zhimi-airpurifier-vb2) | Yes | |
| Mi Air Purifier virtual | miio:unsupported | zhimi.airpurifier.virtual | No | |
| Mi Air Purifier 2(Virtual) | miio:unsupported | zhimi.airpurifier.vtl_m1 | No | |
| Smartmi Air Purifier | miio:basic | [zhimi.airpurifier.za1](#zhimi-airpurifier-za1) | Yes | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
| Mi Standing Fan | miio:basic | [zhimi.fan.sa1](#zhimi-fan-sa1) | Yes | |
| Mi Smart Fan | miio:basic | [zhimi.fan.v1](#zhimi-fan-v1) | Yes | |
| Smartmi DC Pedestal Fan | miio:basic | [zhimi.fan.v2](#zhimi-fan-v2) | Yes | |
Expand Down Expand Up @@ -4497,6 +4498,43 @@ e.g. `openhab:send actionCommand 'upd_timer["1498595904821", "on"]'` would enabl
| powertime | Number:duration | Others - Powertime | |
| country_code | Number | Others - Country Code | Value mapping ["91"="India","44"="UK","852"="Hong Kong","886"="Taiwan","82"="Korea"] |

### Smartmi Air Purifier (<a name="zhimi-airpurifier-za1">zhimi.airpurifier.za1</a>) Channels

| Channel | Type | Description | Comment |
|----------------------|----------------------|------------------------------------------|------------|
| on | Switch | Air Purifier - Switch Status | |
| fault | Number | Air Purifier - Fault | Value mapping ["0"="No faults","1"="m1_run","2"="m1_stuck","3"="no_sensor","4"="error_hum","5"="error_temp","6"="timer_error1","7"="timer_error2"] |
| mode | Number | Air Purifier - Mode | Value mapping ["0"="Auto","1"="Sleep","2"="Favorite"] |
| air_quality | Number | Environment - Air Quality | |
| pm2_5_density | Number | Environment - PM2 5 Density | |
| relative_humidity | Number:Dimensionless | Environment - Relative Humidity | |
| temperature | Number:Temperature | Environment - Temperature | |
| filter_life_level | Number:Dimensionless | Filter - Filter Life Level | |
| filter_used_time | Number:Time | Filter - Filter Used Time | |
| alarm | Switch | Alarm - Alarm | |
| brightness | Number | Indicator Light - Brightness | Value mapping ["0"="Bright","1"="Light","2"="Off"] |
| physical_controls_locked | Switch | Physical Control Locked - Physical Control Locked | |
| filter_max_time | Number:Time | Filter Time - Filter Max Time | |
| favorite_fan_level | Number | Motor Speed - Favorite Fan Level | |
| motor_speed | Number | Motor Speed - Motor Speed | |
| use_time | Number:Time | Use Time - Use Time | |
| purify_volume | Number | Aqi - Purify Volume | |
| average_aqi | Number | Aqi - Average Aqi | |
| aqi_zone | String | Aqi - Aqi Zone | |
| sensor_state | Number | Aqi - Sensor State | Value mapping ["0"="waiting","1"="ready"] |
| rfid_tag | String | Rfid - Rfid Tag | |
| rfid_factory_id | String | Rfid - Rfid Factory Id | |
| rfid_product_id | String | Rfid - Rfid Product Id | |
| rfid_time | String | Rfid - Rfid Time | |
| rfid_serial_num | String | Rfid - Rfid Serial Num | |
| reboot_cause | Number | Others - Reboot Cause | Value mapping ["0"="hardware","1"="human","2"="upgrade","3"="watchdog"] |
| hw_version | Number | Others - Hw Version | |
| sgp_ethanol | Number | Others - Sgp Ethanol | |
| sgp_serial | Number | Others - Sgp Serial | |
| sgp_version | String | Others - Sgp Version | |
| country_code | Number | Others - Country Code | Value mapping ["1"="America","2"="Canada","3"="Singapore","4"="Europe","5"="Australian","6"="Korea","7"="China","8"="France","9"="Japanese","10"="Taiwan"] |
| gesture_status | Switch | Others - Gesture Status | |

### Mi Standing Fan (<a name="zhimi-fan-sa1">zhimi.fan.sa1</a>) Channels

| Channel | Type | Description | Comment |
Expand Down Expand Up @@ -9659,6 +9697,46 @@ Number:duration powertime "Others - Powertime" (G_airpurifier) {channel="miio:ba
Number country_code "Others - Country Code" (G_airpurifier) {channel="miio:basic:airpurifier:country_code"}
```

### Smartmi Air Purifier (zhimi.airpurifier.za1) item file lines

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

```
Group G_airpurifier "Smartmi Air Purifier" <status>
Switch on "Air Purifier - Switch Status" (G_airpurifier) {channel="miio:basic:airpurifier:on"}
Number fault "Air Purifier - Fault" (G_airpurifier) {channel="miio:basic:airpurifier:fault"}
Number mode "Air Purifier - Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"}
Number air_quality "Environment - Air Quality" (G_airpurifier) {channel="miio:basic:airpurifier:air_quality"}
Number pm2_5_density "Environment - PM2 5 Density" (G_airpurifier) {channel="miio:basic:airpurifier:pm2_5_density"}
Number:Dimensionless relative_humidity "Environment - Relative Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:relative_humidity"}
Number:Temperature temperature "Environment - Temperature" (G_airpurifier) {channel="miio:basic:airpurifier:temperature"}
Number:Dimensionless filter_life_level "Filter - Filter Life Level" (G_airpurifier) {channel="miio:basic:airpurifier:filter_life_level"}
Number:Time filter_used_time "Filter - Filter Used Time" (G_airpurifier) {channel="miio:basic:airpurifier:filter_used_time"}
Switch alarm "Alarm - Alarm" (G_airpurifier) {channel="miio:basic:airpurifier:alarm"}
Number brightness "Indicator Light - Brightness" (G_airpurifier) {channel="miio:basic:airpurifier:brightness"}
Switch physical_controls_locked "Physical Control Locked - Physical Control Locked" (G_airpurifier) {channel="miio:basic:airpurifier:physical_controls_locked"}
Number:Time filter_max_time "Filter Time - Filter Max Time" (G_airpurifier) {channel="miio:basic:airpurifier:filter_max_time"}
Number favorite_fan_level "Motor Speed - Favorite Fan Level" (G_airpurifier) {channel="miio:basic:airpurifier:favorite_fan_level"}
Number motor_speed "Motor Speed - Motor Speed" (G_airpurifier) {channel="miio:basic:airpurifier:motor_speed"}
Number:Time use_time "Use Time - Use Time" (G_airpurifier) {channel="miio:basic:airpurifier:use_time"}
Number purify_volume "Aqi - Purify Volume" (G_airpurifier) {channel="miio:basic:airpurifier:purify_volume"}
Number average_aqi "Aqi - Average Aqi" (G_airpurifier) {channel="miio:basic:airpurifier:average_aqi"}
String aqi_zone "Aqi - Aqi Zone" (G_airpurifier) {channel="miio:basic:airpurifier:aqi_zone"}
Number sensor_state "Aqi - Sensor State" (G_airpurifier) {channel="miio:basic:airpurifier:sensor_state"}
String rfid_tag "Rfid - Rfid Tag" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_tag"}
String rfid_factory_id "Rfid - Rfid Factory Id" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_factory_id"}
String rfid_product_id "Rfid - Rfid Product Id" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_product_id"}
String rfid_time "Rfid - Rfid Time" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_time"}
String rfid_serial_num "Rfid - Rfid Serial Num" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_serial_num"}
Number reboot_cause "Others - Reboot Cause" (G_airpurifier) {channel="miio:basic:airpurifier:reboot_cause"}
Number hw_version "Others - Hw Version" (G_airpurifier) {channel="miio:basic:airpurifier:hw_version"}
Number sgp_ethanol "Others - Sgp Ethanol" (G_airpurifier) {channel="miio:basic:airpurifier:sgp_ethanol"}
Number sgp_serial "Others - Sgp Serial" (G_airpurifier) {channel="miio:basic:airpurifier:sgp_serial"}
String sgp_version "Others - Sgp Version" (G_airpurifier) {channel="miio:basic:airpurifier:sgp_version"}
Number country_code "Others - Country Code" (G_airpurifier) {channel="miio:basic:airpurifier:country_code"}
Switch gesture_status "Others - Gesture Status" (G_airpurifier) {channel="miio:basic:airpurifier:gesture_status"}
```

### Mi Standing Fan (zhimi.fan.sa1) item file lines

note: Autogenerated example. Replace the id (fan) 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 @@ -348,6 +348,7 @@ public enum MiIoDevices {
ZHIMI_AIRPURIFIER_VB2("zhimi.airpurifier.vb2", "Mi Air Purifier Pro H", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_VIRTUAL("zhimi.airpurifier.virtual", "Mi Air Purifier virtual", THING_TYPE_UNSUPPORTED),
ZHIMI_AIRPURIFIER_VTL_M1("zhimi.airpurifier.vtl_m1", "Mi Air Purifier 2(Virtual)", THING_TYPE_UNSUPPORTED),
ZHIMI_AIRPURIFIER_ZA1("zhimi.airpurifier.za1", "Smartmi Air Purifier", THING_TYPE_BASIC),
ZHIMI_FAN_SA1("zhimi.fan.sa1", "Mi Standing Fan", THING_TYPE_BASIC),
ZHIMI_FAN_V1("zhimi.fan.v1", "Mi Smart Fan", THING_TYPE_BASIC),
ZHIMI_FAN_V2("zhimi.fan.v2", "Smartmi DC Pedestal Fan", THING_TYPE_BASIC),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"minimum": 0,
"maximum": 600,
"step": 1,
"pattern": "%.1f",
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
Expand Down Expand Up @@ -236,7 +236,7 @@
"stateDescription": {
"minimum": -40,
"maximum": 125,
"pattern": "%.1f",
"pattern": "%.1f %unit%",
"readOnly": true
},
"refresh": true,
Expand Down
Loading

0 comments on commit 61a3705

Please sign in to comment.