DSC keypad

Posted on
Mon Jun 27, 2022 10:24 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

DSC keypad

agame wrote:
Yes that sorted it - arming now resulting in the correct states. So from my perspective now very usable.

Re the sync issue - the risk of not mapping the unsupported night mode is simply the end-user indication that the system is arming when in fact it isn't. However I see that after 3 or 4 minutes the HomeKit device will revert to the correct (Indigo DSC) state. I found it is also possible to get the the HomeKit device out of sync with the DSC plugin when switching between modes if DSC throws an error (for instance, too many commands in quick succession, or a zone not ready).

In testing this I did find a quirk of mapping 'exit delay' to 'disarmed' - a user cant toggle back to cancel the arming process during exit delay, and the indication 'Arming' on the Homekit device - which is presumably meant to indicate exit delay on a native device, only flashes up momentarily. And a failed arm attempt (eg zone not ready) will look like a normal exit delay process is underway, None of these critical, just slightly rough edges that might be worth considering if they aren't DSC-specific!
Okay,

I’m following along some… probably need to spell it out as I don’t have DSC device can test/or even see the states. What you describe do seem to be DSC specific events. Baring in mind that HomeKit security system does seem pretty basic!

Good all mainly working well / usable at least.

There is always going to be an issue converting from one to another when they don’t match each other. Really is no way around that.

Night in HomeKit app == no such mode in DSC.
So currently does nothing, if selected in HomeKit.
Could link it to another mode - Arm I would guess?

Out-of-Sync:
Not sure there is any way around that. If DSC or any device, errors, or doesn’t respond there is going to be a moderate delay before HomeKit sees this. The alternative is pausing, waiting, rechecking, and/or rechecking with everything hanging meanwhile…
HomeKit will eventually catchup as you have seen.


Sent from my iPad using Tapatalk

Posted on
Sun Aug 07, 2022 3:18 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: DSC keypad

Since the DSC alarm panel and plugin do not support a NIGHT arming mode, I think it is best to map NIGHT arming to the very similar STAY arming. Currently NIGHT arming is not mapped at all, which is confusing to the end user and requires the whole process to timeout in HomeKit.

You should also remove the exitDelay mapping since this will allow HomeKit to automatically report the exitDelay period as "Arming...". Currently after pressing HOME arming or AWAY arming, the button jumps back to OFF and the status to Off until the exitDelay period is over.

I have not yet tested alarm panel triggering. Everything else seems to be working.

Great plugin, a lot of work must have gone into this. Thanks Glenn.

