Xiaomi Mijia Smart Multi-Mode Gateway (ZNDMWG03LM) support

Also from me a big thanks to @AlexxIT i was hoping for this to happen.
I got the MI Smart hub working.

But i have a question about the Aqara opple six button device who was tested to work.
HA did find it and it’s working. but does this still work with the “xiaomi.aqara.click” event type?
Older buttons/switches do work with this event type on the V2 gateway.

Do i miss something? i can test the event in HA (trough the event log) but pressing the physical button nothing happens for example: turning the lights on.

Is it possible in future to add support for devices other than xiaomi, for example Tuya wall switch https://pl.aliexpress.com/item/4001138076397.html ? It’s much cheaper than aqara.
Thanks for great work!

I have the same device.
When I click on a button I get this event:

{
    "event_type": "state_changed",
    "data": {
        "entity_id": "sensor.0x4cf8cdf3c77b8b3_action",
        "old_state": {
            "entity_id": "sensor.0x4cf8cdf3c77b8b3_action",
            "state": "button_5_single",
            "attributes": {
                "button_5": 1,
                "action": "button_5_single",
                "friendly_name": "Aqara Opple Six Button Action"
            },
            "last_changed": "2020-09-21T12:48:26.591621+00:00",
            "last_updated": "2020-09-21T12:48:26.591621+00:00",
            "context": {
                "id": "be0148f4fc0811eaabe99d10227985df",
                "parent_id": null,
                "user_id": null
            }
        },
        "new_state": {
            "entity_id": "sensor.0x4cf8cdf3c77b8b3_action",
            "state": "",
            "attributes": {
                "button_5": 1,
                "action": "button_5_single",
                "friendly_name": "Aqara Opple Six Button Action"
            },
            "last_changed": "2020-09-21T12:48:26.692686+00:00",
            "last_updated": "2020-09-21T12:48:26.692686+00:00",
            "context": {
                "id": "be10b5eafc0811ea8eef1bd85b2e84db",
                "parent_id": null,
                "user_id": null
            }
        }
    },
    "origin": "LOCAL",
    "time_fired": "2020-09-21T12:48:26.692769+00:00",
    "context": {
        "id": "be10b5eafc0811ea8eef1bd85b2e84db",
        "parent_id": null,
        "user_id": null
    }
}
Event 0 fired 3:48 PM:
{
    "event_type": "state_changed",
    "data": {
        "entity_id": "sensor.0x4cf8cdf3c77b8b3_action",
        "old_state": {
            "entity_id": "sensor.0x4cf8cdf3c77b8b3_action",
            "state": "",
            "attributes": {
                "friendly_name": "Aqara Opple Six Button Action"
            },
            "last_changed": "2020-09-20T23:45:44.305287+00:00",
            "last_updated": "2020-09-20T23:45:44.305287+00:00",
            "context": {
                "id": "664d1749fb9b11ea8be193abd6512c54",
                "parent_id": null,
                "user_id": null
            }
        },
        "new_state": {
            "entity_id": "sensor.0x4cf8cdf3c77b8b3_action",
            "state": "button_5_single",
            "attributes": {
                "button_5": 1,
                "action": "button_5_single",
                "friendly_name": "Aqara Opple Six Button Action"
            },
            "last_changed": "2020-09-21T12:48:26.591621+00:00",
            "last_updated": "2020-09-21T12:48:26.591621+00:00",
            "context": {
                "id": "be0148f4fc0811eaabe99d10227985df",
                "parent_id": null,
                "user_id": null
            }
        }
    },
    "origin": "LOCAL",
    "time_fired": "2020-09-21T12:48:26.591720+00:00",
    "context": {
        "id": "be0148f4fc0811eaabe99d10227985df",
        "parent_id": null,
        "user_id": null
    }
}

I have another idea: how can we add devices like this ourselves? Let’s help AlexxIT with this task. Although I don’t know how :slight_smile:

Instead of events, I made an action entity. Many users have difficulty working with events

1 Like

