davidashman / homebridge-cync-lights

Apache License 2.0
8 stars 4 forks source link

Lights don't show up #4

Open Klarence opened 5 months ago

Klarence commented 5 months ago

Describe The Bug: Homebridge Status Not running - View logs NodeError value out of range when trying to updateConnection, then Homebridge restarts.

To Reproduce: Happens every time I start Homebridge and continuously thereafter. It continuously restarts Homebridge so I need to edit my config to remove the CyncLights platform so I can navigate to plugins in order to make changes.

Note: I tried several other versions of this plugin as my lights never registered. They did show up in the cached accessories list

Expected behavior: Child Bridge is connected and plugin authentication is successful so it should register the lights.

Logs:

[18/01/2024, 10:51:31] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge B107) is running on port 51473.
[18/01/2024, 10:51:32] [Cync Lights] Discovering homes...
[18/01/2024, 10:51:32] [Cync Lights] Connecting to Cync server...
[18/01/2024, 10:51:32] [Cync Lights] Authenticating with Cync server...
[18/01/2024, 10:51:32] [Cync Lights] Cync server connected.
[18/01/2024, 10:51:33] [Cync Lights] Registering device: {"deviceType":128,"switchID":1053453445527002,"displayName":"light 1","deviceID":1053453445527002}
[18/01/2024, 10:51:33] [homebridge-cync-lights] This plugin generated a warning from the characteristic 'Firmware Revision': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
[18/01/2024, 10:51:33] [homebridge-cync-lights] This plugin generated a warning from the characteristic 'Serial Number': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
[18/01/2024, 10:51:33] RangeError: The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received 1_054_066_527_002
    at new NodeError (node:internal/errors:405:5)
    at checkInt (node:internal/buffer:74:11)
    at writeU_Int32BE (node:internal/buffer:804:3)
    at Buffer.writeUInt32BE (node:internal/buffer:817:10)
    at CyncHub.updateConection (file:///var/lib/homebridge/node_modules/homebridge-cync-lights/src/hub.ts:202:10)
    at CyncHub.registerDevice (file:///var/lib/homebridge/node_modules/homebridge-cync-lights/src/hub.ts:292:12)
    at CyncLightsPlatform.discoverDevices (file:///var/lib/homebridge/node_modules/homebridge-cync-lights/src/platform.ts:149:22)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
[18/01/2024, 10:51:33] Got SIGTERM, shutting down Homebridge...```

**Plugin Config:**

```json
       {
            "platform": "CyncLights",
            "name": "Cync Lights",
            "emailAddress": "redacted,
            "refreshToken": "redacted",
            "userID": redacted,
            "authorize": "redacted"
        }

Screenshots:

Environment:

mjpakmehr commented 5 months ago

Have exact same issue here, where I receive range error for one of the device's serials.

[19/01/2024, 16:04:51] [Cync Lights] Adding new accessory: MG’s Closet Light Strip [19/01/2024, 16:04:51] [Cync Lights] Registering accessory MG’s Closet Light Strip [19/01/2024, 16:04:51] [Cync Lights] Registering device: [19/01/2024, 16:04:51] [Cync Lights] Adding new accessory: Side lamp [19/01/2024, 16:04:51] [Cync Lights] Registering accessory Side lamp [19/01/2024, 16:04:51] [Cync Lights] Registering device: {"deviceType":64,"switchID":817939369001,"displayName":"Side lamp","deviceID":817939369001} [19/01/2024, 16:04:52] [homebridge-cync-lights] This plugin generated a warning from the characteristic 'Firmware Revision': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info. [19/01/2024, 16:04:52] [homebridge-cync-lights] This plugin generated a warning from the characteristic 'Serial Number': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info. RangeError: The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received 817_939_369_001 at checkInt (node:internal/buffer:74:11) at writeU_Int32BE (node:internal/buffer:804:3) at Buffer.writeUInt32BE (node:internal/buffer:817:10) at CyncHub.updateConection (file:///var/lib/homebridge/node_modules/homebridge-cync-lights/src/hub.ts:227:10) at CyncHub.registerDevice (file:///var/lib/homebridge/node_modules/homebridge-cync-lights/src/hub.ts:318:12) at file:///var/lib/homebridge/node_modules/homebridge-cync-lights/src/platform.ts:85:16 at CyncApi.forEachDevice (file:///var/lib/homebridge/node_modules/homebridge-cync-lights/src/api.ts:100:13) at processTicksAndRejections (node:internal/process/task_queues:95:5) at CyncLightsPlatform.discoverDevices (file:///var/lib/homebridge/node_modules/homebridge-cync-lights/src/platform.ts:68:5) [19/01/2024, 16:04:52] [Cync Lights] Child bridge process ended [19/01/2024, 16:04:52] [Cync Lights] Process Ended. Code: 1, Signal: null