Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of Support For Multiple Areas. #28

Open
hjdhjd opened this issue May 25, 2021 · 10 comments
Open

Lack of Support For Multiple Areas. #28

hjdhjd opened this issue May 25, 2021 · 10 comments

Comments

@hjdhjd
Copy link

hjdhjd commented May 25, 2021

TL;DR: This plugin doesn't seem to cleanly support multiple areas. In my use case, one Elk alarm system with a few dozen zones that's been partitioned into two areas that can be individually armed.

As it stands right now, multiple areas aren't supported directly in this plugin. You can't add a second instance of the plugin directly - first, it's an unsupported / deprecated homebridge approach: platform plugins should always only have a single instance, and this functionality will be removed in a future release of homebridge, sooner than later.

Second, and more critically, even if you do so, the way the UUID is generated for the Elk controller guarantees a namespace collision on the next reboot, and a homebridge reboot loop / cachedAccessories corruption will ensue.

There's not a good way to deal with the UUID issue - the "right" answer is to ensure the support properly exists in the plugin for multiple areas. The only meaningful workaround would be to run multiple homebridge instances.

Any plans to add this support in the near future?

Much appreciated.

@daev1966
Copy link

daev1966 commented May 25, 2021 via email

@hjdhjd
Copy link
Author

hjdhjd commented May 25, 2021

The workaround, for the time being, is to put each area security system into a child bridge. You can get all the sensors off of one and just use the child bridges for getting the additional security system trigger up and running.

@subcritical71
Copy link

subcritical71 commented May 26, 2021

I was having stability issues with home bridge with the hb-smart-irrigation and hb-elkm1 plugins installed. So I put both plugins into their own child bridges. I also have 2 security areas and would like to get the second one added. How would I go about getting the 2nd hb-elkm1 child bridge created? Is there a how-to somewhere? I've searched, but like many things you search the answer is not obvious until someone else points it out first...

@hjdhjd
Copy link
Author

hjdhjd commented May 26, 2021

Open the settings for the plugin in Homebridge UI. Go to the very bottom…you’ll see a button to add another platform…that will create an additional instance of the plugin. Once you’ve entered in those settings, save it.

Then go to the main Homebridge UI screen, click on the little wrench icon again…you should see both instances of the plugin there, and you can enable or disable whether any of them are their own child bridges.

I should also emphasize: this is a deprecated configuration for Homebridge. While it will work, for now, it will NOT work in the next major (not minor) Homebridge release. The right fix for this is to fully support multiple areas in the platform plugin.

@daev1966
Copy link

daev1966 commented May 27, 2021 via email

@hjdhjd
Copy link
Author

hjdhjd commented May 27, 2021

To clarify: Adding them to child bridges circumvents the issue, certainly. It's why I did it as I described above. 😀

That said, it's not the intent of platform plugins and if you were to try to have two instances of the same platform plugin in the same homebridge instance, you will see a warning letting you know this is a bad idea and deprecated behavior.

Homebridge source code documentation, for reference, on the above:

https://github.com/homebridge/homebridge/blob/dc314195ada9ffe2bb29a130d7bbeda4d2ed8e1f/src/plugin.ts#L123

Because this happens to work now is no guarantee that it works in the future…largely child bridges exist for performance reasons (slow plugins slowing down all other homebridge plugins) and misbehaving plugins (plugins that crash taking out the entire homebridge instance). Yes, they can be used as I used them above to create multiple homebridge instances without the overhead…but still the point remains: ideally, one shouldn’t need contortions like child bridges to get multiple security areas to work in this plugin. 😄

@paulw11
Copy link
Owner

paulw11 commented Jun 8, 2021

It shouldn't be too hard to implement this, but it will involve a change to the config file format; I am proposing to change the area property to be an object rather than an integer. Under this new area will be the area number, keypad code and the zones/garage doors for that area. Each area will be exposed as a separate alarm instance to Homekit.

It will take a little work and would like this to be a non-breaking change (ie. it should continue to work with the current style config).

I have a few other things on in my day job at the moment, so it might be a few more weeks before I can get this done

@kristiandg
Copy link

I found that while I was in the RP software, this plugin wouldn't keep HomeKit updated (not a plugin problem - it suggested the Elk Ethernet Controller could only handle 1 session at a time - when I'd drop ElkRP connection, HomeKit would get updates again within a minute or two) If that's the case (single session on Ethernet Controller), would you really be able to create multiple areas to the same controller (or would you have to install multiple Ethernet Controllers - I don't even recall if the Elk will let you do that).

@hjdhjd
Copy link
Author

hjdhjd commented May 27, 2023

@kristiandg The Elk controller definitely supports more than one connection at a time - I’m currently running in that setup and have for 2+ years (essentially as long a this issue has been open. 😄).

My workaround to the lack of support (as mentioned in my original post) is to simply create two child bridges, each of which will connect to the Elk controller independently - essentially two instances, and two independent connections - to the Elk controller.

Works well. Just inelegant that I need to run two instances for a single Elk controller because the plugin lacks support for multiple areas.

@kristiandg
Copy link

Well, that is good news - Agreed, not the most elegant, but not the end of the world. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants