Xiaomi Hub/Gateway token

Hello!

Trying to Obtain token för Xiaomi Mi Hub to integrate it with HA.

Using EU server.

After like 6 hours i was lucky to finally obtain the key (i think) to the Hub/Gateway by installing an older Mi Home app and used the logs on my Android device to obain it.

But now iam stuck again… The token/key i obtained was an 32 character key and not 16 character key that is required for the Hub/Gateway in configuration.yaml file.

How do i convert it or did i miss something?

toolkit

This i what i get from the MiToolkit on both new Mi Home app and also same thing on the older version of Mi Home app.

On the older version i got an 32 character token from the logs… But i need the 16 char…

Did you try this method?
LINK

I think I used your method for Xiaomi wifi devices like bulbs …

Yeah, or well… Tried that but i dont have any “About” option in my Mi Home app.
From the info i got by searching on different forums i come to the conclusion that Xiaomi remowed that from the app with newest versions and also when you are using EU server.

I wish it would be that easy :unamused:

I have it in my app and I updated today (5.5.14)
About section is when you enter app, next select Xiaomi Gateway and than select three dots in upper right corner - see screen … But maybe when you register to EU server it is locked … didn’t try as I started when there was no EU server. … Maybe just switch servers?

Tried to switch servers now too… And using an older app, no “About” section for me.
I think its because the Hub is EU version too…

Sorry that didn’t help … But that would mean Xiaomi Gateway is locked out of home assistant

Hi all,

I’m new to hassio and ran into this problem as well, @MrUkleja put me on the right track though. I did this on the newest iOS App.

  1. open Xiaomi Home app
  2. Select the gateway unit tile
  3. press the triple dots in the upper right corner
  4. select about
  5. keep tapping the bottom of the screen. 3 new lines will apear.
  6. select the FIRST chinese option (second chinese line)
  7. activate the LAN setting. just set the first switch to on
  8. note down your api key
  9. ???
  10. Profit (you are done!)

Hope this helps somebody!

2 Likes

I am having the same problem here.
It seems that this European hub is not supported yet, because it does not have a way to enable the dev mode to get the key that is different then the token.

I found some more information on this issue opened in GitHub.

https://github.com/home-assistant/home-assistant/issues/22078

Hopefully they will manage to add support for this hub.

So far I am thinking on use the zigbee2mqtt to use the sensors with home assistant.
Does anyone have some other advise?

The new xiaomi_miio integration might be able to comunicate with the EU gateway (lumi.gateway.mieu01).
Could someone try to manually setup the integration (in the latest version of HomeAssistant it is available as config_flow) and report to me if it works with the lumi.gateway.mieu01 model?
with the integration as it is now you schould be able to control the build in alarm, subdevice support is coming.

If you are able, also test the subdevice discovery using the phython-miio module by running this python code:

from miio import Gateway

gateway = Gateway("192.168.1.IP", "tokentokentoken")

gateway.discover_devices()
devices = gateway.devices

for dev in devices:
    dev.update()
    print(dev)

If so I will add zeroconf auto discovery

1 Like

Capture

I got this response

I dont think i am running the latest version as you told. I would be happy to help if you tell me how :slight_smile:

You are running the latest version, but the lumi.gateway.mieu01 does not support getting the subdevice list.
See the discussion here: https://github.com/rytilahti/python-miio/issues/728#
Someone will need to translate the java code to python to get the devicelist from the cloud.

Control of subdevices using local python_miio code has been confirmed to work for the lumi.gateway.mieu01

1 Like

hi the HA discover 2 integrations
1 - xiaomi miio with only the temp sensor ( i succeded to define it )
2 - xiaomi aqara gateway , here i am getting an error about zero conf
i have more sensors like smoke and water which i cannot see from versio 112.
any idea ?

This worked perfectly :slight_smile: