hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
266 stars 52 forks source link

LYWSD02MMC not working #125

Open vbarba opened 3 years ago

vbarba commented 3 years ago

Hi,

I just added my LYWSD02MMC and I get the following error:

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 14. Received 15

Versions

Configuration

        {
            "name": "Termometro5",
            "address": "",
            "temperatureName": "Temperatura5",
            "humidityName": "Humedad5",
            "fakeGatoEnabled": true,
            "timeout": 15,
            "forceDiscovering": true,
            "forceDiscoveringDelay": 2500,
            "disableBatteryLevel": false,
            "lowBattery": 10,
            "temperatureOffset": 0,
            "humidityOffset": 0,
            "updateInterval": 10,
            "accessory": "Hygrotermograph"
        }
vbarba commented 3 years ago

Here full details of the error:

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 14. Received 15
    at boundsError (internal/buffer.js:83:9)
    at Buffer.readInt16LE (internal/buffer.js:411:5)
    at Parser.parseTemperatureEvent (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/parser.js:235:32)
    at Parser.parseEventData (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/parser.js:205:21)
    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:171:52)
    at Scanner.onDiscover (/homebridge/node_modules/homebridge-mi-hygrothermograph/lib/scanner.js:92:25)
    at Noble.emit (events.js:327:22)
    at Noble.onDiscover (/homebridge/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/noble/lib/noble.js:196:10)
    at NobleBindings.emit (events.js:315:20) {
  code: 'ERR_OUT_OF_RANGE'
}
hannseman commented 2 years ago

Looks like an issue in noble which is a dependency this plugin use: https://github.com/abandonware/noble/issues/84

hannseman commented 2 years ago

Appears like people have had success by using a Bluetooth Dongle or upgrading to RPI4. See https://github.com/akx/hass-ruuvitag/issues/18. Please try that if possible.

Tapsel99 commented 2 years ago

Node.js Version | v16.13.1 NPM: v8.3.0 Plugin:3.1

I can't find any detailed error log or option in the plugin settings to turn this on.

[13/01/2022 19:35:17.713] [WARN] noble warning: unknown handle 64 disconnected!

I have a fresh HB installation on my new RPI4 with no BT Dongle but it still doesn't work. In the Home app it says unreachable/no response. I have another Plugin that uses BT which connects to a BT Thermostat.

Ludwigtch commented 2 years ago

Any update? Same error here.