]> git.basschouten.com Git - openhab-addons.git/blob
32ba7a16cd50b0536f0ad851425171ce8b36360d
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.dscalarm.internal.handler;
14
15 import static org.openhab.binding.dscalarm.internal.DSCAlarmBindingConstants.*;
16
17 import java.text.ParseException;
18 import java.text.SimpleDateFormat;
19 import java.util.Date;
20 import java.util.EventObject;
21 import java.util.List;
22
23 import org.openhab.binding.dscalarm.internal.DSCAlarmCode;
24 import org.openhab.binding.dscalarm.internal.DSCAlarmEvent;
25 import org.openhab.binding.dscalarm.internal.DSCAlarmMessage;
26 import org.openhab.binding.dscalarm.internal.DSCAlarmMessage.DSCAlarmMessageInfoType;
27 import org.openhab.core.library.types.DateTimeType;
28 import org.openhab.core.library.types.DecimalType;
29 import org.openhab.core.library.types.OnOffType;
30 import org.openhab.core.library.types.StringType;
31 import org.openhab.core.thing.ChannelUID;
32 import org.openhab.core.thing.Thing;
33 import org.openhab.core.types.Command;
34 import org.openhab.core.types.RefreshType;
35 import org.slf4j.Logger;
36 import org.slf4j.LoggerFactory;
37
38 /**
39  * This is a class for handling a Panel type Thing.
40  *
41  * @author Russell Stephens - Initial Contribution
42  */
43 public class PanelThingHandler extends DSCAlarmBaseThingHandler {
44
45     private static final int PANEL_COMMAND_POLL = 0;
46     private static final int PANEL_COMMAND_STATUS_REPORT = 1;
47     private static final int PANEL_COMMAND_LABELS_REQUEST = 2;
48     private static final int PANEL_COMMAND_DUMP_ZONE_TIMERS = 8;
49     private static final int PANEL_COMMAND_SET_TIME_DATE = 10;
50     private static final int PANEL_COMMAND_CODE_SEND = 200;
51
52     private final Logger logger = LoggerFactory.getLogger(PanelThingHandler.class);
53
54     /**
55      * Constructor.
56      *
57      * @param thing
58      */
59     public PanelThingHandler(Thing thing) {
60         super(thing);
61         setDSCAlarmThingType(DSCAlarmThingType.PANEL);
62     }
63
64     @Override
65     public void updateChannel(ChannelUID channelUID, int state, String description) {
66         logger.debug("updateChannel(): Panel Channel UID: {}", channelUID);
67
68         boolean trigger;
69         boolean trouble;
70         boolean boolState;
71         OnOffType onOffType;
72
73         if (channelUID != null) {
74             switch (channelUID.getId()) {
75                 case PANEL_MESSAGE:
76                     updateState(channelUID, new StringType(description));
77                     break;
78                 case PANEL_SYSTEM_ERROR:
79                     updateState(channelUID, new StringType(description));
80                     break;
81                 case PANEL_TIME:
82                     Date date = null;
83                     SimpleDateFormat sdfReceived = new SimpleDateFormat("hhmmMMddyy");
84
85                     try {
86                         date = sdfReceived.parse(description);
87                     } catch (ParseException e) {
88                         logger.warn("updateChannel(): Parse Exception occurred while trying to parse date string: {}. ",
89                                 e.getMessage());
90                     }
91
92                     if (date != null) {
93                         SimpleDateFormat sdfUpdate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
94                         String systemTime = sdfUpdate.format(date);
95                         updateState(channelUID, new DateTimeType(systemTime));
96                     }
97
98                     break;
99                 case PANEL_TIME_STAMP:
100                     boolState = state != 0;
101                     onOffType = boolState ? OnOffType.ON : OnOffType.OFF;
102                     updateState(channelUID, onOffType);
103                     break;
104                 case PANEL_TIME_BROADCAST:
105                     boolState = state != 0;
106                     onOffType = boolState ? OnOffType.ON : OnOffType.OFF;
107                     updateState(channelUID, onOffType);
108                     break;
109                 case PANEL_COMMAND:
110                     updateState(channelUID, new DecimalType(state));
111                     break;
112                 case PANEL_TROUBLE_MESSAGE:
113                     updateState(channelUID, new StringType(description));
114                     break;
115                 case PANEL_TROUBLE_LED:
116                     boolState = state != 0;
117                     onOffType = boolState ? OnOffType.ON : OnOffType.OFF;
118                     updateState(channelUID, onOffType);
119                     break;
120                 case PANEL_SERVICE_REQUIRED:
121                     trouble = state != 0;
122                     onOffType = trouble ? OnOffType.ON : OnOffType.OFF;
123                     updateState(channelUID, onOffType);
124                     break;
125                 case PANEL_AC_TROUBLE:
126                     trouble = state != 0;
127                     onOffType = trouble ? OnOffType.ON : OnOffType.OFF;
128                     updateState(channelUID, onOffType);
129                     break;
130                 case PANEL_TELEPHONE_TROUBLE:
131                     trouble = state != 0;
132                     onOffType = trouble ? OnOffType.ON : OnOffType.OFF;
133                     updateState(channelUID, onOffType);
134                     break;
135                 case PANEL_FTC_TROUBLE:
136                     trouble = state != 0;
137                     onOffType = trouble ? OnOffType.ON : OnOffType.OFF;
138                     updateState(channelUID, onOffType);
139                     break;
140                 case PANEL_ZONE_FAULT:
141                     trouble = state != 0;
142                     onOffType = trouble ? OnOffType.ON : OnOffType.OFF;
143                     updateState(channelUID, onOffType);
144                     break;
145                 case PANEL_ZONE_TAMPER:
146                     trouble = state != 0;
147                     onOffType = trouble ? OnOffType.ON : OnOffType.OFF;
148                     updateState(channelUID, onOffType);
149                     break;
150                 case PANEL_ZONE_LOW_BATTERY:
151                     trouble = state != 0;
152                     onOffType = trouble ? OnOffType.ON : OnOffType.OFF;
153                     updateState(channelUID, onOffType);
154                     break;
155                 case PANEL_TIME_LOSS:
156                     trouble = state != 0;
157                     onOffType = trouble ? OnOffType.ON : OnOffType.OFF;
158                     updateState(channelUID, onOffType);
159                     break;
160                 case PANEL_FIRE_KEY_ALARM:
161                     trigger = state != 0;
162                     onOffType = trigger ? OnOffType.ON : OnOffType.OFF;
163                     updateState(channelUID, onOffType);
164                     break;
165                 case PANEL_PANIC_KEY_ALARM:
166                     trigger = state != 0;
167                     onOffType = trigger ? OnOffType.ON : OnOffType.OFF;
168                     updateState(channelUID, onOffType);
169                     break;
170                 case PANEL_AUX_KEY_ALARM:
171                     trigger = state != 0;
172                     onOffType = trigger ? OnOffType.ON : OnOffType.OFF;
173                     updateState(channelUID, onOffType);
174                     break;
175                 case PANEL_AUX_INPUT_ALARM:
176                     trigger = state != 0;
177                     onOffType = trigger ? OnOffType.ON : OnOffType.OFF;
178                     updateState(channelUID, onOffType);
179                     break;
180                 default:
181                     logger.debug("updateChannel(): Panel Channel not updated - {}.", channelUID);
182                     break;
183             }
184         }
185     }
186
187     @Override
188     public void handleCommand(ChannelUID channelUID, Command command) {
189         logger.debug("handleCommand(): Command Received - {} {}.", channelUID, command);
190
191         if (command instanceof RefreshType) {
192             return;
193         }
194
195         if (dscAlarmBridgeHandler != null && dscAlarmBridgeHandler.isConnected()) {
196             int cmd;
197
198             switch (channelUID.getId()) {
199                 case PANEL_COMMAND:
200                     cmd = Integer.parseInt(command.toString());
201                     handlePanelCommand(cmd);
202                     updateState(channelUID, new StringType(String.valueOf(-1)));
203                     break;
204                 case PANEL_TIME_STAMP:
205                     if (command instanceof OnOffType) {
206                         cmd = command == OnOffType.ON ? 1 : 0;
207                         dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.TimeStampControl, String.valueOf(cmd));
208                         updateState(channelUID, (OnOffType) command);
209                     }
210                     break;
211                 case PANEL_TIME_BROADCAST:
212                     if (command instanceof OnOffType) {
213                         cmd = command == OnOffType.ON ? 1 : 0;
214                         dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.TimeDateBroadcastControl, String.valueOf(cmd));
215                         updateState(channelUID, (OnOffType) command);
216                     }
217                     break;
218                 default:
219                     break;
220             }
221         }
222     }
223
224     /**
225      * Method to handle PANEL_COMMAND
226      *
227      * @param cmd
228      */
229     private void handlePanelCommand(int cmd) {
230         switch (cmd) {
231             case PANEL_COMMAND_POLL:
232                 dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.Poll);
233                 break;
234             case PANEL_COMMAND_STATUS_REPORT:
235                 dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.StatusReport);
236                 break;
237             case PANEL_COMMAND_LABELS_REQUEST:
238                 dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.LabelsRequest);
239                 break;
240             case PANEL_COMMAND_DUMP_ZONE_TIMERS:
241                 dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.DumpZoneTimers);
242                 break;
243             case PANEL_COMMAND_SET_TIME_DATE:
244                 dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.SetTimeDate);
245                 break;
246             case PANEL_COMMAND_CODE_SEND:
247                 dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.CodeSend, getUserCode());
248                 break;
249             default:
250                 break;
251         }
252     }
253
254     /**
255      * Method to set the time stamp state.
256      *
257      * @param timeStamp
258      */
259     private void setTimeStampState(String timeStamp) {
260         int state = 0;
261         ChannelUID channelUID = new ChannelUID(getThing().getUID(), PANEL_TIME_STAMP);
262
263         boolean isTimeStamp = timeStamp != "";
264
265         if ((timeStamp == "" && !isTimeStamp) || (timeStamp != "" && isTimeStamp)) {
266             logger.debug("setTimeStampState(): Already Set: {}", timeStamp);
267             return;
268         } else if (timeStamp != "") {
269             state = 1;
270         }
271
272         updateChannel(channelUID, state, "");
273     }
274
275     /**
276      * Method to set Channel PANEL_SYSTEM_ERROR.
277      *
278      * @param properties
279      * @param dscAlarmMessage
280      */
281     private void panelSystemError(DSCAlarmMessage dscAlarmMessage) {
282         ChannelUID channelUID = new ChannelUID(getThing().getUID(), PANEL_SYSTEM_ERROR);
283         int systemErrorCode = 0;
284         String systemErrorDescription = "";
285
286         if (dscAlarmMessage != null) {
287             systemErrorCode = Integer.parseInt(dscAlarmMessage.getMessageInfo(DSCAlarmMessageInfoType.DATA));
288             switch (systemErrorCode) {
289                 case 1:
290                     systemErrorDescription = "Receive Buffer Overrun";
291                     break;
292                 case 2:
293                     systemErrorDescription = "Receive Buffer Overflow";
294                     break;
295                 case 3:
296                     systemErrorDescription = "Transmit Buffer Overflow";
297                     break;
298                 case 10:
299                     systemErrorDescription = "Keybus Transmit Buffer Overrun";
300                     break;
301                 case 11:
302                     systemErrorDescription = "Keybus Transmit Time Timeout";
303                     break;
304                 case 12:
305                     systemErrorDescription = "Keybus Transmit Mode Timeout";
306                     break;
307                 case 13:
308                     systemErrorDescription = "Keybus Transmit Keystring Timeout";
309                     break;
310                 case 14:
311                     systemErrorDescription = "Keybus Interface Not Functioning";
312                     break;
313                 case 15:
314                     systemErrorDescription = "Keybus Busy - Attempting to Disarm or Arm with user code";
315                     break;
316                 case 16:
317                     systemErrorDescription = "Keybus Busy â€“ Lockout";
318                     break;
319                 case 17:
320                     systemErrorDescription = "Keybus Busy â€“ Installers Mode";
321                     break;
322                 case 18:
323                     systemErrorDescription = "Keybus Busy - General Busy";
324                     break;
325                 case 20:
326                     systemErrorDescription = "API Command Syntax Error";
327                     break;
328                 case 21:
329                     systemErrorDescription = "API Command Partition Error - Requested Partition is out of bounds";
330                     break;
331                 case 22:
332                     systemErrorDescription = "API Command Not Supported";
333                     break;
334                 case 23:
335                     systemErrorDescription = "API System Not Armed - Sent in response to a disarm command";
336                     break;
337                 case 24:
338                     systemErrorDescription = "API System Not Ready to Arm - System is either not-secure, in exit-delay, or already armed";
339                     break;
340                 case 25:
341                     systemErrorDescription = "API Command Invalid Length";
342                     break;
343                 case 26:
344                     systemErrorDescription = "API User Code not Required";
345                     break;
346                 case 27:
347                     systemErrorDescription = "API Invalid Characters in Command - No alpha characters are allowed except for checksum";
348                     break;
349                 case 28:
350                     systemErrorDescription = "API Virtual Keypad is Disabled";
351                     break;
352                 case 29:
353                     systemErrorDescription = "API Not Valid Parameter";
354                     break;
355                 case 30:
356                     systemErrorDescription = "API Keypad Does Not Come Out of Blank Mode";
357                     break;
358                 case 31:
359                     systemErrorDescription = "API IT-100 is Already in Thermostat Menu";
360                     break;
361                 case 32:
362                     systemErrorDescription = "API IT-100 is NOT in Thermostat Menu";
363                     break;
364                 case 33:
365                     systemErrorDescription = "API No Response From Thermostat or Escort Module";
366                     break;
367                 case 0:
368                 default:
369                     systemErrorDescription = "No Error";
370                     break;
371             }
372
373         }
374
375         String errorMessage = String.format("%03d", systemErrorCode) + ": " + systemErrorDescription;
376         channelUID = new ChannelUID(getThing().getUID(), PANEL_SYSTEM_ERROR);
377         updateState(channelUID, new StringType(errorMessage));
378     }
379
380     /**
381      * Handle Verbose Trouble Status events for the EyezOn Envisalink 3/2DS DSC Alarm Interface.
382      *
383      * @param event
384      */
385     private void verboseTroubleStatusHandler(EventObject event) {
386         DSCAlarmEvent dscAlarmEvent = (DSCAlarmEvent) event;
387         DSCAlarmMessage dscAlarmMessage = dscAlarmEvent.getDSCAlarmMessage();
388         String[] channelTypes = { PANEL_SERVICE_REQUIRED, PANEL_AC_TROUBLE, PANEL_TELEPHONE_TROUBLE, PANEL_FTC_TROUBLE,
389                 PANEL_ZONE_FAULT, PANEL_ZONE_TAMPER, PANEL_ZONE_LOW_BATTERY, PANEL_TIME_LOSS };
390
391         String channel;
392         ChannelUID channelUID = null;
393
394         int bitField = Integer.decode("0x" + dscAlarmMessage.getMessageInfo(DSCAlarmMessageInfoType.DATA));
395         int[] masks = { 1, 2, 4, 8, 16, 32, 64, 128 };
396         int[] bits = new int[8];
397
398         for (int i = 0; i < 8; i++) {
399             bits[i] = bitField & masks[i];
400
401             channel = channelTypes[i];
402
403             if (channel != "") {
404                 channelUID = new ChannelUID(getThing().getUID(), channel);
405                 updateChannel(channelUID, bits[i] != 0 ? 1 : 0, "");
406             }
407         }
408     }
409
410     /**
411      * Restores all partitions that are in alarm after special panel alarm conditions have been restored.
412      *
413      * @param dscAlarmCode
414      */
415     private void restorePartitionsInAlarm(DSCAlarmCode dscAlarmCode) {
416         logger.debug("restorePartitionsInAlarm(): DSC Alarm Code: {}!", dscAlarmCode.toString());
417
418         ChannelUID channelUID = null;
419
420         if (dscAlarmCode == DSCAlarmCode.FireKeyRestored || dscAlarmCode == DSCAlarmCode.AuxiliaryKeyRestored
421                 || dscAlarmCode == DSCAlarmCode.PanicKeyRestored
422                 || dscAlarmCode == DSCAlarmCode.AuxiliaryInputAlarmRestored) {
423             List<Thing> things = dscAlarmBridgeHandler.getThing().getThings();
424             for (Thing thg : things) {
425                 if (thg.getThingTypeUID().equals(PARTITION_THING_TYPE)) {
426                     DSCAlarmBaseThingHandler handler = (DSCAlarmBaseThingHandler) thg.getHandler();
427                     if (handler != null) {
428                         channelUID = new ChannelUID(thg.getUID(), PARTITION_IN_ALARM);
429                         handler.updateChannel(channelUID, 0, "");
430
431                         logger.debug("restorePartitionsInAlarm(): Partition In Alarm Restored: {}!", thg.getUID());
432                     }
433                 }
434             }
435         }
436     }
437
438     @Override
439     public void dscAlarmEventReceived(EventObject event, Thing thing) {
440         if (thing != null) {
441             DSCAlarmEvent dscAlarmEvent = (DSCAlarmEvent) event;
442             DSCAlarmMessage dscAlarmMessage = dscAlarmEvent.getDSCAlarmMessage();
443             String dscAlarmMessageData = dscAlarmMessage.getMessageInfo(DSCAlarmMessageInfoType.DATA);
444             setTimeStampState(dscAlarmMessage.getMessageInfo(DSCAlarmMessageInfoType.TIME_STAMP));
445
446             if (getThing() == thing) {
447                 ChannelUID channelUID = null;
448                 DSCAlarmCode dscAlarmCode = DSCAlarmCode
449                         .getDSCAlarmCodeValue(dscAlarmMessage.getMessageInfo(DSCAlarmMessageInfoType.CODE));
450                 logger.debug("dscAlarmEventRecieved(): Thing - {}   Command - {}", thing.getUID(), dscAlarmCode);
451
452                 int state = 0;
453
454                 switch (dscAlarmCode) {
455                     case CommandAcknowledge: /* 500 */
456                         break;
457                     case SystemError: /* 502 */
458                         int errorCode = Integer.parseInt(dscAlarmMessageData);
459
460                         if (errorCode == 23 || errorCode == 24) {
461                             List<Thing> things = dscAlarmBridgeHandler.getThing().getThings();
462                             for (Thing thg : things) {
463                                 if (thg.getThingTypeUID().equals(PARTITION_THING_TYPE)) {
464                                     DSCAlarmBaseThingHandler handler = (DSCAlarmBaseThingHandler) thg.getHandler();
465                                     if (handler != null) {
466                                         channelUID = new ChannelUID(thg.getUID(), PARTITION_ARM_MODE);
467                                         handler.updateChannel(channelUID, 0, "");
468                                     }
469                                 }
470                             }
471                         }
472
473                         panelSystemError(dscAlarmMessage);
474                         break;
475                     case TimeDateBroadcast: /* 550 */
476                         channelUID = new ChannelUID(getThing().getUID(), PANEL_TIME);
477                         String panelTime = dscAlarmMessage.getMessageInfo(DSCAlarmMessageInfoType.DATA);
478                         updateChannel(channelUID, state, panelTime);
479
480                         channelUID = new ChannelUID(getThing().getUID(), PANEL_TIME_BROADCAST);
481                         updateChannel(channelUID, 1, "");
482                         break;
483                     case FireKeyAlarm: /* 621 */
484                         state = 1;
485                     case FireKeyRestored: /* 622 */
486                         channelUID = new ChannelUID(getThing().getUID(), PANEL_FIRE_KEY_ALARM);
487                         updateChannel(channelUID, state, "");
488                         restorePartitionsInAlarm(dscAlarmCode);
489                         break;
490                     case AuxiliaryKeyAlarm: /* 623 */
491                         state = 1;
492                     case AuxiliaryKeyRestored: /* 624 */
493                         channelUID = new ChannelUID(getThing().getUID(), PANEL_AUX_KEY_ALARM);
494                         updateChannel(channelUID, state, "");
495                         restorePartitionsInAlarm(dscAlarmCode);
496                         break;
497                     case PanicKeyAlarm: /* 625 */
498                         state = 1;
499                     case PanicKeyRestored: /* 626 */
500                         channelUID = new ChannelUID(getThing().getUID(), PANEL_PANIC_KEY_ALARM);
501                         updateChannel(channelUID, state, "");
502                         restorePartitionsInAlarm(dscAlarmCode);
503                         break;
504                     case AuxiliaryInputAlarm: /* 631 */
505                         state = 1;
506                     case AuxiliaryInputAlarmRestored: /* 632 */
507                         channelUID = new ChannelUID(getThing().getUID(), PANEL_AUX_INPUT_ALARM);
508                         updateChannel(channelUID, state, "");
509                         restorePartitionsInAlarm(dscAlarmCode);
510                         break;
511                     case TroubleLEDOn: /* 840 */
512                         channelUID = new ChannelUID(getThing().getUID(), PANEL_TROUBLE_LED);
513                         updateChannel(channelUID, 1, "");
514                         break;
515                     case TroubleLEDOff: /* 841 */
516                         channelUID = new ChannelUID(getThing().getUID(), PANEL_SERVICE_REQUIRED);
517                         updateChannel(channelUID, 0, "");
518
519                         channelUID = new ChannelUID(getThing().getUID(), PANEL_AC_TROUBLE);
520                         updateChannel(channelUID, 0, "");
521
522                         channelUID = new ChannelUID(getThing().getUID(), PANEL_TELEPHONE_TROUBLE);
523                         updateChannel(channelUID, 0, "");
524
525                         channelUID = new ChannelUID(getThing().getUID(), PANEL_FTC_TROUBLE);
526                         updateChannel(channelUID, 0, "");
527
528                         channelUID = new ChannelUID(getThing().getUID(), PANEL_ZONE_FAULT);
529                         updateChannel(channelUID, 0, "");
530
531                         channelUID = new ChannelUID(getThing().getUID(), PANEL_ZONE_TAMPER);
532                         updateChannel(channelUID, 0, "");
533
534                         channelUID = new ChannelUID(getThing().getUID(), PANEL_ZONE_LOW_BATTERY);
535                         updateChannel(channelUID, 0, "");
536
537                         channelUID = new ChannelUID(getThing().getUID(), PANEL_TIME_LOSS);
538                         updateChannel(channelUID, 0, "");
539
540                         channelUID = new ChannelUID(getThing().getUID(), PANEL_TROUBLE_LED);
541                         updateChannel(channelUID, 0, "");
542                         break;
543                     case PanelBatteryTrouble: /* 800 */
544                     case PanelACTrouble: /* 802 */
545                     case SystemBellTrouble: /* 806 */
546                     case TLMLine1Trouble: /* 810 */
547                     case TLMLine2Trouble: /* 812 */
548                     case FTCTrouble: /* 814 */
549                     case GeneralDeviceLowBattery: /* 821 */
550                     case WirelessKeyLowBatteryTrouble: /* 825 */
551                     case HandheldKeypadLowBatteryTrouble: /* 827 */
552                     case GeneralSystemTamper: /* 829 */
553                     case HomeAutomationTrouble: /* 831 */
554                     case KeybusFault: /* 896 */
555                         channelUID = new ChannelUID(getThing().getUID(), PANEL_TROUBLE_MESSAGE);
556                         updateChannel(channelUID, 0,
557                                 dscAlarmMessage.getMessageInfo(DSCAlarmMessageInfoType.DESCRIPTION));
558                         break;
559                     case PanelBatteryTroubleRestore: /* 801 */
560                     case PanelACRestore: /* 803 */
561                     case SystemBellTroubleRestore: /* 807 */
562                     case TLMLine1TroubleRestore: /* 811 */
563                     case TLMLine2TroubleRestore: /* 813 */
564                     case GeneralDeviceLowBatteryRestore: /* 822 */
565                     case WirelessKeyLowBatteryTroubleRestore: /* 826 */
566                     case HandheldKeypadLowBatteryTroubleRestore: /* 828 */
567                     case GeneralSystemTamperRestore: /* 830 */
568                     case HomeAutomationTroubleRestore: /* 832 */
569                     case KeybusFaultRestore: /* 897 */
570                         channelUID = new ChannelUID(getThing().getUID(), PANEL_TROUBLE_MESSAGE);
571                         updateChannel(channelUID, 0, "");
572                         break;
573                     case VerboseTroubleStatus: /* 849 */
574                         verboseTroubleStatusHandler(event);
575                         break;
576                     case CodeRequired: /* 900 */
577                         dscAlarmBridgeHandler.sendCommand(DSCAlarmCode.CodeSend, getUserCode());
578                         break;
579                     default:
580                         break;
581                 }
582             }
583         }
584     }
585 }