howanghk / homebridge-ewelink

Homebridge plugin to control Sonoff relays with OEM firmware
MIT License
81 stars 46 forks source link

Error when using a switch with 2 channels : makes Homebrige crash and stop #73

Closed mabdelmo closed 4 years ago

mabdelmo commented 4 years ago

Hi all

I have installed and configured Homebridge and homebridge-ewelink-max on my raspberry. It works very well except for one swicth with 2 channels that i use to open my sliding gate. Channel 1 opens fully the gate and channel 2 opens it only at half. problem is whenever is use this device on homebrige it crashes with following error message : "Error: Cannot add a bridged accessory with the same UUID as another bridge accessory..."

It seems that it tries to add 2 accessories on the same UUID of the switch device...

anybody has seen the same issue or knows what to do please ?

Thanks a lot for your help

fratinize commented 4 years ago

I see the Same Issue when I Turn Something on, Same Error and It Quits. I have to Delete the cashedAccessories in order for it to Start Back Up

TurtleRad commented 4 years ago

I'm having this issue too...

Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx at Bridge.Accessory.addBridgedAccessory (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:268:13) at Server._configCachedPlatformAccessories (/usr/lib/node_modules/homebridge/lib/server.js:396:18) at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:93:8) at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:59:10) at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)

jacopofranza commented 4 years ago

Same problem here, here it is the log. How can we fix??

[Sun May 10 2020 18:03:28 GMT+0200 (CEST)] [eWeLink] Update message received for device [1000ba959a] [Sun May 10 2020 18:03:28 GMT+0200 (CEST)] [eWeLink] { action: 'update', deviceid: '1000ba959a', apikey: 'apikey', userAgent: 'device', ts: 0, params: { switches: [ [Object], [Object], [Object], [Object] ] }, from: 'device', seq: '143' } [Sun May 10 2020 18:03:28 GMT+0200 (CEST)] [eWeLink] Adding accessory for deviceId [1000ba959aCH1]. [Sun May 10 2020 18:03:28 GMT+0200 (CEST)] [eWeLink] Found Accessory with Name : [piscina4ch CH 1], Manufacturer : [4CH], Status : [off], Is Online : [true], API Key: [mykey] [Sun May 10 2020 18:03:28 GMT+0200 (CEST)] [eWeLink] Device type for 4 is SOCKET_4 [Sun May 10 2020 18:03:28 GMT+0200 (CEST)] [eWeLink] Device type for 4 is SOCKET_4 [Sun May 10 2020 18:03:28 GMT+0200 (CEST)] Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 8303eb11-bba1-4cb1-87fa-ea6f832855c6 at Bridge.Accessory._this.addBridgedAccessory (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:413:15) at Bridge.Accessory._this.addBridgedAccessories (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:447:12) at Server.handleRegisterPlatformAccessories (/usr/lib/node_modules/homebridge/src/server.ts:520:17) at HomebridgeAPI.emit (events.js:311:20) at HomebridgeAPI.registerPlatformAccessories (/usr/lib/node_modules/homebridge/src/api.ts:296:10) at eWeLink.addAccessory (/usr/lib/node_modules/homebridge-ewelink-max/index.js:776:14) at eWeLink.updatePowerStateCharacteristic (/usr/lib/node_modules/homebridge-ewelink-max/index.js:799:18) at /usr/lib/node_modules/homebridge-ewelink-max/index.js:351:58 at Array.forEach () at WebSocketClient.platform.wsc.onmessage (/usr/lib/node_modules/homebridge-ewelink-max/index.js:349:62) [Sun May 10 2020 18:03:28 GMT+0200 (CEST)] Got SIGTERM, shutting down Homebridge... [Sun May 10 2020 18:03:31 GMT+0200 (CEST)] [eWeLink] WebSocket messge received: �~{"action":"update","deviceid":"1000ba959a","apikey":"apikey","userAgent":"device","ts":0,"params":{"switches":[{"switch":"off","outlet":0},{"switch":"on","outlet":1},{"switch":"off","outlet":2},{"switch":"off","outlet":3}]},"from":"device","seq":"1 WebSocketClient: error [Arguments] { '0': Error: RSV2 and RSV3 must be clear at Receiver.getInfo (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/Receiver.js:184:18) at Receiver.startLoop (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/Receiver.js:153:16) at Receiver.add (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/Receiver.js:139:10) at TLSSocket. (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/WebSocket.js:138:22) at TLSSocket.emit (events.js:311:20) at addChunk (_stream_readable.js:294:12) at readableAddChunk (_stream_readable.js:275:11) at TLSSocket.Readable.push (_stream_readable.js:209:10) at TLSWrap.onStreamRead (internal/stream_base_commons.js:186:23) } [Sun May 10 2020 18:03:31 GMT+0200 (CEST)] [eWeLink] WebSocket was closed. Reason [1002]

jacopofranza commented 4 years ago

problem just resolved, check it out my fork
:)
here it is the commit @howanghk

bartgabriels commented 4 years ago

@jacopofranza What does this mean? Not so familiar with Github etc, but will this be fixed in the next update (currently running 0.1.20) and also facing this bug

bartgabriels commented 4 years ago

After the new version (0.1.21), I'm still facing this issue:

[5/11/2020, 16:35:34] [eWeLink] SC SK Zussen CH 1 Configure Accessory [5/11/2020, 16:35:34] [eWeLink] SC SK Zussen CH 2 Configure Accessory [5/11/2020, 16:35:34] [eWeLink] SC SK Zussen CH 1 Configure Accessory [5/11/2020, 16:35:35] Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: dcbb77f8-cd56-4d8f-a6af-c897f3432f1d at Bridge.Accessory._this.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:413:15) at /usr/local/lib/node_modules/homebridge/src/server.ts:309:19 at Array.filter () at Server.restoreCachedPlatformAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:269:69) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:157:10) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:78:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1156:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) at Module.load (internal/modules/cjs/loader.js:1000:32)

jacopofranza commented 4 years ago

@bartgabriels you should delete the cache after do the update because if you endured in the error before, now your cache has two identical accessories saved. Did you? To delete cache, from your local path, run: cd .homebridge/ sudo rm -r Accessories/ The path of hombridge may little vary, depends on your system, also Accessories could be in lowercase.

bartgabriels commented 4 years ago

@bartgabriels you should delete the cache after do the update because if you endured in the error before now your cache has tow identical accessories saved. Did you? To delete cache, from your local path, run: cd .homebridge/ sudo rm -r Accessories/ The path of hombridge may little vary, depends on your system, also Accessories could be in lowercase.

Fixed after clearing cache.

howanghk commented 4 years ago

@jacopofranza Thanks for the fix! @bartgabriels Thanks for confirming the issue is fixed!