Code: Select all
DSC_TO_HOMEKIT_CURRENT = {
    "armed": HK_ALARM_STAY_ARMED,
    "armed_stay":HK_ALARM_STAY_ARMED,
    "armed_away": HK_ALARM_AWAY_ARMED,
    "armed_night": HK_ALARM_STAY_ARMED,
#    "exitDelay": HK_ALARM_DISARMED,
    "disarmed": HK_ALARM_DISARMED,
    "tripped": HK_ALARM_TRIGGERED,
}
DSC_TO_HOMEKIT_TARGET = {
    "armed": HK_ALARM_STAY_ARMED,
    "armed_stay":HK_ALARM_STAY_ARMED,
    "armed_away": HK_ALARM_AWAY_ARMED,
    "armed_night": HK_ALARM_STAY_ARMED,
#    "exitDelay": HK_ALARM_DISARMED,
    "disarmed": HK_ALARM_DISARMED,


Code: Select all
                elif self.plugin_inuse == "com.frightideas.indigoplugin.dscAlarm":
                    if int(char_values) == HK_ALARM_DISARMED:
                        basePlugin.executeAction("actionDisarm", deviceId=self.indigodeviceid)
                    elif int(char_values) == HK_ALARM_STAY_ARMED:
                        basePlugin.executeAction("actionArmStay", deviceId=self.indigodeviceid)
                    elif int(char_values) == HK_ALARM_NIGHT_ARMED:
                        basePlugin.executeAction("actionArmStay", deviceId=self.indigodeviceid)
                    elif int(char_values) == HK_ALARM_AWAY_ARMED:
                        basePlugin.executeAction("actionArmAway", deviceId=self.indigodeviceid)

Posted on
Mon Aug 08, 2022 12:05 am
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: DSC keypad

Thanks!

Presume this will suit all DSC users and have updated as per your example to 0.3.19

Posted on
Wed Aug 10, 2022 6:55 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: DSC keypad

After some more testing I encountered a weird behavior. I have three partitions. If I arm partition 2 (Poolhouse) or 3 from Home Kit app, the app changes the status of the keypad to "Arming...", the button pressed stays highlighted and the arming process can be interrupted by pressing OFF. So this works fine.

If I arm partition 1 (Mainhouse) from Home Kit app, the app does not change to "Arming" or only briefly flashes it, the button pressed reverts back to OFF and pressing OFF does not interrupt the arming process anymore.

I am attaching two debug log files. It looks to me that with partitions 2 and 3, the DSC Alarm exitDelay state is send by the DSC plugin immediately after the DSC arming command. Subsequently the HKL-S plugin is picking up those state changes and is correctly listing the exitDelay as True.

In the case of partition 1, the exitDelay state change is send by the DSC plugin apparently a few milliseconds later after the arming command. This causes the HKL-S plugin to jump in too early and incorrectly report the exitDelay still as False and the CurrentState as disarmed. This explains why pressing OFF does nothing and "Arming" is not shown.

I have no idea why the exitDelay status change is a bit delayed with partition 1. It is the biggest partition with the most zones, and there is nothing I can do about since the DSC plugin gets this response from the DSC panel when it comes in.

A possible fix is to introduce a delay at this location.

Code: Select all
    def deviceUpdated(self, original_device, updated_device):

        ## Below checks for device in device list and if device updated, then update its states
        #  Question is whether I send this quickly back to Accessory to 'process' in a async fashion
        #  May be quicker?  May be less customisable/selectable though, errors in Accessory harder to trace/tend to crash
        #  Plugin here still will have to receive device updates.. so very marginally checking happening
        #

        try:
            self.sleep(3)
            super(Plugin, self).deviceUpdated(original_device, updated_device)


My concerns are that 3 seconds is a really long delay and nothing is being reported anymore in the debug log during the Arming period (see attached log).

Poolhouse (Working)
Aug 10, 2022 at 3:32:33 PM
HomeKitLink Siri Debug Set Security Values:0
HomeKitLink Siri Debug Plugin in Use: com.frightideas.indigoplugin.dscAlarm
DSC Alarm Arming Alarm in Stay Mode. (Partition 2 'Poolhouse')
DSC Alarm Exit Delay. (Partition 2 'Poolhouse')
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Pool House
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :14
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Pool House & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == exitDelay, and TargetState == exitDelay
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Pool House
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :14
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Pool House & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == exitDelay, and TargetState == exitDelay
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Pool House
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :14
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug Set Security Values:3
HomeKitLink Siri Debug Plugin in Use: com.frightideas.indigoplugin.dscAlarm
DSC Alarm Disarming Alarm. (Partition 2 'Poolhouse')
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Pool House
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :14
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Pool House & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == disarmed, and TargetState == disarmed
HomeKitLink Siri Debug Confirmed. Current state set to 3
HomeKitLink Siri Debug Confirmed. Target state set to 3
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Pool House
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :14
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Pool House & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == disarmed, and TargetState == disarmed
HomeKitLink Siri Debug Confirmed. Current state set to 3
HomeKitLink Siri Debug Confirmed. Target state set to 3
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Pool House
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :14
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:



Mainhouse (Not Working)
Aug 10, 2022 at 3:35:00 PM
HomeKitLink Siri Debug Set Security Values:0
HomeKitLink Siri Debug Plugin in Use: com.frightideas.indigoplugin.dscAlarm
DSC Alarm Arming Alarm in Stay Mode. (Partition 1 'Mainhouse')
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Mainhouse
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :1
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Mainhouse & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == disarmed, and TargetState == disarmed
HomeKitLink Siri Debug Confirmed. Current state set to 3
HomeKitLink Siri Debug Confirmed. Target state set to 3
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Mainhouse
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :1
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Mainhouse & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : on (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : on (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == disarmed, and TargetState == disarmed
HomeKitLink Siri Debug Confirmed. Current state set to 3
HomeKitLink Siri Debug Confirmed. Target state set to 3
DSC Alarm Exit Delay. (Partition 1 'Mainhouse')
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Mainhouse
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :1
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Mainhouse & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : on (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : on (string)
LEDBypass : on (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == exitDelay, and TargetState == exitDelay
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Mainhouse
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :1
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug Device Changed that interested in...05. Office Hall Motion
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :20
HomeKitLink Siri Debug Subtype:OccupancySensor, and type(original_device):<class 'indigo.Device'> & devicesensor:state.open
HomeKitLink Siri Debug Device Changed that interested in...05. Office Hall Motion
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :20
HomeKitLink Siri Debug Subtype:OccupancySensor, and type(original_device):<class 'indigo.Device'> & devicesensor:state.open
HomeKitLink Siri Debug Device Changed that interested in...29. His Office South Windows
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :12
HomeKitLink Siri Debug Subtype:ContactSensor, and type(original_device):<class 'indigo.Device'> & devicesensor:state.open
DSC Alarm Disarming Alarm. (Partition 1 'Mainhouse')
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Mainhouse
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :1
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Mainhouse & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : on (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : on (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == exitDelay, and TargetState == exitDelay
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Mainhouse
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :1
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Mainhouse & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : exitDelay (string)
state.armed : false (bool)
state.disarmed : false (bool)
state.entryDelay : false (bool)
state.exitDelay : true (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == exitDelay, and TargetState == exitDelay
DSC Alarm Alarm Disarmed. (Partition 1 'Mainhouse')
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Mainhouse
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :1
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:
HomeKitLink Siri Debug NewState of Device:DSC Alarm Keypad Mainhouse & State: States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug set_from device Update called by deviceUpdate with value:States : (dict)
ArmedState : disarmed (string)
ArmedState.away : false (bool)
ArmedState.disarmed : true (bool)
ArmedState.stay : false (bool)
KeypadChime : disabled (string)
KeypadChime.disabled : true (bool)
KeypadChime.enabled : false (bool)
LCDLine1 : Date Time (string)
LCDLine2 : AUG 10/22 3:32p (string)
LEDArmed : off (string)
LEDBypass : off (string)
LEDMemory : off (string)
LEDReady : on (string)
LEDTrouble : off (string)
PanicState : none (string)
PanicState.ambulance : false (bool)
PanicState.duress : false (bool)
PanicState.fire : false (bool)
PanicState.none : true (bool)
PanicState.panic : false (bool)
ReadyState : ready (string)
ReadyState.notready : false (bool)
ReadyState.ready : true (bool)
state : disarmed (string)
state.armed : false (bool)
state.disarmed : true (bool)
state.entryDelay : false (bool)
state.exitDelay : false (bool)
state.tripped : false (bool)
HomeKitLink Siri Debug New CurrentState == disarmed, and TargetState == disarmed
HomeKitLink Siri Debug Confirmed. Current state set to 3
HomeKitLink Siri Debug Confirmed. Target state set to 3
HomeKitLink Siri Debug Device Changed that interested in...DSC Alarm Keypad Mainhouse
HomeKitLink Siri Debug Device Found in Device List. CheckIndex Key Exists :1
HomeKitLink Siri Debug Subtype:Security, and type(original_device):<class 'indigo.Device'> & devicesensor:


Mainhouse (Working?)
Aug 10, 2022 at 5:16:06 PM
HomeKitLink Siri Debug Set Security Values:0
HomeKitLink Siri Debug Plugin in Use: com.frightideas.indigoplugin.dscAlarm
DSC Alarm Arming Alarm in Stay Mode. (Partition 1 'Mainhouse')
DSC Alarm Exit Delay. (Partition 1 'Mainhouse')

Aug 10, 2022 at 5:16:43 PM
HomeKitLink Siri Debug Set Security Values:3
HomeKitLink Siri Debug Plugin in Use: com.frightideas.indigoplugin.dscAlarm
DSC Alarm Disarming Alarm. (Partition 1 'Mainhouse')
DSC Alarm Alarm Disarmed. (Partition 1 'Mainhouse')

Posted on
Wed Aug 10, 2022 7:25 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

DSC keypad

Introducing a delay in HKL will not be a good idea. This will stall the entire plugin and the multiple processes/async, probably leading to multiple devices not reporting - cascade of failure I think would apply. It will basically stop the plugin from working. I would remove it asap.

This perhaps relates to exitDelay being now ignore following your earlier changes?

Seems like addressing the issue in with DSC plugin might be the best way forward.

Or running a separate HomeKit instance with a DSC plugin (if one exists). As said from outset the focus here is on native indigo devices (dimmers/relays etc) getting these into HomeKit, not getting Plugin devices out of indigo and into Homekit.

Or third option:
Would be to use the VSS plugin and manually update states from DSC as needed - and use the VSS devices in homekit.

Posted on
Thu Aug 11, 2022 5:41 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: DSC keypad

totally agree not to use the delay.

I think I got it to work by making a few small changes to the plugin. I will test a bit more.

The thing with HomeKit security devices seems to be that there are four states (Off, Night, Home, Away) that can be selected by the user via the app. But the transitional states "Arming" and "Disarming" seem to be automatically generated by HomeKit whenever the target state changes appropriately from the current state. So the plugin does not need to set those transitional states (anyway impossible) and does not need to monitor them either. So by focusing on one of the four states above it should be pretty easy to get this going. It is working now with all three partitions as expected.

Posted on
Fri Aug 19, 2022 6:56 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: DSC keypad

Version 2022.0.6 of the DSC plugin has been released for better compatibility with this HKL-S plugin by implementing all armed/disarmed etc state options in one single "state". This should better reflect the correct states during exit Delay while the Home app shows "arming". The HKL-S plugin needs a few modifications to be compatible with this new version of DSC plugin. I found the code changes listed below to work well in my setting.

Also, since the DSC alarm does not have a Night arm setting, the HomeKit app currently maps pressing this button to Arm Home (ArmStay). I thought some users might want to map this to e.g. ArmStayForce which would automatically bypass all open zones.

Code: Select all
####### changes for HKSecuritySystem.py ##################################################

DSC_TO_HOMEKIT_CURRENT = {
    "armed": HK_ALARM_STAY_ARMED,
    "armedStay":HK_ALARM_STAY_ARMED,
    "armedAway": HK_ALARM_AWAY_ARMED,
    "disarmed": HK_ALARM_DISARMED,
    "tripped": HK_ALARM_TRIGGERED,
}
DSC_TO_HOMEKIT_TARGET = {
    "armed": HK_ALARM_STAY_ARMED,
    "armedStay":HK_ALARM_STAY_ARMED,
    "armedAway": HK_ALARM_AWAY_ARMED,
    "disarmed": HK_ALARM_DISARMED,
}

##########################################################################################

        elif self.plugin_inuse == "com.frightideas.indigoplugin.dscAlarm":
            self.SET_TO_USE_CURRENT = DSC_TO_HOMEKIT_CURRENT
            self.SET_TO_USE_TARGET = DSC_TO_HOMEKIT_TARGET
            self.device_current_state = "state" # can be disarmed, armedAway, armedStay, entryDelay, exitDelay, tripped

##########################################################################################

                elif self.plugin_inuse == "com.frightideas.indigoplugin.dscAlarm":
                    if int(char_values) == HK_ALARM_DISARMED:
                        basePlugin.executeAction("actionDisarm", deviceId=self.indigodeviceid)
                    elif int(char_values) == HK_ALARM_STAY_ARMED:
                        basePlugin.executeAction("actionArmStay", deviceId=self.indigodeviceid)
                    elif int(char_values) == HK_ALARM_NIGHT_ARMED:
                        basePlugin.executeAction("actionArmStay", deviceId=self.indigodeviceid)
                        #basePlugin.executeAction("actionArmStayForce", deviceId=self.indigodeviceid) # all open zones are bypassed
                    elif int(char_values) == HK_ALARM_AWAY_ARMED:
                        basePlugin.executeAction("actionArmAway", deviceId=self.indigodeviceid)

####### delete this block ##############################################################

            ## Attempt to fix DSC with no logs or information
            if self.plugin_inuse == "com.frightideas.indigoplugin.dscAlarm":
                # Use Armed stated to alter current and target to fit with DSC
                # Appears that don't need to worry about converse.
                if "ArmedState" in states:
                    armedstate = states["ArmedState"]
                    if armedstate in ("away","stay"):
                        currentstate = currentstate + "_"+str(armedstate)
                        targetstate = targetstate + "_"+str(armedstate)

####### more changes for HKSecuritySystem.py #############################################

            elif self.plugin_inuse == "com.frightideas.indigoplugin.dscAlarm":
                logger.debug("Using dscAlarm for get_security")
                if "state" in indigodevice.states:
                    state = indigodevice.states["state"]   # can be disarmed, armedAway, armedStay, entryDelay, exitDelay, tripped
                    value = self.SET_TO_USE_CURRENT.get(state)
                    logger.debug(f"Returning value of {value}, using state of {state} for DSC Alarm")

####### changes for plugin.py ############################################################

                elif str(updateddevice_subtype) == "Security":
                    if updated_device.states != original_device.states:
                        if self.debug2:
                            self.logger.debug("NewState of Device:{} & State: {} ".format(updated_device.name, updated_device.states))
                        if this_is_debug_device:
                            self.logger.warning("NewState of Device:{} & State: {} ".format(updated_device.name, updated_device.states))
                        if self.device_list_internal[checkindex]['manufacturername'] == "com.frightideas.indigoplugin.dscAlarm":
                            if "state" in updated_device.states:
                                if updated_device.states['state'] != original_device.states['state']: # focusing only on changes of 'state' (not LED, Time etc)
                                    self.device_list_internal[checkindex]["accessory"].set_fromdeviceUpdate(updated_device.states)
                        else:
                            self.device_list_internal[checkindex]["accessory"].set_fromdeviceUpdate(updated_device.states)
                        return

Posted on
Fri Aug 19, 2022 7:55 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

DSC keypad

Thanks!

I’ll get on and have a look soon and update today all going to plan

New version HomeKitLink done and on github:
Updated with these changes - will think on one change, as might be more straightforward way (which escapes me at the moment!) but there for moment, and won’t change functionality!


Glenn


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest