Xiaomi Philips Light token problem

the config code for Xiaomi Philips Light need a token i get the token code from my iphone back up but the problem is the token character i get is 96 characters but the config character max is 32 so is this issue from the code???

The token must be 32 characters long. Are you sure you took the right one?

yes look at photo

any one help me?

I had the same issue as you, and decided to give a try to this miio cli discovery tool, and I could get 32-char tokens to all my Xiaomi Wifi devices.

I just tried this way with my philips light without success:

Device ID: 60689026
Model info: Unknown 
Address: 192.168.130.58 (philips-light-bulb-miio60689026)
Token: ???
Support: Unknown

Extract the token is the only way to get the token at the moment.

@pplucky Could you do me a favor? Are you able to extract the tokem from an iOS backup again and may be also from android device? If you don’t own a android device the received token from miio will work, too. I want to check they have something in common. The underlying cryptography expects a 32 char token so we cannot feed 96 chars by just loosen the limits.

npm not work with me did i need to install npm first? and if i install it did my HM work fine?
thnk you for reply to me

npm (node package manager) is part of nodejs. You should install version 8.

Device ID: 60636382
Model info: Unknown
Address: 192.168.31.56
Token: ???
Support: Unknown

:frowning: not work for me too

@Noor_Eldin_Shashtari Do you own an android device for testing? I received your sqlite file and you are totally right. Your ZToken column provides 96 character tokens. It looks like encryption with a common salt. All tokens are ending with the same (32) characters. If you split the 96 chars into 32 character pieces we could try the first two pieces as token. The android mi home application does no encryption up to now. This would be the second approach to retrieve a valid (32 char) token.

ok i will try to spilt the char and thene replay to you and if not work i need to use android apps thank you

If you are unsure what’s going on you can enable debugging of the component by:

# configuration.yaml

logger:
  default: warn
  logs:
    homeassistant.components.light.xiaomi_philipslight: debug

After a restart of HA the home-assistant.log should show something like this:

INFO:homeassistant.components.light.xiaomi_philipslight:Initializing with host 192.168.130.58 (token 6f3ce...)                                                                                                                                                                                     
INFO:homeassistant.components.light.xiaomi_philipslight:philips.light.bulb 1.3.0_0032 ESP8266 initialized                                                                                                                                                                                          
DEBUG:homeassistant.components.light.xiaomi_philipslight:Got new state: <CeilStatus power=on, brightness=47, color_temperature=100, scene=0, dv=0, smart_night_light=None, automatic_color_temperature=None>                                                                                       
DEBUG:homeassistant.components.light.xiaomi_philipslight:Response received from light: ['ok']                                                                                                                                                                                                      
DEBUG:homeassistant.components.light.xiaomi_philipslight:Got new state: <CeilStatus power=off, brightness=47, color_temperature=100, scene=0, dv=0, smart_night_light=None, automatic_color_temperature=None>                                                                                      

I understand your point, I’ll get back to you later tonight with that info, but I can confirm that all Wifi devices I have in Mi Home iOS had a 96 char token rather than 32. On the other hand, via miio, all these had 32 char instead.

I forgot to mention that, because I also have homebridge running on the same machine as Home Assistant, so I already had npm installed.

i tray this but nothing help and i tray to get backup from android but i did not know how so until now no chance to work

can you help us to make backup from android and extract it please i tray adb backup but i cant extract it and where the backup save after make it on adb??

Do you have root access on your android device?

Just sent you a message with this information, I hope it may be valuable.

Please let me know if you need any further help.

Yeay! I managed to decrypt the 96 character token into a 32 character one: Xiaomi Gateway Integration

1 Like