From aef1d10f40f74f1e7a94280be063018987019763 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 14 Oct 2020 22:59:38 +0200 Subject: [PATCH] [miio] Add Zhimi Heater za1 (#8743) add model zhimi.heater.za1 Signed-off-by: Marcel Verpaalen --- bundles/org.openhab.binding.miio/README.md | 32 +++++ .../binding/miio/internal/MiIoDevices.java | 1 + .../resources/database/zhimi.heater.za1.json | 115 ++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za1.json diff --git a/bundles/org.openhab.binding.miio/README.md b/bundles/org.openhab.binding.miio/README.md index d784961faea..3392514ff86 100644 --- a/bundles/org.openhab.binding.miio/README.md +++ b/bundles/org.openhab.binding.miio/README.md @@ -311,6 +311,7 @@ or in case of unknown models include the model information e.g.: | Yeelight yilai ceiling | miio:basic | [yilai.light.ceiling1](#yilai-light-ceiling1) | Yes | | | Yeelight yilai ceiling | miio:basic | [yilai.light.ceiling2](#yilai-light-ceiling2) | Yes | | | Yeelight yilai ceiling | miio:basic | [yilai.light.ceiling3](#yilai-light-ceiling3) | Yes | | +| Zhimi Heater | 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 | # Advanced: Unsupported devices @@ -3021,6 +3022,20 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | customScene | String | Set Scene | | | nightlightBrightness | Number | Nightlight Brightness | | +### Zhimi Heater (zhimi.heater.za1) Channels + +| Channel | Type | Description | Comment | +|------------------|---------|-------------------------------------|------------| +| power | Switch | Power | | +| target_temperature | Number | Target Temperature | | +| brightness | Number | Brightness | | +| buzzer | Switch | Buzzer Status | | +| relative_humidity | Number | Relative Humidity | | +| childlock | Switch | Child Lock | | +| HWSwitch | Switch | HW Switch | | +| temperature | Number | Temperature | | +| usedhours | Number | Run Time | | + @@ -6260,4 +6275,21 @@ String customScene "Set Scene" (G_light) {channel="miio:basic:light:customScene" Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:basic:light:nightlightBrightness"} ``` +### Zhimi Heater (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. + +```java +Group G_heater "Zhimi Heater" +Switch power "Power" (G_heater) {channel="miio:basic:heater:power"} +Number target_temperature "Target Temperature" (G_heater) {channel="miio:basic:heater:target_temperature"} +Number brightness "Brightness" (G_heater) {channel="miio:basic:heater:brightness"} +Switch buzzer "Buzzer Status" (G_heater) {channel="miio:basic:heater:buzzer"} +Number relative_humidity "Relative Humidity" (G_heater) {channel="miio:basic:heater:relative_humidity"} +Switch childlock "Child Lock" (G_heater) {channel="miio:basic:heater:childlock"} +Switch HWSwitch "HW Switch" (G_heater) {channel="miio:basic:heater:HWSwitch"} +Number temperature "Temperature" (G_heater) {channel="miio:basic:heater:temperature"} +Number usedhours "Run Time" (G_heater) {channel="miio:basic:heater:usedhours"} +``` + 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 2238ef3b7ee..d596daff6c6 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 @@ -253,6 +253,7 @@ public enum MiIoDevices { YL_CEILING1("yilai.light.ceiling1", "Yeelight yilai ceiling", THING_TYPE_BASIC), YL_CEILING2("yilai.light.ceiling2", "Yeelight yilai ceiling", THING_TYPE_BASIC), YL_CEILING3("yilai.light.ceiling3", "Yeelight yilai ceiling", THING_TYPE_BASIC), + ZHIMI_HEATER_ZA1("zhimi.heater.za1", "Zhimi Heater", THING_TYPE_BASIC), UNKNOWN("unknown", "Unknown Mi IO Device", THING_TYPE_UNSUPPORTED); public static MiIoDevices getType(String modelString) { diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za1.json new file mode 100644 index 00000000000..f2c924cf522 --- /dev/null +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za1.json @@ -0,0 +1,115 @@ +{ + "deviceMapping": { + "id": [ + "zhimi.heater.za1" + ], + "propertyMethod": "get_prop", + "maxProperties": 2, + "channels": [ + { + "property": "power", + "friendlyName": "Power", + "channel": "power", + "type": "Switch", + "refresh": true, + "actions": [ + { + "command": "set_power", + "parameterType": "ONOFF" + } + ] + }, + { + "property": "target_temperature", + "friendlyName": "Target Temperature", + "channel": "target_temperature", + "type": "Number", + "refresh": true, + "actions": [ + { + "command": "set_target_temperature", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "brightness", + "friendlyName": "Brightness", + "channel": "brightness", + "type": "Number", + "refresh": true, + "actions": [ + { + "command": "set_brightness", + "parameterType": "NUMBER" + } + ] + }, + { + "property": "buzzer", + "friendlyName": "Buzzer Status", + "channel": "buzzer", + "type": "Switch", + "refresh": true, + "actions": [ + { + "command": "set_buzzer", + "parameterType": "ONOFF" + } + ] + }, + { + "property": "relative_humidity", + "friendlyName": "Relative Humidity", + "channel": "relative_humidity", + "type": "Number", + "refresh": true, + "actions": [] + }, + { + "property": "child_lock", + "friendlyName": "Child Lock", + "channel": "childlock", + "type": "Switch", + "refresh": true, + "actions": [ + { + "command": "set_child_lock", + "parameterType": "ONOFF" + } + ] + }, + { + "property": "theqmostat", + "friendlyName": "HW Switch", + "channel": "HWSwitch", + "type": "Switch", + "refresh": true, + "actions": [ + { + "command": "set_theqmostat", + "parameterType": "ONOFF" + } + ] + }, + { + "property": "temperature", + "friendlyName": "Temperature", + "channel": "temperature", + "type": "Number", + "refresh": true, + "actions": [] + }, + { + "property": "use_time", + "friendlyName": "Run Time", + "channel": "usedhours", + "type": "Number", + "refresh": true, + "transformation": "SecondsToHours", + "actions": [] + } + ], + "experimental": true + } +}