]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] Add Zhimi Heater za1 (#8743)
authorMarcel <marcelrv@users.noreply.github.com>
Wed, 14 Oct 2020 20:59:38 +0000 (22:59 +0200)
committerGitHub <noreply@github.com>
Wed, 14 Oct 2020 20:59:38 +0000 (13:59 -0700)
add model zhimi.heater.za1

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.heater.za1.json [new file with mode: 0644]

index d784961faea3c94d16966136792ec8b56caa1c5d..3392514ff86ffb9fe21147b7b5e76ec268a57fe5 100644 (file)
@@ -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 (<a name="zhimi-heater-za1">zhimi.heater.za1</a>) 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" <status>
+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"}
+```
+
 
index 2238ef3b7eeaf0c0c8580f1636ba6113e4a548ae..d596daff6c6c466ea6f77c38b0d301debeaaad35 100644 (file)
@@ -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 (file)
index 0000000..f2c924c
--- /dev/null
@@ -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
+       }
+}