howanghk / homebridge-ewelink

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

Plugin not working with T1 T2 T3 EU switches #83

Closed io-engineers closed 4 years ago

io-engineers commented 4 years ago

Hi,

I installed the plugin. As long as there is no request send to the API, all works fine. When I push a button (switch) in the Homekit app, an error occures in Homebridge:

Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 10809f36-0bbf-43a5-bf7d-9e2be6b1ce5f at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:268:13) at Bridge.Accessory.addBridgedAccessories (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:299:10) at Server._handleRegisterPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:490:16) at Server. (/usr/local/lib/node_modules/homebridge/lib/server.js:41:10) at API.emit (events.js:311:20) at API.registerPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/api.js:171:8) at eWeLink.addAccessory (/usr/local/lib/node_modules/homebridge-ewelink-max/index.js:776:14) at eWeLink.updatePowerStateCharacteristic (/usr/local/lib/node_modules/homebridge-ewelink-max/index.js:799:18) at /usr/local/lib/node_modules/homebridge-ewelink-max/index.js:351:58 at Array.forEach () at WebSocketClient.platform.wsc.onmessage (/usr/local/lib/node_modules/homebridge-ewelink-max/index.js:349:62) at WebSocket. (/usr/local/lib/node_modules/homebridge-ewelink-max/index.js:2139:14) at WebSocket.emit (events.js:311:20) at Receiver._receiver.onmessage (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/WebSocket.js:141:47) at Receiver.dataMessage (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/Receiver.js:389:14) at Receiver.getData (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/Receiver.js:330:12) at Receiver.startLoop (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/Receiver.js:165:16) at Receiver.add (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/Receiver.js:139:10) at TLSSocket. (/usr/local/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)

I've tried cleaning acccessoiry cache folder, this helps so homebridge starts up again, but this doesn't solve the issue.

No other plugins are installed currently. Homebridge is at the latest version, so is Node.js

io-engineers commented 4 years ago

Stangely this issue solved itself after an hour of not using the brigde. Suddenly the plugin started working without issues.

Thanks, sorry to bother.

bartgabriels commented 4 years ago

I'm still having this issue.

[5/11/2020, 15:02:37] [eWeLink] SC SK Zussen CH 1 Configure Accessory [5/11/2020, 15:02:37] [eWeLink] SC SK Zussen CH 2 Configure Accessory [5/11/2020, 15:02:37] [eWeLink] SC SK Zussen CH 1 Configure Accessory [5/11/2020, 15:02:37] 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)

It looks like it's trying to import the same switch twice?

howanghk commented 4 years ago

Hi @hoezoit the issue should be fixed by jacopofranza in https://github.com/howanghk/homebridge-ewelink/pull/86 , please install the latest version 0.1.21 and try again. You may also need to clear existing accessories cache (remove the accessories directory in homebridge folder).

@bartgabriels please do not repost on multiple issues, keeping the same bug in a single issue help tracking the bug down easier.