@@ -31,14 +31,16 @@ Bridge mqtt:broker:mymqtt "My MQTT" [host="MQTT broker IP address or hostname"]
3131Thing mqtt:topic:mymqtt:dsc "DSC Security System" (mqtt:broker:mymqtt) @ "Home" {
3232 Channels:
3333 Type string : partition1_message "Partition 1" [stateTopic="dsc/Get/Partition1/Message"]
34+ Type string : partition1_armed_mode "Alarm Armed Mode" [stateTopic="dsc/Get/Partition1", commandTopic="dsc/Set"]
3435 Type switch : partition1_armed_away "Partition 1 Armed Away" [stateTopic="dsc/Get/Partition1", commandTopic="dsc/Set", on="1A", off="1D"]
3536 Type switch : partition1_armed_stay "Partition 1 Armed Stay" [stateTopic="dsc/Get/Partition1", commandTopic="dsc/Set", on="1S", off="1D"]
37+ Type switch : partition1_armed_night "Partition 1 Armed Night" [stateTopic="dsc/Get/Partition1", commandTopic="dsc/Set", on="1N", off="1D"]
3638 Type switch : partition1_alarm "Partition 1 Alarm" [stateTopic="dsc/Get/Partition1", on="1T", off="1D"]
3739 Type switch : partition1_fire "Partition 1 Fire" [stateTopic="dsc/Get/Fire1", on="1", off="0"]
3840 Type switch : panel_online "Panel Online" [stateTopic="dsc/Status", on="online", off="offline"]
3941 Type switch : panel_trouble "Panel Trouble" [stateTopic="dsc/Get/Trouble", on="1", off="0"]
40- Type switch : pgm1 "PGM 1" [stateTopic="dsc/Get/PGM 1 ", on="1", off="0"]
41- Type switch : pgm8 "PGM 8" [stateTopic="dsc/Get/PGM 8 ", on="1", off="0"]
42+ Type switch : pgm1 "PGM 1" [stateTopic="dsc/Get/PGM1 ", on="1", off="0"]
43+ Type switch : pgm8 "PGM 8" [stateTopic="dsc/Get/PGM8 ", on="1", off="0"]
4244 Type contact : zone1 "Zone 1" [stateTopic="dsc/Get/Zone1", on="1", off="0"]
4345 Type contact : zone2 "Zone 2" [stateTopic="dsc/Get/Zone2", on="1", off="0"]
4446 Type contact : zone3 "Zone 3" [stateTopic="dsc/Get/Zone3", on="1", off="0"]
@@ -48,8 +50,10 @@ Thing mqtt:topic:mymqtt:dsc "DSC Security System" (mqtt:broker:mymqtt) @ "Home"
4850* - https://www.openhab.org/docs/configuration/items.html
4951
5052String partition1_message "Partition 1 [%s]" <shield> {channel="mqtt:topic:mymqtt:dsc:partition1_message"}
53+ String partition1_armed_mode "Armed Mode" {channel="mqtt:topic:mymqtt:dsc:partition1_armed_mode"}
5154Switch partition1_armed_away "Partition 1 Armed Away" <shield> {channel="mqtt:topic:mymqtt:dsc:partition1_armed_away"}
5255Switch partition1_armed_stay "Partition 1 Armed Stay" <shield> {channel="mqtt:topic:mymqtt:dsc:partition1_armed_stay"}
56+ Switch partition1_armed_night "Partition 1 Armed Night" <shield> {channel="mqtt:topic:mymqtt:dsc:partition1_armed_night"}
5357Switch partition1_triggered "Partition 1 Alarm" <alarm> {channel="mqtt:topic:mymqtt:dsc:partition1_alarm"}
5458Switch partition1_fire "Partition 1 Fire" <fire> {channel="mqtt:topic:mymqtt:dsc:partition1_fire"}
5559Switch panel_online "Panel Online" <switch> {channel="mqtt:topic:mymqtt:dsc:panel_online"}
@@ -64,6 +68,7 @@ Contact zone3 "Zone 3" <motion> {channel="mqtt:topic:mymqtt:dsc:zone3"}
6468 * The commands to set the alarm state are setup in OpenHAB with the partition number (1-8) as a prefix to the command:
6569 * Partition 1 stay arm: "1S"
6670 * Partition 1 away arm: "1A"
71+ * Partition 1 night (no entry delay) arm: "1N"
6772 * Partition 2 disarm: "2D"
6873 *
6974 * The interface listens for commands in the configured mqttSubscribeTopic, and publishes partition status in a
@@ -256,6 +261,11 @@ void loop() {
256261 publishState (mqttPartitionTopic, partition, " A" );
257262 }
258263
264+ // Armed - Night Mode / Instant Alarm (Stay and no Entry Delay)
265+ else if (dsc.armedStay [partition] && dsc.noEntryDelay [partition]) {
266+ publishState (mqttPartitionTopic, partition, " N" );
267+ }
268+
259269 // Armed stay
260270 else if (dsc.armedStay [partition]) {
261271 publishState (mqttPartitionTopic, partition, " S" );
@@ -397,6 +407,13 @@ void mqttCallback(char* topic, byte* payload, unsigned int length) {
397407 return ;
398408 }
399409
410+ // Arm - No Entry Delay - Night Mode
411+ if (payload[payloadIndex] == ' N' && !dsc.armed [partition] && !dsc.exitDelay [partition]) {
412+ dsc.writePartition = partition + 1 ; // Sets writes to the partition number
413+ dsc.write (' n' ); // Keypad - Arm with no entry delay (night arm)
414+ return ;
415+ }
416+
400417 // Disarm
401418 if (payload[payloadIndex] == ' D' && (dsc.armed [partition] || dsc.exitDelay [partition] || dsc.alarm [partition])) {
402419 dsc.writePartition = partition + 1 ; // Sets writes to the partition number
0 commit comments