New Xiaomi Mijia Multimode Smart Gateway

Post #2, update 5 added - Reversed opinion about purchasing (somewhat) and referenced a new easy to use community driver that will automatically add HomeKit devices to HE. It requires HA or HASS.IO, but the amount of configuration is minimal and it's dead simple to setup HASS.IO in a virtual machine or to image it to an SD card to run on a RPi.

Once done, there's no need to touch HASS.IO. It's just a relay to get HomeKit enabled devices from the Xiaomi gateway (or anything HomeKit enabled) directly into HE, with no effort, no MQTT brokers, no HA automations, no scripts. They just appear and you can use them in HE rules and apps.

2 Likes

Yes testing it now. Today with homekit devices, tomorrow I will test Aqara hub.

2 Likes

Very early stages, so do keep that in mind. Recommend keeping your local backups up to date just in case.

1 Like

Post#2 - Final update: Home Assistant Device Bridge is out and is a great addition to Hubitat for those hard to add devices. After testing a ConBee 2 for several weeks, I would call it the clear winner for joining Xiaomi devices and other non-Xiaomi, yet still difficult to work with Zigbee devices. No drops. Perfect response every time.

The Mijia Multimode Smart Gateway is still the cheapest option at a regular sale price of just $20 USD, but in testing the Home Assistant Device Bridge driver I discovered there are some HomeKit limitations I didn't want to live with. For example, although the Aqara Temperature, Humidity, Pressure sensors shows all its data in the Mijia app, when you join that to HomeKit Controller in Home Assistant, you only see Temp and Humidity because HomeKit doesn't currently support barometric pressure apparently. :roll_eyes: So for just $43 USD ($54 CAD) you can get the ConBee 2 faster from Amazon and you will be able to join all of the Xaiomi Zigbee devices that are available in North America and you won't be just limited to Xiaomi Zigbee devices. For example, I'm able to once again use my Lutron Connected Bulb Remotes as button controllers for the first time since leaving Wink 5 years ago! And unlike the Wink implementation, this is actually fast.

2 Likes

Post#2 - (Not so Final) Final update : Alright, so never say never again. While I haven't changed my opinion about a ConBee 2 versus this Gateway, there's an advantage for just getting Xiaomi devices into Hubitat if you're using Home Assistant Device Bridge with the Mijia Multimode Gateway.

This new HA integration is only available if you have the Home Assistant Community Store installed, which is really easy to do. Once installed, there's a Xiaomi Gateway 3 integration that will allow you to obtain a token from the device and connect it directly to HA, without the limitations of HomeKit (e.g. You can use the Aqara Temp/Humidity sensors and it will include the Barometric pressure readings too). You'll be able to see everything supported by Home Assistant Device Bridge in Hubitat! :grinning:

However, this does limit you to Xiaomi supported devices and it's not fast. There's a noticable delay when a contact sensor triggers. It's not huge, but you can see the same delay if you connect the Gateway via HomeKit Controller. This might be due to the WiFi, or it may just be a limitation of the Gateway itself. In any case it's possible to get all the parameters from Xiaomi devices using the method, but it doesn't have the same lightning fast reaction time I experience with the ConBee 2 and the Zigbee ZHA integration in HA. Maybe if you install an Ethernet port in the Gateway (yes, it looks like that's an easy hardware hack you can do), but I'm not going to try that myself (at least I have no plan to do that at this moment). Would be interested to hear if anyone else tries it though and can confirm if the response is any faster over ethernet.

Here are some links to get you started if you want to try this out. There is one particular thing that you need to do, and it took me a while to notice this requirement. You need to open telnet on the Mijia Gateway. If you don't do this you wont be able to see paired devices and you won't be able to downgrade the device firmware if you want.

