Skip to content
New issue

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

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

Already on GitHub? # to your account

Plugin can't read data from LYWSD02MMC #186

Open
ndrobac opened this issue Sep 14, 2022 · 0 comments
Open

Plugin can't read data from LYWSD02MMC #186

ndrobac opened this issue Sep 14, 2022 · 0 comments

Comments

@ndrobac
Copy link

ndrobac commented Sep 14, 2022

It does find the device, the decryption key is added properly, but it gets confused with strange event type number.

Expected Behaviour

Plugin should read the data from device, and decrypt it well, so the info can be properly passed to Homekit.

Current Behaviour

Plugin finds the device, but it can't parse the data properly
Accessories show values of 0.

Steps to Reproduce (for bugs)

  1. install the plugin
  2. restart the homebridge
  3. look at the log...

Versions

  • homebridge: 1.5.0
  • homebridge-mi-hygrothermograph: homebridge-mi-hygrothermograph@3.3.1
  • node: v16.16.0
  • OS: oznu/homebridge ubuntu
  • device model: LYWSD02MMC
  • device hardware version: F3_A1
  • device firmware version: 2.0.1_0060

Homebridge Log / Command Output

[9/14/2022, 6:45:22 PM] [Temperature & Humidity] Error: Unknown event type: 19458. 5858e4163cf674bd38c1a4024c0134
    at Parser.parseEventData (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/parser.js:224:15)
    at Parser.parse (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/parser.js:64:23)
    at Scanner.parseServiceData (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/scanner.js:174:52)
    at Scanner.onDiscover (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/scanner.js:95:25)
    at Noble.emit (node:events:527:28)
    at Noble.onDiscover (/homebridge/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/noble/lib/noble.js:213:10)
    at NobleBindings.emit (node:events:527:28)
    at NobleBindings.onDiscover (/homebridge/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:188:10)
    at Gap.emit (node:events:527:28)
    at Gap.onHciLeAdvertisingReport (/homebridge/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/noble/lib/hci-socket/gap.js:250:10)
[9/14/2022, 6:45:18 PM] [Temperature & Humidity] Error: Unsupported state or unable to authenticate data
    at Decipheriv.final (node:internal/crypto/cipher:193:29)
    at Parser.decryptPayload (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/parser.js:189:14)
    at Parser.parse (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/parser.js:59:12)
    at Scanner.parseServiceData (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/scanner.js:174:52)
    at Scanner.onDiscover (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/scanner.js:95:25)
    at Noble.emit (node:events:527:28)
    at Noble.onDiscover (/homebridge/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/noble/lib/noble.js:213:10)
    at NobleBindings.emit (node:events:527:28)
    at NobleBindings.onDiscover (/homebridge/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:188:10)
    at Gap.emit (node:events:527:28)
[9/14/2022, 6:45:22 PM] [Temperature & Humidity] [a4:c1:**:**:**:**] Discovered peripheral
      Id: a4c1********
      LocalName: undefined
      rssi: -75
      serviceData: 5858e4163cf674bd38c1a411b879fa7204002ff86693

Other notable things

I did try hcitool lescan, and it does list the bluetooth devices via homebridge console, so the bluetooth hardware and hci scanning works.
Also tried to run it without entering MAC address, and LE decryption key (finds it, asks for decryption key).
Also tried Mijia Thermometer plugin - which gets the first batch of data when initially connects, but then again has same 2 errors like above mentioned.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant