AlarmDecoder Bridge security system integration with HKLS

A plugin to integration Indigo devices into HomeKit (and Siri)
User avatar
papamac
Posts: 168
Joined: Wed Jan 29, 2014 2:07 pm

AlarmDecoder Bridge security system integration with HKLS

Post by papamac »

Hi Glenn,

I am working on a security system plugin called AlarmDecoder Bridge (yet another version of Ad2USB) and I'd like to make it work with HLKS. I have modeled the API after the VSS plugin, but making it work requires that HLKS recognize my plugin id. I therefore request that you add the following minor changes to the current HKLS GitHub version 0.5.16:

1. Add "net.papamac.indigoplugin.alarmdecoder-bridge" to the tuple of pluginId's in plugin.py line 2984 (method detectHomeKitType).
.
2. Add "net.papamac.indigoplugin.alarmdecoder-bridge" to the if condition in HKSecuritySystem.py line 101 (method __init__). Consider replacing with the following line:

Code: Select all

if self.plugin_inuse in ("com.boisypitre.vss", "net.papamac.indigoplugin.alarmdecoder-bridge"):
3. Add "net.papamac.indigoplugin.alarmdecoder-bridge" to the if condition in HKSecuritySystem.py line 151 (method set_security). Consider replacing with the following line:

Code: Select all

if self.plugin_inuse in ("com.boisypitre.vss", "net.papamac.indigoplugin.alarmdecoder-bridge"):
4. Add "net.papamac.indigoplugin.alarmdecoder-bridge" to the tuple of pluginIsds in HKSecuritySystem.py line 215 (method get_security).

I have implemented these changes in my home version of HKLS and they work fine. There is no hurry for you to implement them as I will not be releasing AlarmDecoder Bridge for several months. I just want to get the changes in your to do queue

BTW, there were no replies to my January 27th post about using SecuritySpy cameras with HKLS. Have you looked at this? Am I missing something?

Thanks for your help.

David
User avatar
GlennNZ
Posts: 1873
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Re: AlarmDecoder Bridge security system integration with HKL

Post by GlennNZ »

Bugger. Missed this, or indeed thought was a private message along similar lines that I received.

I'll try to get in, before move out of pre-release.

Can you link me to github of plugin - will need device homekit state and actionGroup that needs to be actioned as well I believe.

I did reply to SecuritySpy camera issue , have a look at that thread.

Thanks
User avatar
papamac
Posts: 168
Joined: Wed Jan 29, 2014 2:07 pm

Re: AlarmDecoder Bridge security system integration with HKL

Post by papamac »

Hi Glenn, I just looked at your beta release 0.6.0... you have been very busy. In the next week or so, I will update my changes against your v0.6.0, test them, and send you the revised changes for the AlarmDecoder Bridge. I will use the same style that you used in implementing AD2USB (including the state and plugin action).

I have seen your comments on the Security Spy cameras, but have not had time to work on it. I am busy with a Raspberry Pi project right now.

Thanks for working with me on these things. It takes time, but I think that HLKS is evolving to be the best thing that ever happened to Indigo. Great job!

David
User avatar
papamac
Posts: 168
Joined: Wed Jan 29, 2014 2:07 pm

Re: AlarmDecoder Bridge security system integration with HKL

Post by papamac »

Hi Glenn,

I have updated my requested AlarmDecoder Bridge (ADB) integration changes to reference your GitHub version 0.6.4 of HKLS. Please include these changes in your next release:

1. Add "net.papamac.indigoplugin.alarmdecoder-bridge" to the tuple of pluginId's in plugin.py line 3108 (method detectHomeKitType).

2. Add the following lines to HKSecuritySystem.py after line 95:

Code: Select all

ADB_TO_HOMEKIT_CURRENT = {
    "stay": HK_ALARM_STAY_ARMED,
    "away": HK_ALARM_AWAY_ARMED,
    "night": HK_ALARM_NIGHT_ARMED,
    "disarm": HK_ALARM_DISARMED,
    "triggered": HK_ALARM_TRIGGERED
}
ADB_TO_HOMEKIT_TARGET = {
    "stay": HK_ALARM_STAY_ARMED,
    "away": HK_ALARM_AWAY_ARMED,
    "night": HK_ALARM_NIGHT_ARMED,
    "disarm": HK_ALARM_DISARMED
}
.
3. Add the following lines to HKSecuritySystem.py (method __init__) after line 129:

Code: Select all

        elif self.plugin_inuse == "net.papamac.indigoplugin.alarmdecoder-bridge":
            self.SET_TO_USE_CURRENT = ADB_TO_HOMEKIT_CURRENT
            self.SET_TO_USE_TARGET = ADB_TO_HOMEKIT_TARGET
            self.device_current_state = "securitySystemState"
4. Add "net.papamac.indigoplugin.alarmdecoder-bridge" to the tuple of pluginIsds in HKSecuritySystem.py line 241 (method get_security). Add "ADB" to the debug message in line 243. Question: should AD2USB be included in these to places also?

I have implemented these changes in my home version of HKLS and they work fine. There is no hurry for you to implement them as I will not be releasing AlarmDecoder Bridge for several months. I just want to get the changes in your to do queue

Thanks for your help.

David
User avatar
GlennNZ
Posts: 1873
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Re: AlarmDecoder Bridge security system integration with HKL

Post by GlennNZ »

Thanks

Have added - will upload 0.6.5 in a second.

You will need to add something to the set_security to include your plugin as well?

I would guess you have just forgetton to include it here?
Have followed your first post above where included..
User avatar
papamac
Posts: 168
Joined: Wed Jan 29, 2014 2:07 pm

Re: AlarmDecoder Bridge security system integration with HKL

Post by papamac »

Hi Glenn,

Thanks for including my changes and thanks for noticing the omission of the change to set_security. Actually, I included the change to set_security in my local v0.6.4+, but forgot it when I posted the change package. Anyway, I installed your v0.6.5 this morning and successfully tested it

Thanks again for working with me on this.

David
Post Reply

Return to “HomeKitLink Siri”