Xiaomi Control Hub Not Compatible Anymore

Just in case other people is thinking on getting a Xiaomi starter kit to get started with OpenHAB, it seems like the hub is no longer compatible.

The problem seems to be that the development mode cannot be enabled anymore.

The model sold in EU is DGNWG05lm

The OpenHAB documentation of bindings is too old. Some threads in this forum discussed this problem years ago.

Sad that Xiaomi locks down their devices to developers.

2 Likes

If someone donates a such a device (or maybe few folks with a bounty https://www.bountysource.com/teams/openhab) I believe I’m able to create the support for this gateway by extending the miio binding or the mihome binding.

@marcel_verpaalen have you looked into this? It seems much more complex than the way it used to be.

People is resorting to opening the device, gaining root access from the serial console and replacing firmware or part of the firmware.

this is the most advanced thread I have found related to this issue:

there are also some russian hackers that are installing openwrt and implementing an alternative gateway…

but, I don’t know, development on Xiaomi devices should be allowed without drama.

Yes, I’m aware of that it is not opening the way the regular mihome binding is allowing the connectivity.

My approach would be different indeed and using the cloud connectivity just like the mihome application is doing. Obviously I cant 100% guarantee success, but I’m fairly confident this will work.

interesting @marcel_verpaalen

More than donating devices or money I am interested in contributing, at the end of the day for me thinkering is the very reason why I am getting into OpenHAB.

I am however very thankful for your offer and if I don’t make or see any progress I will definitely send you my Hub before leaving it in a drawer.

@rvalle Yes, contributing is even more useful :+1:
You can definitely try yourself as well.

Now that the cloud connectivity is merged into the OH3 snapshot it is possible to send commands to your device I think.

As a first step for trial & error can run the latest OH3 snapshot, let your device be discovered by the miio binding (will be marked as unsupported). Than go to the config of the thing, change the communication to cloud and overwrite the model with lumi.gateway.v1.
Than test to see if the commands are accepted. If they are accepted, it would be a good confirmation that the concept is working.

Than you can continue with other commands (to control your devices) for debugging/development/ sending commands you could compile:
https://github.com/marcelrv/openhab2/tree/miio-cloudrequest
this was already included in te cloud PR, so no need to compile, just use the most recent snapshot build and use the (advanced) rpc channel

Yes, I will definitely try OH3 snapshot.

When selecting cloud communication: Would that mean that all the communication goes via the xiaomi cloud?

Or that the cloud is used to grant access to the device?

The first indeed. The assumption of mine is that this device does not allow local communication.
btw, the device already has cloud access if you can control it with the mihome app, the binding does not influence that.

So with the new feature of having communication via cloud, we mimic what the mihome app is doing.
This is why I believe unlike the other approaches that this can be successful.

I am not using it until its OpenHAB’ed …

For now I am going to attempt to use the rest of the xiaomi items using the zigbee2mqtt tasmota bridge. Then I will see what to do with the Hub.

The hub it is a nice device by itself: light, sound, etc.

Yes, I think it can be added to OpenHAB via its cloud at least as an intermediate step, to learn, hack, etc.

In the long run I don’t want any device leaking home data, but that is a personal preference.

Recognizable… I also have few ZigBee devices from Xiaomi but never felt the need for a hub as I’m also using zigbee2mqtt.
Likewise I try to avoid all devices that can’t live without cloud

I have same issue after recent upgrade. I have 3 Xiaomi gen 2 gateways and I have activated developer mode previously and now the menu is gone. Broadcast function is still active. Can it be just blocked by the Mi Home app?

If there was no firmware upgrade in between it must have been removed by the app only.
In that case, the good news is that you will still be able to unlock it by sending the right command to the device via miio binding

hi @marcel_verpaalen

I have now been running sonoff zigbee bridge for some weeks, and I am happy with it. Also ordered a zigbee siren…

I still would like to get the sonoff rf bridge to work with kerui, etc.

Not sure I want to put time on this control hub, and definitely I don’t want to leak data to any cloud. So, maybe its better that I donate it to you if you are doing to work on this.

I’m certainly willing to give it a try… as long as the corona keeps us at home I’m bit bored and do all sorts of little projects to keep myself busy…

2 Likes

@marcel_verpaalen I’ve followed your instructions to connect miio binding with lumi gateway EU, here are the files that were created by the binding:

miioTokens-de.json
{"code":0,"message":"ok","result":{"list":[{"did":"*****","token":"*******","longitude":"0.00000000","latitude":"0.00000000","name":"Mi Control Hub","pid":"0","localip":"192.168.131.16","mac":"50:EC:50:EE:52:75","ssid":"Aveiro-Guest","bssid":"E0:63:DA:71:21:E3","parent_id":"","parent_model":"","show_mode":1,"model":"lumi.gateway.mieu01","adminFlag":1,"shareFlag":0,"permitLevel":16,"isOnline":true,"desc":"Device online ","extra":{"isSetPincode":0,"fw_version":"3.5.8_147","needVerifyCode":0,"isPasswordEncrypt":0,"mcu_version":"0143"},"uid":6361316538,"pd_id":657,"password":"","p2p_id":"","rssi":0,"family_id":0,"reset_flag":0},{"did":"lumi.158d00049dc9f1","token":"","longitude":"0.00000000","latitude":"0.00000000","name":"Water Leak Sensor","pid":"3","localip":"","mac":"","ssid":"Aveiro-Guest","bssid":"E0:63:DA:71:21:E3","parent_id":"275954150","parent_model":"lumi.gateway.mieu01","show_mode":1,"model":"lumi.sensor_wleak.aq1","adminFlag":1,"shareFlag":0,"permitLevel":16,"isOnline":false,"desc":"Device offline ","extra":{"isSetPincode":0},"uid":6361316538,"pd_id":385,"password":"","p2p_id":"","rssi":0,"family_id":0,"reset_flag":0}]}}

lumi.gateway.mieu01-experimental.json

{
  "deviceMapping": {
    "id": [
      "lumi.gateway.mieu01"
    ],
    "propertyMethod": "get_prop",
    "maxProperties": 2,
    "channels": [
      {
        "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"
          }
        ]
      },
      {
        "property": "rgb",
        "friendlyName": "RGB Color",
        "channel": "rgbColor",
        "type": "Color",
        "refresh": true,
        "ChannelGroup": "actions",
        "actions": [
          {
            "command": "set_rgb",
            "parameterType": "COLOR",
            "parameters": [
              "$value$",
              "smooth",
              500
            ],
            "condition": {
              "name": "HSBOnly"
            }
          },
          {
            "command": "set_bright",
            "parameterType": "NUMBER",
            "condition": {
              "name": "BrightnessExisting"
            }
          },
          {
            "command": "set_power",
            "parameterType": "ONOFF",
            "condition": {
              "name": "BrightnessOnOff"
            }
          }
        ],
        "category": "colorpicker",
        "tags": [
          "Control",
          "Light"
        ]
      },
      {
        "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": "gatewayVol0",
        "type": "Number",
        "refresh": true,
        "actions": [
          {
            "command": "set_gateway_volume",
            "parameterType": "NUMBER"
          }
        ]
      },
      {
        "property": "alarming_volume",
        "friendlyName": "Alarming Volume",
        "channel": "alarmingVol1",
        "type": "Number",
        "refresh": true,
        "actions": [
          {
            "command": "set_alarming_volume",
            "parameterType": "NUMBER"
          }
        ]
      },
      {
        "property": "doorbell_push",
        "friendlyName": "Doorbell Push",
        "channel": "doorbellPush2",
        "type": "String",
        "refresh": true,
        "actions": [
          {
            "command": "set_doorbell_push",
            "parameterType": "STRING"
          }
        ]
      },
      {
        "property": "rgb",
        "friendlyName": "RGB Color",
        "channel": "rgbColor3",
        "type": "Color",
        "refresh": true,
        "ChannelGroup": "actions",
        "actions": [
          {
            "command": "set_rgb",
            "parameterType": "COLOR",
            "parameters": [
              "$value$",
              "smooth",
              500
            ],
            "condition": {
              "name": "HSBOnly"
            }
          },
          {
            "command": "set_bright",
            "parameterType": "NUMBER",
            "condition": {
              "name": "BrightnessExisting"
            }
          },
          {
            "command": "set_power",
            "parameterType": "ONOFF",
            "condition": {
              "name": "BrightnessOnOff"
            }
          }
        ],
        "category": "colorpicker",
        "tags": [
          "Control",
          "Light"
        ]
      },
      {
        "property": "doorbell_volume",
        "friendlyName": "Doorbell Volume",
        "channel": "doorbellVol0",
        "type": "Number",
        "refresh": true,
        "actions": [
          {
            "command": "set_doorbell_volume",
            "parameterType": "NUMBER"
          }
        ]
      },
      {
        "property": "gateway_volume",
        "friendlyName": "Gateway Volume",
        "channel": "gatewayVol1",
        "type": "Number",
        "refresh": true,
        "actions": [
          {
            "command": "set_gateway_volume",
            "parameterType": "NUMBER"
          }
        ]
      },
      {
        "property": "alarming_volume",
        "friendlyName": "Alarming Volume",
        "channel": "alarmingVol2",
        "type": "Number",
        "refresh": true,
        "actions": [
          {
            "command": "set_alarming_volume",
            "parameterType": "NUMBER"
          }
        ]
      },
      {
        "property": "doorbell_push",
        "friendlyName": "Doorbell Push",
        "channel": "doorbellPush3",
        "type": "String",
        "refresh": true,
        "actions": [
          {
            "command": "set_doorbell_push",
            "parameterType": "STRING"
          }
        ]
      },
      {
        "property": "rgb",
        "friendlyName": "RGB Color",
        "channel": "rgbColor4",
        "type": "Color",
        "refresh": true,
        "ChannelGroup": "actions",
        "actions": [
          {
            "command": "set_rgb",
            "parameterType": "COLOR",
            "parameters": [
              "$value$",
              "smooth",
              500
            ],
            "condition": {
              "name": "HSBOnly"
            }
          },
          {
            "command": "set_bright",
            "parameterType": "NUMBER",
            "condition": {
              "name": "BrightnessExisting"
            }
          },
          {
            "command": "set_power",
            "parameterType": "ONOFF",
            "condition": {
              "name": "BrightnessOnOff"
            }
          }
        ],
        "category": "colorpicker",
        "tags": [
          "Control",
          "Light"
        ]
      }
    ]
  }
}
1 Like

cool :+1:, so it responds to all the ‘regular’ lumi gateway commands it seems.
I’m curious:

  • is this with cloud connection or without cloud connection? (in another forum it was suggested that it depends on the command if it requires cloud connection yes or no, esp the device list might need cloud)
  • Did you try the resulting file json file, meaning e.g. does the setting of the volume work
  • Did you already try any of the ‘special commands’ e.g. sending to the commands channel get_device_list[] or get_device_prop[] and get_device_prop_exp[] and get_lumi_bind[] and enable_telnet_service[] or e.g. get_ip_info[]
  • and one more… get_device_prop ["lumi.0", "device_list"]) in the similar fasion other properties might be able to be received.

It’s a bit different now.

  1. I’ve deleted things, items, and the miio binding
  2. installed miio binding from openhab-addons-3.1.0-SNAPSHOT.kar (dated Feb/6)
  3. defined the thing (this is how scan defined it)
UID: miio:generic:1072B9E6
label: $Controller Xiaomi EU
thingTypeUID: miio:basic
configuration:
  cloudServer: de
  refreshInterval: 30
  host: 192.168.131.16
  model: lumi.gateway.mieu01
  communication: direct
  deviceId: 1072B9E6
  timeout: 15000
  token: ****************
  1. now I have the following channels

So no more testing channel.

I think that the binding always goes with cloud connection. I put the gateway in a different LAN so that OH can’t see it directly. But the thing goes from ONLINE to ERROR: COMM when I plug / unplug it.

Yes, that is the result of the testing switch you used.
It creates an experimental databasefile for your device on your server OH in the conf/misc/miio folder.
The channels you see are from that file.

The command channel is still there but less visible as it is marked advanced (click ‘Show advanced’ in the page the thing channels ). You should see these additional channels where you can send these commands to:

The binding is using cloud for communication only if you indicate that in the thing properties.It is defined per device how the communication happens.

I have it direct in a different lan. ping 192.168.131.16 does not find it. But the binding finds the thing.

Will test the hidden channels in a minute.

I’m using the Execute Command channel to send this command get_device_list[]. I’ve tried both direct and cloud modes. If there is an answer where is it shown ?