Not able to get Xiaomi Gateway Key

Hi Olivier

Sorry. No dice. Copied your format and get:

Error executing script. Invalid data for call_service at pos 1: Unknown gateway sid 54ef44xzxxxxx for dictionary value @ data[‘gw_mac’]

hi

Are you sure its the right gateway mac adress?

go in MiHome APP and be sure of the IP first. Then go to download https://www.advanced-ip-scanner.com and chek your ip and copy your mac adress and compare…just to be sure…

Hi With the new interface of the xiaomi home apps I’m not able to activate the lan access

you have a DGNWG02LM ? right? LAN access is only available with this gateway.

I have the MiHome APP 5.9.19 of the 7 december 2020 and it still have the “LAN” menu, no change.

Hi Olivier

I really appreciate you helping me here my friend. Still no luck. Are you aware that the new ones do not allow you to go into the LAN access mode the old ones did? Sorry silly question but it was a surprise to me.

I have two of the ZHWG11LM gateways and I checked on my router. I checked that it describes the devices as Aqara_Hub-34cb and I copied and pasted the MAC into the automation you can see part of above (previous post). I also tried under developers tools - see image below. The same automation works with the other Aqara gateways I have except they are V3 and have the ports opened. I tried using the different MACs. The two that work in Dev tools and the two that don’t, the ones we are talking about here, don’t.

I have checked the correct MAC in the MiHome app

Below is from the HA logs.

Logger: homeassistant.components.automation.new_automation_2
Source: core.py:1399
Integration: Automation (documentation, issues)
First occurred: 19:14:34 (3 occurrences)
Last logged: 19:17:05

While executing automation automation.new_automation_2
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 404, in async_trigger
    await self.action_script.async_run(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1026, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 242, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 250, in _async_step
    await getattr(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 457, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1399, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: Unknown gateway sid 54efxxxxx for dictionary value @ data['gw_mac']

Capture

Lan access is not an option for ZHWG11LM, so its normal you dont have this.

its only for DGNWG02LM.

Have you got a chinese version of ZHWG11LM? or EU ones?

I have chineses versions for the 5 xiaomi gateway i owned. Mainland China in the MiHome App config.

Everything is auto discovered in HA with the new integration Xiaomi Homekit.

Chek if its not EU version and yours setting are Mainland China in Xiaomi MiHome.

Hey Olivier

I am New Zealand so no chance they are European. Got them on Aliexpress. Yes the MiApp is on Mainland China.

Any other bright ideas?

B

Yes I have 2 of them
When I start to configure the 1st one I hade the old interface
After a update I get the New interface for sole device

My gateways are china version too

hello!

sorry to heard that…

Are the gateways are on the same network with the server of HA?

hello,

your screen capture look like from a ZHWG11LM not DGNWG02LM ???

dont understand…

Are you under Android or IOS?

I have the V3 aka DGNWG02LM


And I’m on a Xiaomi mi max 2 Android 9 I guess

As If said was on HA making the conf of the first gateways, taking the data from the old version of the app and its works and After un update I get the new interface


I now I Can’t get the token to add the second gateway

I have the same version of Xiaomi home apps 5.9.19

And 1.4.1_176.0220 for the gateways firmware

just check now and same as you! it seems Xiaomi have delete the lan access OPTION!!

!!!FOR ALL OTHERS USERS : DONT MAKE THE LAST FIRMWARE UPDATE!!!

its really sucks

1 Like

Hi Olivier

Yes all is on the same network. I’m on Android. I just noticed that overnight the LAN option is removed for the DGNWG02LM. Last night I have the old interface for the DGNWG02LM and the new for the ZHWG11LM.

Yes the screen capture looks like the one above for the ZHWG11LM ones. I never got the old interface that I can remember.

In the XiaomiHome app I have the new interface like you have shown in your pictures for my ZHWG11LM.

In Home assistant in the HomeKit I have two devices. The integration says I have: Device info, ZHWG11LM, by Aqara, Firmware: 3.1.1

And for the other 2 Under the XiaomiMii intergration I have: Device info lumi.gateway.v3-MW300 by Xiaomi Firmware: 1.4.1_176. I checked on the back of the devices and they are both DGNWG02LM

So Just so I check through my process here. I simply added them to the MiHome app, they were autodiscovered by HA. I added them and can control them using HA (the light anyway) but cannot get them to make noises.

because lan mode is now deleted…understand now…

@bdb1 Have you been prompt for key when you integrate into HA? and which key have you wrote?

Yes

Well that a Bad news

You have to buy a “HomeKit Compatible” and there will be a sticker on the box AND on the gateway : 8 digit that you will entered like this : XXX-XX-XXX.

1

Its the only solution…

Dont know if the ZHWG11LM still exist…

Olivier974

Yes I did but I cannot remember, sorry! Can you remember which one and I will confirm if that is what I put in?

like this : 16 digits :

Key : 889aqxxxxxhl5c77

XXX-XX-XXX. That is the code I entered. I remember that pattern and it was on the box.

Yes the HomeKit logo etc is on the box and gateway. I do not have HomeKit gear at all though. Does that matter? I only have HA, WIFI and Zigbee.