datMaffin / homebridge-tesla-powerwall

Homebridge Plugin for the Tesla Powerwall
ISC License
21 stars 11 forks source link

Support for multiple gateway/powerwall #48

Open ediaz252 opened 1 year ago

ediaz252 commented 1 year ago

First of all, thank you for this amazing project. I'm running the latest beta and the gridisdown button is extremely useful for automation (I've tested it successfully). I have a situation where due to how the power is arranged in my home, I've needed to utilize two different sets of gateways. I was able to successfully add the first gateway, but I'm struggling to figure out how to add the second gateway to my config. I receive the following error message when trying to load the plugin:

[07/11/2022, 13:19:44] Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: ************* at Bridge.Accessory.addBridgedAccessory (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:594:15) at /var/lib/homebridge/node_modules/homebridge/src/bridgeService.ts:552:25 at Array.forEach (<anonymous>) at /var/lib/homebridge/node_modules/homebridge/src/bridgeService.ts:539:21 at /var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:10:18 at TeslaPowerwall.accessories (/var/lib/homebridge/node_modules/homebridge-tesla-powerwall/index.js:493:9) at /var/lib/homebridge/node_modules/homebridge/src/bridgeService.ts:534:24 at new Promise (<anonymous>) at BridgeService.loadPlatformAccessories (/var/lib/homebridge/node_modules/homebridge/src/bridgeService.ts:528:12) at /var/lib/homebridge/node_modules/homebridge/src/server.ts:478:42

Is there a way to add a secondary gateway to the configuration without the need to reload the plugin? Thank you in advance.

datMaffin commented 1 year ago

I am not entirely sure how you even managed to load it twice.

I guess a possible hack could be to install this plugin twice: Basically fork this plugin, change the name here https://github.com/datMaffin/homebridge-tesla-powerwall/blob/master/index.js#L26 and then install it a second time.

But that is not really an elegant solution.

I am also not sure what you mean by "reload the plugin", which seems to solve your issue(?)