]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] add support for Smartmi Standing Fan 3 zhimi.fan.za5 (#10229)
authorMarcel <marcel@verpaalen.com>
Thu, 25 Feb 2021 18:30:48 +0000 (19:30 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Feb 2021 18:30:48 +0000 (10:30 -0800)
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/resources/database/zhimi.fan.za5-miot.json [new file with mode: 0644]

index 4a328b228d656556415e4605e537b7f73d6109da..1dbce4e75799676c408a47cafe9ed069bc48611a 100644 (file)
@@ -465,6 +465,7 @@ Currently the miio binding supports more than 270 different models.
 | Smartmi Inverter Pedestal Fan | miio:basic       | [zhimi.fan.za1](#zhimi-fan-za1) | Yes       |            |
 | Smartmi Standing Fan 2       | miio:basic       | [zhimi.fan.za3](#zhimi-fan-za3) | Yes       |            |
 | Smartmi Standing Fan 2S      | miio:basic       | [zhimi.fan.za4](#zhimi-fan-za4) | Yes       |            |
+| Smartmi Standing Fan 3       | miio:basic       | [zhimi.fan.za5](#zhimi-fan-za5) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
 | Smartmi Radiant Heater Smart Version | miio:basic       | [zhimi.heater.za1](#zhimi-heater-za1) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
 | Smartmi Smart Convector Heater 1S | miio:basic       | [zhimi.heater.za2](#zhimi-heater-za2) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
 | Smartmi Smart Convector Heater 1S | miio:basic       | [zhimi.heater.zb1](#zhimi-heater-zb1) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
@@ -4378,6 +4379,28 @@ e.g. `openhab:send actionCommand 'upd_timer["1498595904821", "on"]'` would enabl
 | naturalLevel         | Number               | Natural Level                            |            |
 | move                 | String               | Move Direction                           |            |
 
+### Smartmi Standing Fan 3  (<a name="zhimi-fan-za5">zhimi.fan.za5</a>) Channels
+
+| Channel              | Type                 | Description                              | Comment    |
+|----------------------|----------------------|------------------------------------------|------------|
+| on                   | Switch               | Fan - Power                              |            |
+| fan_level            | Number               | Fan - Fan Level                          | Value mapping ["1"="Level 1","2"="Level 2","3"="Level 3","4"="Level 4"] |
+| horizontal_swing     | Switch               | Fan - Horizontal Swing                   |            |
+| horizontal_angle     | Number               | Fan - Horizontal Angle                   |            |
+| mode                 | Number               | Fan - Mode                               | Value mapping ["0"="Natural Wind","1"="Straight Wind"] |
+| off_delay            | Number               | Fan - Power Off Delay                    |            |
+| anion                | Switch               | Fan - Anion                              |            |
+| physical_controls_locked | Switch               | Physical Control Locked - Physical Control Locked |            |
+| brightness           | Number:Dimensionless | Indicator Light - Brightness             |            |
+| alarm                | Switch               | Alarm - Alarm                            |            |
+| relative_humidity    | Number:Dimensionless | Environment - Relative Humidity          |            |
+| temperature          | Number:Temperature   | Environment - Temperature                |            |
+| button_press         | Number               | Custom Service - Button Press            | Value mapping ["1"="power","2"="swing","0"="No Button Pressed"] |
+| battery_state        | Switch               | Custom Service - Battery State           |            |
+| speed_now            | Number               | Custom Service - Speed Now               |            |
+| ac_state             | Switch               | Custom Service - Ac State                |            |
+| speed_level          | Number:Dimensionless | Custom Service - Speed Level             |            |
+
 ### Smartmi Radiant Heater Smart Version (<a name="zhimi-heater-za1">zhimi.heater.za1</a>) Channels
 
 | Channel              | Type                 | Description                              | Comment    |
@@ -9199,6 +9222,31 @@ Number naturalLevel "Natural Level" (G_fan) {channel="miio:basic:fan:naturalLeve
 String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"}
 ```
 
+### Smartmi Standing Fan 3  (zhimi.fan.za5) 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.
+
+```
+Group G_fan "Smartmi Standing Fan 3 " <status>
+Switch on "Fan - Power" (G_fan) {channel="miio:basic:fan:on"}
+Number fan_level "Fan - Fan Level" (G_fan) {channel="miio:basic:fan:fan_level"}
+Switch horizontal_swing "Fan - Horizontal Swing" (G_fan) {channel="miio:basic:fan:horizontal_swing"}
+Number horizontal_angle "Fan - Horizontal Angle" (G_fan) {channel="miio:basic:fan:horizontal_angle"}
+Number mode "Fan - Mode" (G_fan) {channel="miio:basic:fan:mode"}
+Number off_delay "Fan - Power Off Delay" (G_fan) {channel="miio:basic:fan:off_delay"}
+Switch anion "Fan - Anion" (G_fan) {channel="miio:basic:fan:anion"}
+Switch physical_controls_locked "Physical Control Locked - Physical Control Locked" (G_fan) {channel="miio:basic:fan:physical_controls_locked"}
+Number:Dimensionless brightness "Indicator Light - Brightness" (G_fan) {channel="miio:basic:fan:brightness"}
+Switch alarm "Alarm - Alarm" (G_fan) {channel="miio:basic:fan:alarm"}
+Number:Dimensionless relative_humidity "Environment - Relative Humidity" (G_fan) {channel="miio:basic:fan:relative_humidity"}
+Number:Temperature temperature "Environment - Temperature" (G_fan) {channel="miio:basic:fan:temperature"}
+Number button_press "Custom Service - Button Press" (G_fan) {channel="miio:basic:fan:button_press"}
+Switch battery_state "Custom Service - Battery State" (G_fan) {channel="miio:basic:fan:battery_state"}
+Number speed_now "Custom Service - Speed Now" (G_fan) {channel="miio:basic:fan:speed_now"}
+Switch ac_state "Custom Service - Ac State" (G_fan) {channel="miio:basic:fan:ac_state"}
+Number:Dimensionless speed_level "Custom Service - Speed Level" (G_fan) {channel="miio:basic:fan:speed_level"}
+```
+
 ### Smartmi Radiant Heater Smart Version (zhimi.heater.za1) item file lines
 
 note: Autogenerated example. Replace the id (heater) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.
index 1125f9e5236dd94e4139a58dbe26f1eca1813336..ec4f268d14981f0071b9ef6bf132dc317b9d0005 100644 (file)
@@ -349,6 +349,7 @@ public enum MiIoDevices {
     ZHIMI_FAN_ZA1("zhimi.fan.za1", "Smartmi Inverter Pedestal Fan", THING_TYPE_BASIC),
     ZHIMI_FAN_ZA3("zhimi.fan.za3", "Smartmi Standing Fan 2", THING_TYPE_BASIC),
     ZHIMI_FAN_ZA4("zhimi.fan.za4", "Smartmi Standing Fan 2S", THING_TYPE_BASIC),
+    ZHIMI_FAN_ZA5("zhimi.fan.za5", "Smartmi Standing Fan 3 ", THING_TYPE_BASIC),
     ZHIMI_HEATER_ZA1("zhimi.heater.za1", "Smartmi Radiant Heater Smart Version", THING_TYPE_BASIC),
     ZHIMI_HEATER_ZA2("zhimi.heater.za2", "Smartmi Smart Convector Heater 1S", THING_TYPE_BASIC),
     ZHIMI_HEATER_ZB1("zhimi.heater.zb1", "Smartmi Smart Convector Heater 1S", THING_TYPE_BASIC),
diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.za5-miot.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.za5-miot.json
new file mode 100644 (file)
index 0000000..a5e92ab
--- /dev/null
@@ -0,0 +1,361 @@
+{
+       "deviceMapping": {
+               "id": [
+                       "zhimi.fan.za5"
+               ],
+               "propertyMethod": "get_properties",
+               "maxProperties": 1,
+               "channels": [
+                       {
+                               "property": "on",
+                               "siid": 2,
+                               "piid": 1,
+                               "friendlyName": "Fan - Power",
+                               "channel": "on",
+                               "type": "Switch",
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "ONOFFBOOL"
+                                       }
+                               ],
+                               "category": "switch",
+                               "tags": [
+                                       "Switch"
+                               ]
+                       },
+                       {
+                               "property": "fan-level",
+                               "siid": 2,
+                               "piid": 2,
+                               "friendlyName": "Fan - Fan Level",
+                               "channel": "fan_level",
+                               "type": "Number",
+                               "stateDescription": {
+                                       "options": [
+                                               {
+                                                       "value": "1",
+                                                       "label": "Level 1"
+                                               },
+                                               {
+                                                       "value": "2",
+                                                       "label": "Level 2"
+                                               },
+                                               {
+                                                       "value": "3",
+                                                       "label": "Level 3"
+                                               },
+                                               {
+                                                       "value": "4",
+                                                       "label": "Level 4"
+                                               }
+                                       ]
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ],
+                               "readmeComment": "Value mapping [\"1\"\u003d\"Level 1\",\"2\"\u003d\"Level 2\",\"3\"\u003d\"Level 3\",\"4\"\u003d\"Level 4\"]"
+                       },
+                       {
+                               "property": "horizontal-swing",
+                               "siid": 2,
+                               "piid": 3,
+                               "friendlyName": "Fan - Horizontal Swing",
+                               "channel": "horizontal_swing",
+                               "type": "Switch",
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "ONOFFBOOL"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "horizontal-angle",
+                               "siid": 2,
+                               "piid": 5,
+                               "friendlyName": "Fan - Horizontal Angle",
+                               "channel": "horizontal_angle",
+                               "type": "Number",
+                               "stateDescription": {
+                                       "minimum": 30,
+                                       "maximum": 120,
+                                       "step": 1,
+                                       "pattern": "%.0f"
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "STRING"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "mode",
+                               "siid": 2,
+                               "piid": 7,
+                               "friendlyName": "Fan - Mode",
+                               "channel": "mode",
+                               "type": "Number",
+                               "stateDescription": {
+                                       "options": [
+                                               {
+                                                       "value": "0",
+                                                       "label": "Natural Wind"
+                                               },
+                                               {
+                                                       "value": "1",
+                                                       "label": "Straight Wind"
+                                               }
+                                       ]
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ],
+                               "readmeComment": "Value mapping [\"0\"\u003d\"Natural Wind\",\"1\"\u003d\"Straight Wind\"]"
+                       },
+                       {
+                               "property": "off-delay",
+                               "siid": 2,
+                               "piid": 10,
+                               "friendlyName": "Fan - Power Off Delay",
+                               "channel": "off_delay",
+                               "type": "Number",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 36000,
+                                       "step": 1,
+                                       "pattern": "%.0f"
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "STRING"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "anion",
+                               "siid": 2,
+                               "piid": 11,
+                               "friendlyName": "Fan - Anion",
+                               "channel": "anion",
+                               "type": "Switch",
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "ONOFFBOOL"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "physical-controls-locked",
+                               "siid": 3,
+                               "piid": 1,
+                               "friendlyName": "Physical Control Locked - Physical Control Locked",
+                               "channel": "physical_controls_locked",
+                               "type": "Switch",
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "ONOFFBOOL"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "brightness",
+                               "siid": 4,
+                               "piid": 3,
+                               "friendlyName": "Indicator Light - Brightness",
+                               "channel": "brightness",
+                               "type": "Number:Dimensionless",
+                               "unit": "percentage",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 100,
+                                       "step": 1,
+                                       "pattern": "%.0f %unit%"
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ],
+                               "category": "light",
+                               "tags": [
+                                       "Control",
+                                       "Light"
+                               ]
+                       },
+                       {
+                               "property": "alarm",
+                               "siid": 5,
+                               "piid": 1,
+                               "friendlyName": "Alarm - Alarm",
+                               "channel": "alarm",
+                               "type": "Switch",
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "ONOFFBOOL"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "relative-humidity",
+                               "siid": 7,
+                               "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": [],
+                               "tags": [
+                                       "Measurement",
+                                       "Humidity"
+                               ]
+                       },
+                       {
+                               "property": "temperature",
+                               "siid": 7,
+                               "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": [],
+                               "category": "temperature",
+                               "tags": [
+                                       "Setpoint",
+                                       "Temperature"
+                               ]
+                       },
+                       {
+                               "property": "button-press",
+                               "siid": 6,
+                               "piid": 1,
+                               "friendlyName": "Custom Service - Button Press",
+                               "channel": "button_press",
+                               "type": "Number",
+                               "stateDescription": {
+                                       "readOnly": true,
+                                       "options": [
+                                               {
+                                                       "value": "1",
+                                                       "label": "power"
+                                               },
+                                               {
+                                                       "value": "2",
+                                                       "label": "swing"
+                                               },
+                                               {
+                                                       "value": "0",
+                                                       "label": "No Button Pressed"
+                                               }
+                                       ]
+                               },
+                               "refresh": true,
+                               "actions": [],
+                               "readmeComment": "Value mapping [\"1\"\u003d\"power\",\"2\"\u003d\"swing\",\"0\"\u003d\"No Button Pressed\"]"
+                       },
+                       {
+                               "property": "battery-state",
+                               "siid": 6,
+                               "piid": 2,
+                               "friendlyName": "Custom Service - Battery State",
+                               "channel": "battery_state",
+                               "type": "Switch",
+                               "stateDescription": {
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "speed-now",
+                               "siid": 6,
+                               "piid": 4,
+                               "friendlyName": "Custom Service - Speed Now",
+                               "channel": "speed_now",
+                               "type": "Number",
+                               "stateDescription": {
+                                       "minimum": 0,
+                                       "maximum": 3000,
+                                       "step": 1,
+                                       "pattern": "%.0f",
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "ac-state",
+                               "siid": 6,
+                               "piid": 5,
+                               "friendlyName": "Custom Service - Ac State",
+                               "channel": "ac_state",
+                               "type": "Switch",
+                               "stateDescription": {
+                                       "readOnly": true
+                               },
+                               "refresh": true,
+                               "actions": []
+                       },
+                       {
+                               "property": "speed-level",
+                               "siid": 6,
+                               "piid": 8,
+                               "friendlyName": "Custom Service - Speed Level",
+                               "channel": "speed_level",
+                               "type": "Number:Dimensionless",
+                               "unit": "percent",
+                               "stateDescription": {
+                                       "minimum": 1,
+                                       "maximum": 100,
+                                       "step": 1,
+                                       "pattern": "%.0f %unit%"
+                               },
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_properties",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ]
+                       }
+               ],
+               "experimental": true
+       }
+}