]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] enable telnet for lumi gateway (#8639)
authorMarcel <marcelrv@users.noreply.github.com>
Sun, 4 Oct 2020 16:31:56 +0000 (18:31 +0200)
committerGitHub <noreply@github.com>
Sun, 4 Oct 2020 16:31:56 +0000 (09:31 -0700)
* [miio] enable telnet for lumi gateway

* allow enable telnet and some other functions on gateway
* use new fw as default for chugmi plug

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/chuangmi.plug.v3.json
bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3fw.json
bundles/org.openhab.binding.miio/src/main/resources/database/lumi.gateway.json [new file with mode: 0644]

index f0f70db857401ae057e908ffec356a63881a99b8..f64e5383e09922cdc896a731d3ba90d5807e6703 100644 (file)
@@ -140,9 +140,10 @@ or in case of unknown models include the model information e.g.:
 | Xiaomi Mijia Smart Tower Fan | miio:basic       | [dmaker.fan.p9](#dmaker-fan-p9) | Yes       |            |
 | Xiaomi Mijia Smart Tower Fan | miio:basic       | [dmaker.fan.p10](#dmaker-fan-p10) | 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        |            |
-| Mi Smart Home Gateway v3     | miio:unsupported | lumi.gateway.v3        | No        |            |
+| Mi Smart Home Gateway v1     | miio:basic       | [lumi.gateway.v1](#lumi-gateway-v1) | Yes       |            |
+| Mi Smart Home Gateway v2     | miio:basic       | [lumi.gateway.v2](#lumi-gateway-v2) | Yes       |            |
+| Mi Smart Home Gateway v3     | miio:basic       | [lumi.gateway.v3](#lumi-gateway-v3) | Yes       |            |
+| Xiaomi Mi Mijia Gateway V3 ZNDMWG03LM | miio:basic       | [lumi.gateway.mgl03](#lumi-gateway-mgl03) | Yes       |            |
 | Mi Humdifier                 | miio:basic       | [zhimi.humidifier.v1](#zhimi-humidifier-v1) | Yes       |            |
 | Light Control (Wall Switch)  | miio:unsupported | lumi.ctrl_neutral1.v1  | No        |            |
 | Light Control (Wall Switch)  | miio:unsupported | lumi.ctrl_neutral2.v1  | No        |            |
@@ -1067,6 +1068,46 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena
 | SpeedLevel       | Number  | Fan-Speed Level                     |
 | PhysicalControlsLocked | Switch  | Physical Control Locked-Physical Control Locked |
 
+### Mi Smart Home Gateway v1 (<a name="lumi-gateway-v1">lumi.gateway.v1</a>) Channels
+
+| Channel          | Type    | Description                         |
+|------------------|---------|-------------------------------------|
+| telnetEnable     | Switch  | Enable Telnet                       |
+| doorbellVol      | Number  | Doorbell Volume                     |
+| gatewayVol       | Number  | Gateway Volume                      |
+| alarmingVol      | Number  | Alarming Volume                     |
+| doorbellPush     | String  | Doorbell Push                       |
+
+### Mi Smart Home Gateway v2 (<a name="lumi-gateway-v2">lumi.gateway.v2</a>) Channels
+
+| Channel          | Type    | Description                         |
+|------------------|---------|-------------------------------------|
+| telnetEnable     | Switch  | Enable Telnet                       |
+| doorbellVol      | Number  | Doorbell Volume                     |
+| gatewayVol       | Number  | Gateway Volume                      |
+| alarmingVol      | Number  | Alarming Volume                     |
+| doorbellPush     | String  | Doorbell Push                       |
+
+### Mi Smart Home Gateway v3 (<a name="lumi-gateway-v3">lumi.gateway.v3</a>) Channels
+
+| Channel          | Type    | Description                         |
+|------------------|---------|-------------------------------------|
+| telnetEnable     | Switch  | Enable Telnet                       |
+| doorbellVol      | Number  | Doorbell Volume                     |
+| gatewayVol       | Number  | Gateway Volume                      |
+| alarmingVol      | Number  | Alarming Volume                     |
+| doorbellPush     | String  | Doorbell Push                       |
+
+### Xiaomi Mi Mijia Gateway V3 ZNDMWG03LM (<a name="lumi-gateway-mgl03">lumi.gateway.mgl03</a>) Channels
+
+| Channel          | Type    | Description                         |
+|------------------|---------|-------------------------------------|
+| telnetEnable     | Switch  | Enable Telnet                       |
+| doorbellVol      | Number  | Doorbell Volume                     |
+| gatewayVol       | Number  | Gateway Volume                      |
+| alarmingVol      | Number  | Alarming Volume                     |
+| doorbellPush     | String  | Doorbell Push                       |
+
 ### Mi Humdifier (<a name="zhimi-humidifier-v1">zhimi.humidifier.v1</a>) Channels
 
 | Channel          | Type    | Description                         |
@@ -2806,6 +2847,58 @@ Number SpeedLevel "Fan-Speed Level" (G_fan) {channel="miio:basic:fan:SpeedLevel"
 Switch PhysicalControlsLocked "Physical Control Locked-Physical Control Locked" (G_fan) {channel="miio:basic:fan:PhysicalControlsLocked"}
 ```
 
+### Mi Smart Home Gateway v1 (lumi.gateway.v1) item file lines
+
+note: Autogenerated example. Replace the id (gateway) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.
+
+```java
+Group G_gateway "Mi Smart Home Gateway v1" <status>
+Switch telnetEnable "Enable Telnet" (G_gateway) {channel="miio:basic:gateway:telnetEnable"}
+Number doorbellVol "Doorbell Volume" (G_gateway) {channel="miio:basic:gateway:doorbellVol"}
+Number gatewayVol "Gateway Volume" (G_gateway) {channel="miio:basic:gateway:gatewayVol"}
+Number alarmingVol "Alarming Volume" (G_gateway) {channel="miio:basic:gateway:alarmingVol"}
+String doorbellPush "Doorbell Push" (G_gateway) {channel="miio:basic:gateway:doorbellPush"}
+```
+
+### Mi Smart Home Gateway v2 (lumi.gateway.v2) item file lines
+
+note: Autogenerated example. Replace the id (gateway) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.
+
+```java
+Group G_gateway "Mi Smart Home Gateway v2" <status>
+Switch telnetEnable "Enable Telnet" (G_gateway) {channel="miio:basic:gateway:telnetEnable"}
+Number doorbellVol "Doorbell Volume" (G_gateway) {channel="miio:basic:gateway:doorbellVol"}
+Number gatewayVol "Gateway Volume" (G_gateway) {channel="miio:basic:gateway:gatewayVol"}
+Number alarmingVol "Alarming Volume" (G_gateway) {channel="miio:basic:gateway:alarmingVol"}
+String doorbellPush "Doorbell Push" (G_gateway) {channel="miio:basic:gateway:doorbellPush"}
+```
+
+### Mi Smart Home Gateway v3 (lumi.gateway.v3) item file lines
+
+note: Autogenerated example. Replace the id (gateway) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.
+
+```java
+Group G_gateway "Mi Smart Home Gateway v3" <status>
+Switch telnetEnable "Enable Telnet" (G_gateway) {channel="miio:basic:gateway:telnetEnable"}
+Number doorbellVol "Doorbell Volume" (G_gateway) {channel="miio:basic:gateway:doorbellVol"}
+Number gatewayVol "Gateway Volume" (G_gateway) {channel="miio:basic:gateway:gatewayVol"}
+Number alarmingVol "Alarming Volume" (G_gateway) {channel="miio:basic:gateway:alarmingVol"}
+String doorbellPush "Doorbell Push" (G_gateway) {channel="miio:basic:gateway:doorbellPush"}
+```
+
+### Xiaomi Mi Mijia Gateway V3 ZNDMWG03LM (lumi.gateway.mgl03) item file lines
+
+note: Autogenerated example. Replace the id (gateway) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.
+
+```java
+Group G_gateway "Xiaomi Mi Mijia Gateway V3 ZNDMWG03LM" <status>
+Switch telnetEnable "Enable Telnet" (G_gateway) {channel="miio:basic:gateway:telnetEnable"}
+Number doorbellVol "Doorbell Volume" (G_gateway) {channel="miio:basic:gateway:doorbellVol"}
+Number gatewayVol "Gateway Volume" (G_gateway) {channel="miio:basic:gateway:gatewayVol"}
+Number alarmingVol "Alarming Volume" (G_gateway) {channel="miio:basic:gateway:alarmingVol"}
+String doorbellPush "Doorbell Push" (G_gateway) {channel="miio:basic:gateway:doorbellPush"}
+```
+
 ### 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.
index ff7d0933dfc5412ffd732296f52365f5d1d87107..1dafc594095df792e45527d45bae7168a7f1bbec 100644 (file)
@@ -81,9 +81,10 @@ public enum MiIoDevices {
     FAN_P9("dmaker.fan.p9", "Xiaomi Mijia Smart Tower Fan", THING_TYPE_BASIC),
     FAN_P10("dmaker.fan.p10", "Xiaomi Mijia Smart Tower 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),
-    GATEWAY3("lumi.gateway.v3", "Mi Smart Home Gateway v3", THING_TYPE_UNSUPPORTED),
+    GATEWAY1("lumi.gateway.v1", "Mi Smart Home Gateway v1", THING_TYPE_BASIC),
+    GATEWAY2("lumi.gateway.v2", "Mi Smart Home Gateway v2", THING_TYPE_BASIC),
+    GATEWAY3("lumi.gateway.v3", "Mi Smart Home Gateway v3", THING_TYPE_BASIC),
+    GATEWAY_MGL3("lumi.gateway.mgl03", "Xiaomi Mi Mijia Gateway V3 ZNDMWG03LM", THING_TYPE_BASIC),
     HUMIDIFIER("zhimi.humidifier.v1", "Mi Humdifier", THING_TYPE_BASIC),
     LUMI_C11("lumi.ctrl_neutral1.v1", "Light Control (Wall Switch)", THING_TYPE_UNSUPPORTED),
     LUMI_C12("lumi.ctrl_neutral2.v1", "Light Control (Wall Switch)", THING_TYPE_UNSUPPORTED),
index d1a54e45da1ef3930bf72dd38cd53e942fbd2459..8ef70ddc3fbef331ff48b632cd07bdd2f39daf2c 100644 (file)
@@ -1,7 +1,7 @@
 {
        "deviceMapping": {
                "id": [
-                       "chuangmi.plug.v3"
+                       "chuangmi.plug.v3old"
                ],
                "channels": [
                        {
index 60c67f399f02f8d306f6c7a1fa3e4af428fe8701..295825b1473b5c927c3855170d06993dfde54e05 100644 (file)
@@ -1,6 +1,7 @@
 {
        "deviceMapping": {
                "id": [
+                       "chuangmi.plug.v3",
                        "chuangmi.plug.v3fw"
                ],
                "channels": [
diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/lumi.gateway.json b/bundles/org.openhab.binding.miio/src/main/resources/database/lumi.gateway.json
new file mode 100644 (file)
index 0000000..5a8b0b1
--- /dev/null
@@ -0,0 +1,80 @@
+{
+       "deviceMapping": {
+               "id": [
+                       "lumi.gateway.v1",
+                       "lumi.gateway.v2",
+                       "lumi.gateway.v3",
+                       "lumi.gateway.mgl03"
+               ],
+               "propertyMethod": "get_prop",
+               "maxProperties": 4,
+               "channels": [
+                       {
+                               "property": "",
+                               "friendlyName": "Enable Telnet",
+                               "channel": "telnetEnable",
+                               "type": "Switch",
+                               "refresh": false,
+                               "actions": [
+                                       {
+                                               "command": "enable_telnet_service",
+                                               "parameterType": "EMPTY"
+                                       }
+                               ]
+                       },
+                       {
+                "property": "doorbell_volume",
+                "friendlyName": "Doorbell Volume",
+                "channel": "doorbellVol",
+                "type": "Number",
+                "refresh": true,
+                "actions": [
+                    {
+                        "command": "set_doorbell_volume",
+                        "parameterType": "NUMBER"
+                    }
+                ]
+            },
+            {
+                "property": "gateway_volume",
+                "friendlyName": "Gateway Volume",
+                "channel": "gatewayVol",
+                "type": "Number",
+                "refresh": true,
+                "actions": [
+                    {
+                        "command": "set_gateway_volume",
+                        "parameterType": "NUMBER"
+                    }
+                ]
+            },
+            {
+                "property": "alarming_volume",
+                "friendlyName": "Alarming Volume",
+                "channel": "alarmingVol",
+                "type": "Number",
+                "refresh": true,
+                "actions": [
+                    {
+                        "command": "set_alarming_volume",
+                        "parameterType": "NUMBER"
+                    }
+                ]
+            },
+            {
+                "property": "doorbell_push",
+                "friendlyName": "Doorbell Push",
+                "channel": "doorbellPush",
+                "type": "String",
+                "refresh": true,
+                "actions": [
+                    {
+                        "command": "set_doorbell_push",
+                        "parameterType": "STRING"
+                    }
+                ]
+            }
+                       
+               ]
+       }
+}