Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIP: Getting the bind key for the Xiaomi Mijia LYWSD03MMC sensor #277

Closed
circa1741 opened this issue Sep 5, 2020 · 17 comments
Closed

TIP: Getting the bind key for the Xiaomi Mijia LYWSD03MMC sensor #277

circa1741 opened this issue Sep 5, 2020 · 17 comments
Labels

Comments

@circa1741
Copy link

Below is the easiest way I found to get the bind key for the Xiaomi Mijia LYWSD03MMC sensor. I used a mobile phone and performed the following steps:

  1. Keep the Xiaomi Mijia LYWSD03MMC sensor close to the mobile phone.
  2. On the mobile phone, make sure that the bluetooth connection is enabled.
  3. Using the mobile phone's browser, navigate to https://atc1441.github.io/TelinkFlasher.html.
  4. Enlarge the mobile phone's screen for better readability.
  5. Now, click the [Connect] button and wait until it shows "Connected." See the Log section at the bottom.
  6. Once connected, click the [Do Activation] button and wait until the "Mi Bind Key" shows the information.

image

Source: Around the 11:40 mark of https://www.youtube.com/watch?v=NXKzFG61lNs

@mKeRix mKeRix closed this as completed in 19b7b51 Sep 13, 2020
@mKeRix
Copy link
Owner

mKeRix commented Sep 13, 2020

Thanks for providing the tip, I included it in the official docs!

@omerbitas
Copy link

Thank you so much, this is so simple and easy!
Adding the MAC address of the connected unit will be great

@github-actions
Copy link

🎉 This issue has been resolved in version 2.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Maxrunner
Copy link

Too bad it keeps asking, and then the bind key doesnt work, you have to get a new bind key, remove the integration and add again and copy paste the key again. this is a tiresome loop.

@jubudu
Copy link

jubudu commented Mar 12, 2024

Too bad it keeps asking, and then the bind key doesnt work, you have to get a new bind key, remove the integration and add again and copy paste the key again. this is a tiresome loop.

Same issue here! Can‘t get a valid bind-key.

@fray148
Copy link

fray148 commented Apr 14, 2024

I had the same

@unicron-au
Copy link

Too bad it keeps asking, and then the bind key doesnt work, you have to get a new bind key, remove the integration and add again and copy paste the key again. this is a tiresome loop.

Same for me. I suspect a recent firmware update has changed this behaviour. I ended up flashing mine to the ATC firmware and it worked in ESPHOME first try.

@GiorgosPap777
Copy link

Too bad it keeps asking, and then the bind key doesnt work, you have to get a new bind key, remove the integration and add again and copy paste the key again. this is a tiresome loop.

Unfortunately even this does not work any more with the "new" update that Xiaomi has rolled out. If anyone has updated their thermometer they now can not flash it with custom firmware, unless you open it up and connected through wires to some pins on the board itself, nor (as far as I know) get a valid bind key. If anyone knows how to get a valid bind key or flash it with custom firmware, without opening it up, I would like to know

@IamHEREfromU
Copy link

same issuse can smn help??

@GiorgosPap777
Copy link

