diff --git a/bundles/org.openhab.binding.miio/README.md b/bundles/org.openhab.binding.miio/README.md index 51944dedc10a2..064de3d512e28 100644 --- a/bundles/org.openhab.binding.miio/README.md +++ b/bundles/org.openhab.binding.miio/README.md @@ -124,6 +124,7 @@ However, for devices that are unsupported, you may override the value and try to | Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.v3](#zhimi-fan-v3) | Yes | | | Xiaomi Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.sa1](#zhimi-fan-sa1) | Yes | | | Xiaomi Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.za1](#zhimi-fan-za1) | Yes | | +| Xiaomi Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.za4](#zhimi-fan-za4) | Yes | | | Viomi Internet refrigerator iLive | miio:unsupported | viomi.fridge.v3 | No | | | Mi Smart Home Gateway v1 | miio:unsupported | lumi.gateway.v1 | No | | | Mi Smart Home Gateway v2 | miio:unsupported | lumi.gateway.v2 | No | | @@ -919,6 +920,23 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | acPower | Switch | AC Power | | move | String | Move Direction | +### Xiaomi Mi Smart Pedestal Fan (zhimi.fan.za4) Channels + +| Channel | Type | Description | +|------------------|---------|-------------------------------------| +| power | Switch | Power | +| angleEnable | Switch | Rotation | +| usedhours | Number | Run Time | +| angle | Number | Angle | +| poweroffTime | Number | Timer | +| buzzer | Number | Buzzer | +| led_b | Number | LED | +| child_lock | Switch | Child Lock | +| speedLevel | Number | Speed Level | +| speed | Number | Speed | +| naturalLevel | Number | Natural Level | +| move | String | Move Direction | + ### Mi Humdifier (zhimi.humidifier.v1) Channels | Channel | Type | Description | @@ -2429,6 +2447,26 @@ Switch acPower "AC Power" (G_fan) {channel="miio:basic:fan:acPower"} String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"} ``` +### Xiaomi Mi Smart Pedestal Fan (zhimi.fan.za4) 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. + +```java +Group G_fan "Xiaomi Mi Smart Pedestal Fan" +Switch power "Power" (G_fan) {channel="miio:basic:fan:power"} +Switch angleEnable "Rotation" (G_fan) {channel="miio:basic:fan:angleEnable"} +Number usedhours "Run Time" (G_fan) {channel="miio:basic:fan:usedhours"} +Number angle "Angle" (G_fan) {channel="miio:basic:fan:angle"} +Number poweroffTime "Timer" (G_fan) {channel="miio:basic:fan:poweroffTime"} +Number buzzer "Buzzer" (G_fan) {channel="miio:basic:fan:buzzer"} +Number led_b "LED" (G_fan) {channel="miio:basic:fan:led_b"} +Switch child_lock "Child Lock" (G_fan) {channel="miio:basic:fan:child_lock"} +Number speedLevel "Speed Level" (G_fan) {channel="miio:basic:fan:speedLevel"} +Number speed "Speed" (G_fan) {channel="miio:basic:fan:speed"} +Number naturalLevel "Natural Level" (G_fan) {channel="miio:basic:fan:naturalLevel"} +String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"} +``` + ### Mi Humdifier (zhimi.humidifier.v1) item file lines note: Autogenerated example. Replace the id (humidifier) 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 d5f1330a894ac..b7fbe5393ab14 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 @@ -73,6 +73,7 @@ public enum MiIoDevices { FAN3("zhimi.fan.v3", "Mi Smart Pedestal Fan", THING_TYPE_BASIC), FAN_SA1("zhimi.fan.sa1", "Xiaomi Mi Smart Pedestal Fan", THING_TYPE_BASIC), FAN_ZA1("zhimi.fan.za1", "Xiaomi Mi Smart Pedestal Fan", THING_TYPE_BASIC), + FAN_ZA4("zhimi.fan.za4", "Xiaomi Mi Smart Pedestal Fan", THING_TYPE_BASIC), FRIDGE_V3("viomi.fridge.v3", "Viomi Internet refrigerator iLive", THING_TYPE_UNSUPPORTED), GATEWAY1("lumi.gateway.v1", "Mi Smart Home Gateway v1", THING_TYPE_UNSUPPORTED), GATEWAY2("lumi.gateway.v2", "Mi Smart Home Gateway v2", THING_TYPE_UNSUPPORTED), diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.za4.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.za4.json new file mode 100644 index 0000000000000..d6d63cd7fb8c1 --- /dev/null +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.za4.json @@ -0,0 +1,171 @@ +{ + "deviceMapping": { + "id": [ + "zhimi.fan.za4" + ], + "channels": [ + { + "property": "power", + "friendlyName": "Power", + "channel": "power", + "type": "Switch", + "refresh": true, + "actions": [ + { + "command": "set_power", + "parameterType": "ONOFF" + } + ] + }, + { + "property": "angle_enable", + "friendlyName": "Rotation", + "channel": "angleEnable", + "type": "Switch", + "refresh": true, + "actions": [ + { + "command": "set_angle_enable", + "parameterType": "ONOFF" + } + ] + }, + { + "property": "use_time", + "friendlyName": "Run Time", + "channel": "usedhours", + "type": "Number", + "refresh": true, + "transformation": "SecondsToHours", + "ChannelGroup": "Status", + "actions": [] + }, + { + "property": "angle", + "friendlyName": "Angle", + "channel": "angle", + "type": "Number", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_angle", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "poweroff_time", + "friendlyName": "Timer", + "channel": "poweroffTime", + "type": "Number", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_poweroff_time", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "buzzer", + "friendlyName": "Buzzer", + "channel": "buzzer", + "type": "Number", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_buzzer", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "led_b", + "friendlyName": "LED", + "channel": "led_b", + "type": "Number", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_led_b", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "child_lock", + "friendlyName": "Child Lock", + "channel": "child_lock", + "type": "Switch", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_child_lock", + "parameterType": "ONOFF" + } + ] + }, + { + "property": "speed_level", + "friendlyName": "Speed Level", + "channel": "speedLevel", + "type": "Number", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_speed_level", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "speed", + "friendlyName": "Speed", + "channel": "speed", + "type": "Number", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_speed", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "natural_level", + "friendlyName": "Natural Level", + "channel": "naturalLevel", + "type": "Number", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_natural_level", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "", + "friendlyName": "Move Direction", + "channel": "move", + "type": "String", + "refresh": true, + "ChannelGroup": "actions", + "actions": [ + { + "command": "set_move", + "parameterType": "STRING" + } + ] + } + ] + } +}