For now, I have plans to add ZHA support. If I can, of course.

Starting another independent project to support the great variety of Zigbee devices is not very smart.

1 Like

Good idea! Yes reusability would be perfect. And you delegate the problem to someone more specialized. You can’t really support everything.

EDIT: maybe I am saying something stupid, but could it be “merged” somehow, at least data-wise, with other list of implemented items, like deconz?

During an update there was a problem on my internet and the update ended up getting corrupted. Now my device always has a yellow LED, I tried to restart it by pressing the button for a few seconds but I was not successful, I believe the firmware has corrupted, does anyone know how to solve it?

check #108 from this thread.

Hi @AlexxIT ,

Amazing job you did with this hub. It works perfectly. The hub arrived today, I plugged in and set it up in the MiHome app. On another Android phone I extracted the token code and integrated it into HA with your repo added into HACS. At this moment I only use it with T&H sensors on bluetooth - LYWSD03MMC model. It exposes the temp/humidity and battery level for each sensor (I have 6 of them around the house). Can I add zigbee devices to it as well? I do not have any for now, but planning soon for adding some more.

The only “complaint” - but I do assume it’s because of the Bluetooth protocol - it take several minutes for the sensors to be published into HA.
I have a question - on the MiHome app - the hub now is under 1.4.5_002 as firmware version. Should I update it to 1.4.6_0012 ? Or leave it like this ? I do now want it to break and stop working.

Thank you very very much for this integration - awesome work.

I’’m on 1.4.6_0030 and it still works fine

I run 1.4.6_0012 as well. Everything was performed with this version.

I did the firmware upgrade and it seems to be running fine. Thank you for the reply.

Yes you can add Zigbee devices which are officially supported by the Gateway.

1 Like

Sorry i’m still learning…

I have this simpel script to turn on the lights.

If i want for example to use button 1 from the six button switch to replace the event from the old binary switch how can i do that?
‘’’

  • alias: Lampen aan
    trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
    entity_id: binary_sensor.switch_158d0002109d18
    click_type: single
    action:
    service: light.turn_on
    data:
    entity_id: light.yeelight_Bank, light.Yeelight_tv , light.yeelight_strip1_7811dc69138d
    brightness_pct: 100
    kelvin: 2950
    transition: 2

‘’’

I added a description of button automations to the readme.

Good one thanks!

edit: got it working, but it won’t accept data like brightness and other variables. at least in my config.

Hi,

I use aquara motion sensor (RTCGQ11LM). It works great. Nevertheless, it’s quite slow to go from on to off state (approximately 1min and 30s). The same sensor with HomeKit integration is more responsive (1 min to go from on to off).

Mi issue is that i use this sensor in an automation that need to be responsive. Maybe there is something to improve?

Let me know if i can help.

Thanks.

Hi,

Thanks a lot for all this work.

2 quick questions:

  • when using this plugin, do we still use Chinese servers with Gateway v3, or can we skip them ?

  • @AlexxIt -> when you say that the Xiaomi Loock Smart Door has been tested ok, can you precise the reference of the device. When I Google it, I have 2 different type of devices, either a video doorbell, or a door knob.

Thanks

Hello Alexxit, I can’t add yout repo on my HASS.IO
Supervisor --> Add-On Store --> Repositories

2

Any particular thing ?

20-09-26 16:46:22 INFO (MainThread) [supervisor.store.git] Clone add-on https://github.com/AlexxIT/XiaomiGateway3 repository
20-09-26 16:46:24 ERROR (MainThread) [supervisor.utils.json] Can’t read json from /data/addons/git/42a0785a/repository.json: [Errno 2] No such file or directory: ‘/data/addons/git/42a0785a/repository.json’
20-09-26 16:46:24 WARNING (MainThread) [supervisor.store.data] Can’t read repository information from /data/addons/git/42a0785a/repository.json
20-09-26 16:46:24 INFO (MainThread) [supervisor.store] Load add-ons from store: 66 all - 0 new - 0 remove