custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.89k stars 243 forks source link

Losing connetion with one of the LYWSD03MMC sensors. #87

Closed Napalmcold closed 3 years ago

Napalmcold commented 4 years ago

Hi! I really need your help. I'm facing a problem with one of my LYWSD03MMC sensors. For now I have 2 of those integrated to my HA, but one of them (MAC: A4C13801B8CB) keeps losing connection. Re-adding it into mihome app and changing the bindkey solves the issue for about a day or a couple. Then it disconnects again and I need to repeat those manipulations with mihome app and change the key. But the other sensor works flawlessly. Here's my config:

RasPi 3B Home Assistant 0.111.4

  • platform: mitemp_bt hci_interface:
    • 0
    • 1 encryptors: 'A4:C1:38:01:B8:CB': '11b9748fe426f22f589f3756303ccd40' 'A4:C1:38:2E:65:75': '6ebee977033d1d172521fa02a19c3c2d'

And here's the log:

020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed: MAC check failed 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] token: c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] nonce: cbb80138c1a45b0563030000 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] encrypted_payload: 357b883b2c030000c0994d10 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] cipherpayload: 357b883b2c 2020-06-16 18:45:16 ERROR (SyncWorker_12) [custom_components.mitemp_bt.sensor] Decryption failed for A4C13801B8CB, decrypted payload is None 2020-06-16 18:45:17 DEBUG (SyncWorker_12) [custom_components.mitemp_bt.sensor] Finished. Parsed: 2814 hci events, 1 xiaomi devices.

TychoWerner commented 4 years ago

Getting the same error: Home Assistant 0.112.2 Firmware on the device: 0109; Hardware version B1.4 HACS installed 0.7.1-beta

stefangries commented 4 years ago

Getting the same error: Home Assistant 0.112.2 Firmware on the device: 0109; Hardware version B1.4 HACS installed 0.7.1-beta

Same for me. Same Configuration, but FW 106.

vdiogo commented 4 years ago

Same issue here. HACS 1.5.2 HA Core 0.114.0 Xiaomi device fw 0109

Ernst79 commented 4 years ago

Try to use the stable version (6.11).

JaCoLJcL commented 4 years ago

Same here

Szczegóły loga (ERROR) Logger: custom_components.mitemp_bt.sensor Source: custom_components/mitemp_bt/sensor.py:315 Integration: mitemp_bt (documentation) First occurred: 15:52:51 (16 occurrences) Last logged: 15:52:51

Decryption failed for A4C1384D2B72, decrypted payload is None

@Ernst79 what do you mean?

Ernst79 commented 4 years ago

What I mean is that everybody who has issues, is using the beta version (0.7.1 beta). This version has significant changes, which do not work well with the latest home assistant (> 0.113). The advise is therefore to use the stable version (0.6.11) of mitemp_bt. You can check the version you use in HACS.

JaCoLJcL commented 4 years ago

What I mean is that everybody who has issues, is using the beta version (0.7.1 beta). This version has significant changes, which do not work well with the latest home assistant (> 0.113). The advise is therefore to use the stable version (0.6.11) of mitemp_bt. You can check the version you use in HACS. @Ernst79 But I have lastes version and is the same error...

xuefer commented 4 years ago

@Ernst79 But I have lastes version and is the same error...

can you please say which version in numbers exactly instead of "latest"

Ernst79 commented 4 years ago

0.6.11 is the latest at the moment

JaCoLJcL commented 4 years ago

0.6.11 is the latest at the moment

I use this version and have a problem only with one device

Ernst79 commented 4 years ago

Ok, thanks for your response. I leave the issue open. Unfortunately @Magalex2x14 seems to be busy, as I haven't seen him around lately here. My programming skills are limited, so hopefully, somebody else can help you.

xuefer commented 4 years ago

0.6.11 is the latest at the moment

I use this version and have a problem only with one device

can you please report your firmware version number of each device? i wonder if key may change at an interval by latest firmware

JaCoLJcL commented 4 years ago

@xuefer

soft of device with problem (10034_0423)60 Device id blt.4.12k2lklkggc00

All other devices has the same software version

After reset and pair again is seems to be ok now for a 3 days

xuefer commented 4 years ago

@xuefer

soft of device with problem (10034_0423)60 Device id blt.4.12k2lklkggc00

All other devices has the same software version

After reset and pair again is seems to be ok now for a 3 days

sorry, i'm not sure where did you get this version number. can you please check mi home app, click the sensor device with problem (and without problem), press '...' on the top right corner which open up menu you can find "About" mine is:

hardare: B1.4
firmware: 1.0.0_0109
mac: ...

please show your version for both device with problem and no problem. this may be very much useful for developers

driver52 commented 4 years ago

methinks the bind key has changed ;) go here https://atc1441.github.io/TelinkFlasher.html to get a new one this fix worked for me, version 0.6.12 with firmware 0106

JaCoLJcL commented 4 years ago

@xuefer hmm i have vevs mod xiaomi home app and data above is from ABOUT page :o i must tap many times to recive notification with numbers above. Data in app is blank, check it Screenshot_20200912-101954

Ernst79 commented 3 years ago

is any of you still having issues? Please verify your encryption key, to make sure it is right.

Ernst79 commented 3 years ago

Closing this issue. Feel free to reopen if you still are having issues.