From bd177cd09268dbf7eb250374e363e562bc98d3fe Mon Sep 17 00:00:00 2001 From: Bill Wall Date: Mon, 23 Nov 2020 23:54:31 -0600 Subject: [PATCH 1/4] Control the new SHM with virtual switches. --- .../honeywell-security.groovy | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/smartapps/redloro-smartthings/honeywell-security.src/honeywell-security.groovy b/smartapps/redloro-smartthings/honeywell-security.src/honeywell-security.groovy index e911d17..0ff3e9c 100644 --- a/smartapps/redloro-smartthings/honeywell-security.src/honeywell-security.groovy +++ b/smartapps/redloro-smartthings/honeywell-security.src/honeywell-security.groovy @@ -81,6 +81,9 @@ def page1() { section("Smart Home Monitor") { input "enableSHM", "bool", title: "Integrate with Smart Home Monitor", required: true, defaultValue: true + input "armStaySHM", "capability.switch", title: "SHM Arm Stay virtual switch", required: true + input "armAwaySHM", "capability.switch", title: "SHM Arm Away virtual switch", required: true + input "disarmSHM", "capability.switch", title: "SHM Disarm virtual switch", required: true } section("Logging") { @@ -364,13 +367,28 @@ private updateAlarmSystemStatus(partitionstatus) { def lastAlarmSystemStatus = state.alarmSystemStatus if (partitionstatus == "armedstay" || partitionstatus == "armedinstant") { - state.alarmSystemStatus = "stay" + //state.alarmSystemStatus = "stay" + if (armStaySHM.latestState("switch").value == "off") { + armStaySHM.on() + } else { + armStaySHM.off() + } } if (partitionstatus == "armedaway" || partitionstatus == "armedmax") { - state.alarmSystemStatus = "away" + //state.alarmSystemStatus = "away" + if (armAwaySHM.latestState("switch").value == "off") { + armAwaySHM.on() + } else { + armAwaySHM.off() + } } if (partitionstatus == "ready") { - state.alarmSystemStatus = "off" + //state.alarmSystemStatus = "off" + if (disarmSHM.latestState("switch").value == "off") { + disarmSHM.on() + } else { + disarmSHM.off() + } } if (lastAlarmSystemStatus != state.alarmSystemStatus) { From 6ad6b87c065b9e162c1857320e40f80ea68ce767 Mon Sep 17 00:00:00 2001 From: Bill Wall Date: Mon, 23 Nov 2020 23:56:20 -0600 Subject: [PATCH 2/4] Add ability to trigger siren based on speed key. --- .../honeywell-partition.groovy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/devicetypes/redloro-smartthings/honeywell-partition.src/honeywell-partition.groovy b/devicetypes/redloro-smartthings/honeywell-partition.src/honeywell-partition.groovy index 5fe158a..947c26b 100644 --- a/devicetypes/redloro-smartthings/honeywell-partition.src/honeywell-partition.groovy +++ b/devicetypes/redloro-smartthings/honeywell-partition.src/honeywell-partition.groovy @@ -41,6 +41,7 @@ metadata { command "keyD" command "chime" command "bypass" + command "soundSiren" } tiles(scale: 2) { @@ -128,6 +129,7 @@ metadata { preferences { input name: "bypassZones", type: "text", title: "Bypass Zones", description: "Comma delimited list of zones to bypass", required: false + input name: "sirenKey", type: "text", title: "Siren Key", description: "Speedy Key (ABCD) to trigger to sound siren", required: false } } @@ -216,6 +218,18 @@ def keyD() { sendPartitionCommand('speedkey/D') } +def soundAlarm() { + sendPartitionCommand('speedkey/${settings.sirenKey}') +} + +def both() { + soundAlarm() +} + +def siren() { + soundAlarm() +} + def getPrettyName() { return [ From 223caa1b789e24ecbe95c25edf8c3546941fb804 Mon Sep 17 00:00:00 2001 From: Bill Wall Date: Tue, 24 Nov 2020 19:24:59 -0600 Subject: [PATCH 3/4] Fix multi-activation bug Fixed repeated triggering of the SHM virtual switches anytime a zone changed. --- .../honeywell-security.groovy | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/smartapps/redloro-smartthings/honeywell-security.src/honeywell-security.groovy b/smartapps/redloro-smartthings/honeywell-security.src/honeywell-security.groovy index 0ff3e9c..ce489af 100644 --- a/smartapps/redloro-smartthings/honeywell-security.src/honeywell-security.groovy +++ b/smartapps/redloro-smartthings/honeywell-security.src/honeywell-security.groovy @@ -368,26 +368,32 @@ private updateAlarmSystemStatus(partitionstatus) { def lastAlarmSystemStatus = state.alarmSystemStatus if (partitionstatus == "armedstay" || partitionstatus == "armedinstant") { //state.alarmSystemStatus = "stay" - if (armStaySHM.latestState("switch").value == "off") { - armStaySHM.on() + if (armStaySHM.latestState("switch").value == "on") { + //already armed } else { - armStaySHM.off() + armStaySHM.on() + armAwaySHM.off() + disarmSHM.off() } } if (partitionstatus == "armedaway" || partitionstatus == "armedmax") { //state.alarmSystemStatus = "away" - if (armAwaySHM.latestState("switch").value == "off") { - armAwaySHM.on() + if (armAwaySHM.latestState("switch").value == "on") { + //already armed } else { - armAwaySHM.off() + armStaySHM.off() + armAwaySHM.on() + disarmSHM.off() } } if (partitionstatus == "ready") { //state.alarmSystemStatus = "off" - if (disarmSHM.latestState("switch").value == "off") { - disarmSHM.on() + if (disarmSHM.latestState("switch").value == "on") { + //already disarmed } else { - disarmSHM.off() + armStaySHM.off() + armAwaySHM.off() + disarmSHM.on() } } From fa52cef346849ace32ac821a7d90be5f80aff98d Mon Sep 17 00:00:00 2001 From: Bill Wall Date: Wed, 25 Nov 2020 23:21:40 -0600 Subject: [PATCH 4/4] Fixed typo on soundSiren function name --- .../honeywell-partition.src/honeywell-partition.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devicetypes/redloro-smartthings/honeywell-partition.src/honeywell-partition.groovy b/devicetypes/redloro-smartthings/honeywell-partition.src/honeywell-partition.groovy index 947c26b..ee10fbf 100644 --- a/devicetypes/redloro-smartthings/honeywell-partition.src/honeywell-partition.groovy +++ b/devicetypes/redloro-smartthings/honeywell-partition.src/honeywell-partition.groovy @@ -218,16 +218,16 @@ def keyD() { sendPartitionCommand('speedkey/D') } -def soundAlarm() { +def soundSiren() { sendPartitionCommand('speedkey/${settings.sirenKey}') } def both() { - soundAlarm() + soundSiren() } def siren() { - soundAlarm() + soundSiren() } def getPrettyName()