@Flink As far as I know, devices from Qingping (some or all) support two protocols - Mijia BLE and its own Qingping. It is possible that without pairing the sensor in the MiHome application, it will not send MiBeacon messages at all.
I think Ernst did not mean a specific version. If you have difficulty getting the encryption key, then try looking for a modified version from Vevs (there is a link in our FAQ (point 3), I’ve heard a lot of positive reviews about this mod).
@Flink No, I didn’t mean the version. As @Magalex explains, I expect that you have to add in the MiHome app to make sure it uses the Mijia BLE protocol. I don’t know which protocol the Qingping app uses, but it might be different.
@Magalex@Ernst thanks for your replies! I’m hopefully one step closer, but there yet
After using the mi home version from Vevs, I in fact got the bindkey from the text file, but it still does not seem to work
The bindkey is different from the one I was previously using (that I got from the Qingping+ app).
Not sure if it matters, but I was unable to pair/add the device on the mi home app, if gives me an error on the pairing sequence sayig: Standard verification failure (-51).
Bellow are the logs from HA
As far as I can (think) to understand, ha received 3 packages but was unable to decipher them
Yes, messages from the device come, but the encryption key does not fit…
The device must be bound with the app since it is during the binding process the encryption key is generated and saved. I don’t understand how at least something worked for you… The error “Standard verification failure (-51)” may not refer to the exchange with the device, but to the exchange with Xiaomi web services via the https protocol. Is the internet good on your android? Is you android date / time correct? Firewalls / proxies / VPNs? No other ideas yet…
In the MiHome application, the selected region also matters. See which one you have there, and try to play with it - many problems were solved by setting it to Mainland China.
AHA! I see the light
How you may ask? By starting from scratch on another CGD1 device (got 4 in total) I realised the process works and I was doing something on the initial device.
The bindkey from the first device, seemed to get changed upon the device pairing/adding on the MiHome.
I mentioned before that I managed to get the key but the device was not properly added to the MiHome app, well, I deleted the text files generated by the Vevs mod and run the process all over again, and after adding/pairing, the bindkey changed and now I can see the device on HA.
Nevertheless, I have the batt_entities: True option on the configuration but not all the sensor.ble_battery_XXX entities generated shows value (some say Unknown), and the atribute battery_level isn’t present on the sensor.ble_temperature_*** entity
Can the ble_monitor sensor be used as device tracker? I want to use it to detect the presence of nearby bluetooth devices.
Thanks for this great custom component!
successfully follow the procedure until step 6. I was able to capture “POST https://api.io.mi.com/app/device/bltbind”, but I did not find “bind_key” as described in step 7.
Any tips? Thanks
Hi, I’ve just realized the breaking change as my round bluetooth temp and humidity sensor (LYWSDCGQ) had stopped reporting values. I have now changed the config according to instructions to ble_monitor:. However, after restarting Home Assistant (Home Assistant OS with Raspberry Pi 4) it still does not seem to find the new entities. I tried adding the sensor to Xiaomi’s Home app and got the reporting working fine there, so the sensor definitely works. I’m only using the bluetooth of the Pi for this one sensor / use case. Any ideas what to try next?
Hi @Magalex, I have a few of these sensors but are setup in ESPHome, I want to try your component. However, I use my HA machine’s builtin BT module for Govee Temp sensors. My machine runs Ubuntu server.
Will there be any conflict if I run both components on the same machine? I wonder if it will work. Thanks for the advise!
Yep, that should work just fine. ble_monitor just listens to ble messages with its ble_adapter, so no interference with esphome. Esphome uses the ble adapter of an esp device.
I did and checked through all my sensors and doesn’t seem to be showing. Enabled debug logs but can’t see any errors or anything noteworthy there either.