Generic Component Contact Sensor change?

I have a few Konnected alarm panels that have stopped reporting changes to contact sensors. It looks like the Konnected driver code (Konnected Alarm Panel) calls childDevice.getSupportedAttributes().first() that used to report "contact" but now reports "battery". I believe that this change was made in the Generic Component Contact Sensor code a day or so ago to put battery as the first attribute. Not sure if that can be changed or if Konnected needs to now change their code. But I believe that this is what has stopped my alarm panels from reporting correctly.
I believe that this started with 2.4.3.131.
Thanks for your time.


Please provide your hub model (C7, C8, etc.) and its platform version from Settings>Hub Details.

Check out the following post for help troubleshooting problems and gathering details that will help others to identify and solve the problem you are experiencing: โ€ผ READ FIRST - Before Posting in Get Help


Battery was recently added to some component drivers, including this one. But there's no inherent meaning in the order of the attributes, so I'm not sure what the intent with calling first() on this list is. Should it just be checking if it contains "contact" instead, or some other solution? Something like that seems like it would make more sense offhand, without knowing or seeing any context.

1 Like

IMO Konnected should update their driver. What they did was a bad idea and assumed the built in child drivers would never change.

@bertabcd1234 I am guessing since most of the component drivers like that only have one attribute using .first() was the super easy, bad idea, way to just grab the only attribute.

Proper way IMO would be to use .find with a closure to get just the desired attribute.

1 Like

I concur. It should be Konnected to fix the problem. Using .first() and hoping it returns the correct attribute is not good code.

In the meantime, since I don't have anything other than contacts, I just made the code a little uglier so I can move on.

switch (attr) {
    case 'battery':
    case 'contact':
    ....
2 Likes

Do they have the code posted on github at all? Give me a link if they do.

in the alarmpanel.zip file.
also in hpm.

Tagging @nate from Konnected to make sure he is aware.

1 Like

Thanks for flagging. Would someone like to make the fix and open a PR?

1 Like

I was considering it which is why I asked for the Github link, but I don't actually have the product to test anything.

If anyone else who knows how to do a GitHub PR wants to do it then don't let me stop you, I have plenty of things on my plate already.

Man, i wish i understood this a little better. Thanks to everyone posting here - i was able to revert back to a prior firmware and get my Konnected sensors working again. Terrible timing on my part - i hadnโ€™t attempted to use the Konnected boards in a couple of years - the worked for a day until I updated and then stopped. I thought i was losing my mind.

Following.

Thank you @kamransiddiqi1998 for the PR fix! A $100 Konnected gift card is coming your way as soon as this is merged.

I just had one comment/suggestion for you to clean up the code fix a little bit, then I will get this released. Thanks all for your patience.

4 Likes

Top Notch Service Sir.... :slight_smile:

No problem and thanks for the gift card! I just made the suggested changes and validated.
Didn't realize that this issue was already being discussed here while I was troubleshooting the issue over the weekend.

4 Likes

This has been fixed in 2025.10.0 which you can update from HPM or download and install the AlarmPanel.zip package into Hubitat to overwrite the old version.

Thanks again @kamransiddiqi1998 for the fix and @ogiewon for the heads up and everyone else for their input in identifying the problem.

Let me know if you run into trouble with the update.

4 Likes