Actually yes i have found 2 way to do it. 1 is only for home assistant and the other is to get the the bind key and more info about your devices. Both requirer to connect to your Xiaomi account which you have conected the thermomiter.The generic way is to use the script from this github user (https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/).The second way is to use this(Xiaomi Miot Auto, https://github.com/al-one/hass-xiaomi-miot).Home Assistant hacs integration it will only add it to home assistant without giving you any info except the temperature, humidity and battery percentage in home assistant (note that it is requirers a bluetooth gateway.I have a xiaomi camera which functions as one)

@IamHEREfromU
Copy link

i do the steps i get the token also ip i try the xiaomi miot auto from hacs and the only i do is to add on overview but nothing about iformation 0 temprature the device is as unknown. also my PI4 recofnize my Xiaomi as BLE but i cant find the blindkey id is the 'token' or 'ID' i put on the xiaomi ble and nothing!

(mou ta exei kanei tsourekia autos o sensor!)

@GiorgosPap777
Copy link

nothing about iformation 0 temprature the device is as unknown.

This is for method 2 which works only in home assistant. It needs some time when you first set it up. I sugest that you let it run for a cuplue of hours (it does not need that much 30m i belive will probably be enough but why not let it run for more-)

also my PI4 recofnize my Xiaomi as BLE but i cant find the blindkey id is the 'token' or 'ID'

This is for the generic method 2.
This is what you will see when you run the command:


Devices found for server "de" @ home "XXXXXXXXXXXX":

NAME: Temperature sensor
ID: XXXXXXXXXXXXXXXX
BLE KEY: XXXXXXXXXXXXXXXXXXXX (<-- This is what you need)
MAC: XX:XX:XX:XX:XX:XX
IP: XX.XXX.XX.XXX
TOKEN: XXXXXXXXXXXXXXXXXXX
MODEL: miaomiaoce.sensor_ht.t2


The XXXXXX above mean sencitive info
Make sure that you have selected the correct server. In my case is was "de"

(mou ta exei kanei tsourekia autos o sensor!)

kai emena otan to katalaba oti ekane mono tou update alla apo tote pou to eftiaza doulebei toso kala pou to exv zexasei.
apo pia perioxi tis eledas eise?

@IamHEREfromU
Copy link

The sensor data broadcast by the sensor is encrypted. In order to decrypt it we need a 32 character hexadecimal bindkey.

The provided bindkey did not work, sensor data could not be decrypted. Please check it and try again. and i have put the BLE KEY is not working!

sensor run 17h and 0 info about temp i think i do somthing wrong (i am beginner with this)

i delete it and put again with MI account 'cn' and i wait for info again!

i need to make smnthing changes on mi home app?

**dn mporo na katalavo ti paei lathos se emena mou bgazei unknown thn suskeu 0 infos kai trexei kai 17 ores, ksana ekana thn diadikasia apo thn arxi mpas kai to ekana fail tora apla tha perimeno. To script parolou pou m bgazei to BLE KEY dn litourgei m bgazei to error pou grafo poio pano. Eipa na katso na ftiaksa sto HA ena 'eksipno spiti' kai mou exei bgei o k.... me to tuya smart iR dn mpainei sto HA me to xiaomi sesonr thema ahhaha dn paleute!

apo agrinio eimai esu?

@GiorgosPap777
Copy link

Last night before i responded i added my temp sensor to HA via the official BLE intigration and as you can see below it has worked with no problem.(Also i read in the scripts github that you do not need to put the "de" or something in the script as it will search all of the servers.)
image

i delete it and put again with MI account 'cn' and i wait for info again!

You have put the sensor in the xiaomi app with your account, right?

sensor run 17h and 0 info about temp i think i do somthing wrong (i am beginner with this)

Did HA auto detect the sensor? Also make sure that it is the right one if you have got more than one. Furthermore make sure that you are using the right intigration. i know that this might be basic but in computers you have to make sure that everything, even the most basic things that you are sure that are right.

i need to make smnthing changes on mi home app?

no i do not thing so, i did not make any.

**dn mporo na katalavo ti paei lathos se emena mou bgazei unknown thn suskeu 0 infos kai trexei kai 17 ores

to jero, einai oti xirotero otan kati den doylebei kai den jereis ti h otan jereis alla den mporeis na to ftiajeis!!

Eipa na katso na ftiaksa sto HA ena 'eksipno spiti' kai mou exei bgei o k.... me to tuya smart iR dn mpainei sto HA me to xiaomi sesonr thema ahhaha dn paleute!

to idio elega kai ego alla meta apo arketi prospatia kai telika to brika. ego eixa xiaomi lampes oi opoies apo to HA mporoyses mono na tia anigokliseis. Omos me ayto poy ebala apo ta HA Hacs einai oti kalitero. tora exei ta manta kai gia mia kamera xiaomi poy eixa kai opei elegan oti den mporei na mpei sto HA

apo agrinio eimai esu?

Ego apo hrakeio kritis.
Esy poso xronon eisai, an krino apo tin ora pistebo paidi tora poy teliosan ta sxoleia
ego kapoy ekei eimai

@IamHEREfromU
Copy link

i have this:

Screenshot 2024-05-30 120028

from the script i install on my windows and i get the info so from HACS i install xiaomi mio auto i connect with my account and he find my device as unknow:

Screenshot 2024-05-30 124514

and i have the xiaomi BLE:

Screenshot 2024-05-30 123652

when i press the blue button ask my to put the blidkey i put and i have the error!

so i run the HA as portainer when i go to portainer console and go to configuration.yaml looks like this:

Screenshot 2024-05-30 124019

so if i need to write smthng on configuration.yaml i dont know

sxolio exo teliosei edo kai xronia kai strato 25 eimai. esu poso? spoudazeis sthn kriti?

@IamHEREfromU
Copy link

ok i did it the problem was i had CN as server on mi home app i changed it to DE and i fix it the Xiaomi BLE regognize now my sensor!

giorgara me esoses eixa tora mia eudoamda epsakna liseis kai pos na vro kai to blindkey euxaristo polu!

@GiorgosPap777
Copy link

GiorgosPap777 commented May 30, 2024

giorgara me esoses eixa tora mia eudoamda epsakna liseis kai pos na vro kai to blindkey euxaristo polu!

Tipota re su. Sorry pou den sou apantisa pio noris giati den imoun ston ipologisti. Exei me bolebei polu perisotero. Kai ego to ephakna polu kai telika birka auto. Ama exeis kai tipota allo xiaomi smart kati mporeis na to baleis kai auto me perisoteres litoutgies apo to kanoniko intigration akomi kai an lene oti den mppreis na to baleis.Ta to graphzo kai sta egklezika ama to dei kai kanenas allos

I remember that if you have any else smart device from xiaomi you can add it to with this integration ways better features than the default Integrations

I am really glad that I helped someone like me. To find this integration I had to watch a YouTube video from someone from China speaking Chinese and understand everything only from the video.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants