snowdd1 / homebridge-knx

KNX platform shim for homebridge
https://github.com/nfarina/homebridge
GNU General Public License v2.0
97 stars 56 forks source link

multiple homebridge instances + knx ? #86

Closed zork17 closed 7 years ago

zork17 commented 7 years ago

I'm trying to run 2 homebridge instances to overcome the 100 accessories limit. The first instance has 90+ knx accessories. The second homebridge instance points to a new folder with a new config.json file, but when it launches it is looking for the knx_config.json file although there is no knx platform in the second instance config.json.

When I put an empty knx_config.json file or one with different ip port I get an error: Error: Cannot reach knxd or eibd service, please check installation and knx_config.json

Is there a way to tell homebridge not to load knx in an homebridge instance? so I can run 2 homebridge instances but only one with knx

snowdd1 commented 7 years ago

Not if you have homebridge-knx installed "globally", i.e. with the -g flag and potentially using sudo. Homebridge instances always load all global platforms, plus those installed in the same folder as homebridge, plus those in a directory specified when starting homebridge (Parameter see readme of homebridge itself, section developing plugins). So you would need to make you homebridge-knx installation a local one with a path not auto-discovered by homebridge, so you can explicitly tell one instance to use that platform.

However, as mentioned several times in different discussions here and in the homebridge repository, it is common practice to bundle accessories, that is using one accessory (or device) section for as many services there are in a room, and then assign just that 1 room accessory to a room. With that, I am down to the ~20 rooms (with virtual rooms such as porch and heating boiler) and can control my several hundred services without hassle.

Being pointed to that some days ago, I even changed the knx_config-documentation to show that.

I hope that helps you.

zork17 commented 7 years ago

I did not understand the second paragraph about how to reduce the number of accessories in my home.

Apparently, every plugin is installed globally.

So now if I want knx to be in one instance only, I need to uninstall knx and install it again without -g ? And where should I put the knx_config?

matevzg commented 7 years ago

@zork17 read this issue - https://github.com/snowdd1/homebridge-knx/issues/83.

Essentially it's a lot wiser to bundle multiple services in a single device. You should be able to overcome your current limit.

snowdd1 commented 7 years ago

Look here: in the example I have one "Office" device instead of a light device and an extra blinds device. Those are just services the "room" has to offer:
https://github.com/snowdd1/homebridge-knx/blob/master/knx_config.json.md#example

hyperbart commented 7 years ago

@zork17 I had some "problems" with this new way of thinking too. Think of a room as one device containing multiple "things" (being services) you can control. Light 1/2/3/4, ventilation and so forth.

Owh yeah and btw... Take some time to reconfigure your Homebridge, it will take you an hour or so, I did the same here 😃

snowdd1 commented 7 years ago

Addressed option to stop homebridge from loading in a multiple config environment in commit https://github.com/snowdd1/homebridge-knx/commit/11481d56e7cca9eb293984e017b7e11c42577a1d