One thing that is especially nice about this integration is that you can disable firmware updates so they cannot happen automatically (currently Xiaomi doesn't do this) and you can prevent yourself or someone else with access to the Mijia Home app from accidentally or intentionally updating the firmware if that's not what you want.

Screen Shot 2021-03-12 at 5.44.29 PM

Replace what is on the open telnet command line by pasting this command with no changes

`{"method":"set_ip_info","params":{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}}`

How to setup the integration

The video (in Russian) of how to do it

Here's how to open the case

You can install external antennas
gw3_zb_antenna

You can install an Ethernet port

A page with flashing methods (can be done easily with Telnet) and several VERY hacky examples of adding an ethernet port at the bottom of the page. Page is in Russian, so use Google Translate if you don't speak the language.

One final note. You can apparently set the gateway with this integration to use the Zigbee ZHA to join devices (limited to the supported third-party devices shown in the Mijia app), and that doesn't disrupt you from still using Bluetooth devices with it. However, I couldn't get the socket to open on my virtual HA install, and I don't want to go through the hassle of removing ZHA on my primary HA install to test. But, even though the author demonstrates some additional abilities from downgrading the gateway firmware, they don't seem that compelling to me. You decide. One thing that was said to not be possible with the latest firmware was the ability disable the beeper. But in fact this does work. I did find that you sometimes cannot get options like "lock firmware upgrade" or "device paring" to turn on or turn off unless you reload the Xaiomi Gateway 3 integration. Not that big of a deal in my opinion, but something to keep in mind.

1 Like

Phew - that was tough.

Thank God for close captioning

:grin:

1 Like

When the Xiaomi dual relay came out I found a video with somebody describing it, and didn’t realize until now, it’s the same guy.

1 Like

Based on AliExpress vendors, I get the impression that Russia is a major consumer of Xiaomi devices.

1 Like

Pretty exciting news for anyone that just wants an inexpensive, yet stable and fast way to get Xiaomi devices in Hubitat.

I updated to the latest version of this Xiaomi 3 integration mentioned above and I got it working with the Zigbee HA integration.

It's fast! It's as fast as my ConBee 2 directly connected to a MacBook Pro (which is instant). But here's what's so exciting, this is running on a Raspberry Pi Zero with a WiFi adapter and the Mijia Gateway has not been converted. It's also on WiFi. So for the cost of a RPi Zero W, a good Micro SD card, and an inexpensive Mijia Multimode Gateway, you can get Xiaomi devices into Hubitat using the Home Assistant Device Bridge app and driver. And you'll also get Xiaomi Bluetooth device support!

I'll follow up with a how-to post. There's a little bit of extra manipulation needed to get this going on RPi Zero W, but it's not too hard.

2 Likes

Folks - in the picture dictionary, Doug's use of the term "pretty exciting" would be the definition of understatement.

This is just awesome!

So if my brain has captured the essence of the ~300 posts in this and the linked thread, I can connect HA xiaomi devices to HE , with either a Conbee2 or a Mijia gateway.
I just so happen to have a gateway(V2?) but think it doesn't work for this, can anyone confirm?
TIA

Well, I think the V2 gateway can be connected to HA as well. But if it cannot, and you have opened the local LAN port on the V2 gateway, you can connect it to Node-RED, and then use Node-RED to bring in Xiaomi sensors into Hubitat using virtual devices. I did this for a while. Worked pretty well.

I think that one has the same requirements as when using it with the mi connector app

There’s a firmware you can flash to early Aqara and Mijia Gateways that turns them into a router. That’s probably more useful.

I noticed that the prices for the version 3 Mijia gateways have gone up a bit. Price is so close to a Conbee 2 that unless you’re really interested in Bluetooth, you’re better off with a Conbee 2. Supports a lot of devices for around $45 USD.

Or even one of these - about the same price as a Conbee, but work with a really wide range of devices (and supports zigbee 3.0 out of the box).

1 Like

OpenLumi router

2 Likes

I came so close to buying one when they were in stock, but got confused about which firmware. Almost chose zigbee2mqtt, but don't want to deal with mqtt at all

I already ordered the V3 gateway, 27.50 shipped. I have a V2 gateway and the xiaomi devices were very solid on that, but mi-connector never worked for me, so I gave up. Now I can use the gateway as a router. Looks like a fun project,Thanks

1 Like

Since you used this integration, should new devices added to the MI hub, automatically show up in HA? I'm only seeing the intial devices in MI Hub showup in HA, and only get newly added Mi devices, by killing the integration and re-adding it to HA.

Okay figured it out, you have to reload the integration to pickup new devices.

2 Likes

Okay so for those who come here after, this works with the older gateway DGNWG02LM. What is amazing is how insanely fast the Xiaomi gateway pairs with its own devices, and gives you a pairing confirmation, like IRIS used to do. I'm really enjoying playing with this integration, but for the long term not sure if having 2 more points of failure is a good thing? Or is it not really a significant issue?
Anyone know if plans exist to expand supported devices capabilities? Like vibration sensor & buttons/ "the cube" ?

2 Likes

That’s great to learn it works with the older version. I assume this is because you had yours working with Mi Connector before, so you have the right firmware version to give you access to the developer menu. Or was that not necessary?

The latest Mijia Multimode gateway can be easily reverted to earlier firmware, but it’s definitely not needed.

Right!? It’s mere seconds.

Yes :wink:

I did it on 1 earlier firmware than latest version. Then even updated to latest firmware, still works. The biggest issue is the app version, the newest version will not show the secret password(for this app) nor the secret token(not needed for this app but for mi-connector). Thankfully I had my older note8 with an older mi-app version where I could get the password. I actually have the Mi hub connected to 2 cellphones, and they both work, but only the older app has the hidden menu.

1 Like