core
core copied to clipboard
Add support of new revision of Mi Temperature and Humidity Monitor Digital Clock LYWSD02MMC
The problem
I've just received new Mi Temperature and Humidity Monitor Digital Clock LYWSD02MMC.
I already own one, and it's just perfectly discovered by Xiaomi BLE integration.
New one has definitely new revision, at least of software, but possibly of hardware as well. Xiaomi BLE integration don't want to discover it.
Here is an output of token_extractor for both devices:
NAME: Mi Temperature and Humidity Monitor Digital Clock 2
ID: blt.4.1d5xxxxxxxx00
BLE KEY: 19b1c678ab0a8bc3dc7xxxxxxxxxxxxx
MAC: A4:C1:38:xx:xx:xx
TOKEN: 82d6f34d432d190fdxxxxxxx
MODEL: miaomiaoce.sensor_ht.t8
---------
NAME: Mi Temperature and Humidity Monitor Digital Clock
ID: blt.3.17xxxxxxxx400
BLE KEY: dbe74af28f73bde120cxxxxxxxxxxxxx
MAC: E7:2E:01:xx:xx:xx
TOKEN: 7429439374ecc609exxxxxxx
MODEL: miaomiaoce.sensor_ht.t1
I've attached part of my logs related to both devices. I think the root of the problem is a "connectable" state of the new revision.
What version of Home Assistant Core has the issue?
Home Assistant 2023.2.5 Supervisor 2023.01.1 Operating System 9.5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Xiaomi BLE
Link to integration documentation on our website
https://www.home-assistant.io/integrations/xiaomi_ble/
Diagnostics information
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hey there @jc2k, @ernst79, mind taking a look at this issue as it has been labeled with an integration (xiaomi_ble
) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of xiaomi_ble
can trigger bot actions by commenting:
-
@home-assistant close
Closes the issue. -
@home-assistant rename
Renames the issue. -
@home-assistant reopen
Reopen the issue. -
@home-assistant unassign xiaomi_ble
Removes the current integration label and assignees on the issue, add the integration domain after the command.
(message by CodeOwnersMention)
xiaomi_ble documentation xiaomi_ble source (message by IssueLinks)
I can confirm the issue with new version xiaomi Mi Temperature and Humidity Monitor Digital Clock LYWSD02MMC (miaomiaoce.sensor_ht.t8). Is there a way to add support on this version?
I do face the same problems with the LYWSD02MMC.
Similarly, I have no issues with the older versions (LYWSD02)
Same problem with model miaomiaoce.sensor_ht.t8
.
Yes, we can add this device, @PlusPlus-ua can you share the full encryption key with me, such that I can add it? You can send it by mail (e.klamer at gmail) if you don't want to share it here. You can always generate a new one by re-adding it to MiHome.
Note to myself, it uses device type code 0x2542
thanks @Ernst79 -
would it be possible to also have a way to sync the clock? for now I use this and it works: https://saso5.github.io/LYWSD02-clock-sync/
if it helps, here is mine: Mi token: d7f07347c5d3c549a1fa5d92 Bind key: 18be7b1187a262bcab27d925bd998175
Hope that is what you need, let me know if you need anything else.
I also need some logs of the BLE messages, you can get these by logging the Bluetooth integration (look for the MAC to filter out your sensor.
About syncing the clock. This must be possible, but I'm not familiar with connecting to BLE devices (I have decided to limit my time to passive/active scanning BLE devices only). Perhaps @Jc2k can help, he also made the connection for getting the battery info of the plant sensors, which is the same technique.
is this what you need? if not let me know, happy to help just need a bit more guidance :)
name: "LYWSD02MMC"
rssi: -61
service_data {
uuid: "0xFE95"
data: "0ZB%\000\211\333^8\301\244\010"
}
Hi guys,
Credentials of my device is: NAME: Mi Temperature and Humidity Monitor Digital Clock 2 ID: blt.4.1d5tgaqmkgg00 BLE KEY: 19b1c678ab0a8bc3dc77765f059188d4 MAC: A4:C1:38:0E:FD:78 TOKEN: 82d6f34d432d190fdf770494 MODEL: miaomiaoce.sensor_ht.t8
The log: https://drive.google.com/file/d/1ASqeGTChqpIgfw87n-ey8U8BoyXavSZv/view?usp=sharing
I'm working now on Tuya BLE integration, and I think adding connection option to existing code will need too many changes.
@AziwACH You should be able to collect the logs by enabling logging for the Bluetooth integration, see https://www.home-assistant.io/integrations/logger/
# Example configuration.yaml entry
logger:
default: info
logs:
homeassistant.components.bluetooth: debug
After a restart, it will start collecting incoming BLE messages in your Home Assistant logs.
@PlusPlus-ua Your google drive isn't accessible, I have send an access request.
@Ernst79 - I just sent you the logs by email (using your gmail account you sent earlier). I hope I did it right, please let me know if you need anything else or I need to do something differently.
I was also able to download the logs from @PlusPlus-ua earlier today.
I hope these help. Thanks a lot for your help!
Thanks guys. I have all the info I need.
PR for the parser is ready https://github.com/Bluetooth-Devices/xiaomi-ble/pull/43
Thanks so much Ernst.
Sorry I am new to this - does this mean that this will be available with the next (or a future) update of ESP Home?
Just to be clear, it will be added to Home Assistant, not ESPHome (ESPHome is just passing through the data to Home Assistant). So it will require a Home assistant update, but first #90806 has to be merged into the development version.
The normal procedure is that new things will be included in a new monthly release. As we missed the deadline for the April release (which is already in beta at this moment), we (you) will have to wait till the May 2023 release (or use the dev version in the meantime).
got it! thank you fully understood!
Again, appreciate your help and explanations! take care :)