-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathenvisalinkdefs.py
563 lines (550 loc) · 15 KB
/
envisalinkdefs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
## Alarm Server
## Supporting Envisalink 2DS/3
##
## This code is under the terms of the GPL v3 license.
import ctypes
c_uint16 = ctypes.c_uint16
class IconLED_Bitfield( ctypes.LittleEndianStructure ):
_fields_ = [
("alarm", c_uint16, 1 ),
("alarm_in_memory", c_uint16, 1 ),
("armed_away", c_uint16, 1 ),
("ac_present", c_uint16, 1 ),
("bypass", c_uint16, 1 ),
("chime", c_uint16, 1 ),
("not_used1", c_uint16, 1 ),
("armed_zero_entry_delay", c_uint16, 1 ),
("alarm_fire_zone", c_uint16, 1 ),
("system_trouble", c_uint16, 1 ),
("not_used2", c_uint16, 1 ),
("not_used3", c_uint16, 1 ),
("ready", c_uint16, 1 ),
("fire", c_uint16, 1 ),
("low_battery", c_uint16, 1 ),
("armed_stay", c_uint16, 1 )
]
class IconLED_Flags( ctypes.Union ):
_fields_ = [
("b", IconLED_Bitfield ),
("asShort", c_uint16 )
]
_anonymous_ = ("b")
evl_ResponseTypes = {
'Login:' : {'name' : 'Login Prompt', 'description' : 'Sent During Session Login Only.', 'handler' : 'login'},
'OK' : {'name' : 'Login Success', 'description' : 'Send During Session Login Only, successful login', 'handler' : 'login_success'},
'FAILED' : {'name' : 'Login Failure', 'description' : 'Sent During Session Login Only, password not accepted', 'handler' : 'login_failure'},
'Timed Out!' : {'name' : 'Login Interaction Timed Out', 'description' : 'Sent during Session Login Only, socket connection is then closed', 'handler' : 'login_timeout'},
'%00' : {'name' : 'Virtual Keypad Update', 'description' : 'The panel wants to update the state of the keypad','handler' : 'keypad_update'},
'%01' : {'type' : 'zone', 'name' : 'Zone State Change', 'description' : 'A zone change-of-state has occurred', 'handler' : 'zone_state_change'},
'%02' : {'type' : 'partition', 'name' : 'Partition State Change', 'description' : 'A partition change-of-state has occured', 'handler' : 'partition_state_change'},
'%03' : {'type' : 'system', 'name' : 'Realtime CID Event', 'description' : 'A system event has happened that is signaled to either the Envisalerts servers or the central monitoring station', 'handler' : 'realtime_cid_event'},
'%FF' : {'name' : 'Envisalink Zone Timer Dump', 'description' : 'This command contains the raw zone timers used inside the Envisalink. The dump is a 256 character packed HEX string representing 64 UINT16 (little endian) zone timers. Zone timers count down from 0xFFFF (zone is open) to 0x0000 (zone is closed too long ago to remember). Each ''tick'' of the zone time is actually 5 seconds so a zone timer of 0xFFFE means ''5 seconds ago''. Remember, the zone timers are LITTLE ENDIAN so the above example would be transmitted as FEFF.', 'handler' : 'zone_timer_dump'},
'^00' : {'type' : 'envisalink', 'name': 'Poll', 'description' : 'Envisalink poll', 'handler' : 'poll_response'},
'^01' : {'type' : 'envisalink', 'name': 'Change Default Partition', 'description': 'Change the partition which keystrokes are sent to when using the virtual keypad.', 'handler' : 'command_response'},
'^02' : {'type' : 'envisalink', 'name': 'Dump Zone Timers', 'description' : 'This command contains the raw zone timers used inside the Envisalink. The dump is a 256 character packed HEX string representing 64 UINT16 (little endian) zone timers. Zone timers count down from 0xFFFF (zone is open) to 0x0000 (zone is closed too long ago to remember). Each ''tick'' of the zone time is actually 5 seconds so a zone timer of 0xFFFE means ''5 seconds ago''. Remember, the zone timers are LITTLE ENDIAN so the above example would be transmitted as FEFF.','handler' : 'command_response'},
'^03' : {'type' : 'envisalink', 'name': 'Keypress to Specific Partition', 'description' : 'This will send a keystroke to the panel from an arbitrary partition. Use this if you don''t want to change the TPI default partition.' ,'handler' : 'command_response'},
'^0C' : {'type' : 'envisalink', 'name': 'Response for Invalid Command', 'description' : 'This response is returned when an invalid command number is passed to Envisalink', 'handler': 'command_response'}
}
evl_TPI_Response_Codes = {
'00' : 'Command Accepted',
'01' : 'Receive Buffer Overrun (a command is received while another is still being processed)',
'02' : 'Unknown Command',
'03' : 'Syntax Error. Data appended to the command is incorrect in some fashion',
'04' : 'Receive Buffer Overflow',
'05' : 'Receive State Machine Timeout (command not completed within 3 seconds)'
}
evl_Partition_Status_Codes = {
'00' : {'name' : 'NOT_USED', 'description' : 'Partition is not used or doesn''t exist'},
'01' : {'name' : 'READY', 'description' : 'Ready', 'pluginhandler' : 'disarmed'},
'02' : {'name' : 'READY_BYPASS', 'description' : 'Ready to Arm (Zones are Bypasses)', 'pluginhandler' : 'disarmed'},
'03' : {'name' : 'NOT_READY', 'description' : 'Not Ready', 'pluginhandler' : 'disarmed'},
'04' : {'name' : 'ARMED_STAY', 'description' : 'Armed in Stay Mode', 'pluginhandler' : 'armedHome'},
'05' : {'name' : 'ARMED_AWAY', 'description' : 'Armed in Away Mode', 'pluginhandler' : 'armedAway'},
'06' : {'name' : 'ARMED_MAX', 'description' : 'Armed in Away Mode', 'pluginhandler' : 'armedInstant'},
'07' : {'name' : 'EXIT_ENTRY_DELAY', 'description' : 'Entry or Exit Delay'},
'08' : {'name' : 'IN_ALARM', 'description' : 'Partition is in Alarm', 'pluginhandler' : 'alarmTriggered'},
'09' : {'name' : 'ALARM_IN_MEMORY', 'description' : 'Alarm Has Occurred (Alarm in Memory)', 'pluginhandler' : 'alarmCleared'}
}
evl_Virtual_Keypad_How_To_Beep = {
'00' : 'off',
'01' : 'beep 1 time',
'02' : 'beep 2 times',
'03' : 'beep 3 times',
'04' : 'continous fast beep',
'05' : 'continuous slow beep'
}
evl_CID_Qualifiers = {
1 : 'New Event or Opening',
3 : 'New Restore or Closing',
6 : 'Previously Reported Condition Still Present'
}
evl_CID_Events = {
100 : {
"label" : "Medical Alert",
"type" : "zone",
},
101 : {
"label" : "Personal Emergency",
"type" : "zone",
},
102 : {
"label" : "Failure to Report In",
"type" : "zone",
},
110 : {
"label" : "Fire Alarm",
"type" : "zone",
},
111 : {
"label" : "Smoke Alarm",
"type" : "zone",
},
112 : {
"label" : "Combustion Detected Alarm",
"type" : "zone",
},
113 : {
"label" : "Water Flood Alarm",
"type" : "zone",
},
114 : {
"label" : "Excessive Heat Alarm",
"type" : "zone",
},
115 : {
"label" : "Fire Alarm Pulled",
"type" : "zone",
},
116 : {
"label" : "Duct Alarm",
"type" : "zone",
},
117 : {
"label" : "Flame Detected",
"type" : "zone",
},
118 : {
"label" : "Near Alarm",
"type" : "zone",
},
120 : {
"label" : "Panic Alarm",
"type" : "zone",
},
121 : {
"label" : "Duress Alarm",
"type" : "user",
},
122 : {
"label" : "Alarm, 24-hour Silent",
"type" : "zone",
},
123 : {
"label" : "Alarm, 24-hour Audible",
"type" : "zone",
},
124 : {
"label" : "Duress - Access granted",
"type" : "zone",
},
125 : {
"label" : "Duress - Egress granted",
"type" : "zone",
},
130 : {
"label" : "Burgalry in Progress",
"type" : "zone",
},
131 : {
"label" : "Alarm, Perimeter",
"type" : "zone",
},
132 : {
"label" : "Alarm, Interior",
"type" : "zone",
},
133 : {
"label" : "24 Hour (Safe)",
"type" : "zone",
},
134 : {
"label" : "Alarm, Entry/Exit",
"type" : "zone",
},
135 : {
"label" : "Alarm, Day/Night",
"type" : "zone",
},
136 : {
"label" : "Alarm, Outdoor",
"type" : "zone",
},
137 : {
"label" : "Alarm, Tamper",
"type" : "zone",
},
138 : {
"label" : "Near Alarm",
"type" : "zone",
},
139 : {
"label" : "Intrusion Verifier",
"type" : "zone",
},
140 : {
"label" : "Alarm, General Alarm",
"type" : "zone",
},
141 : {
"label" : "Alarm, Polling Loop Open",
"type" : "zone",
},
142 : {
"label" : "Alarm, Polling Loop Short",
"type" : "zone",
},
143 : {
"label" : "Alarm, Expansion Module",
"type" : "zone",
},
144 : {
"label" : "Alarm, Sensor Tamper",
"type" : "zone",
},
145 : {
"label" : "Alarm, Expansion Module Tamper",
"type" : "zone",
},
146 : {
"label" : "Silent Burglary",
"type" : "zone",
},
147 : {
"label" : "Sensor Supervision failure",
"type" : "zone",
},
150 : {
"label" : "Alarm, 24-Hour Auxiliary",
"type" : "zone",
},
151 : {
"label" : "Alarm, Gas detected",
"type" : "zone",
},
152 : {
"label" : "Alarm, Refrigeration",
"type" : "zone",
},
153 : {
"label" : "Alarm, Loss of heat",
"type" : "zone",
},
154 : {
"label" : "Alarm, Water leakage",
"type" : "zone",
},
155 : {
"label" : "Alarm, foil break",
"type" : "zone",
},
156 : {
"label" : "Day trouble",
"type" : "zone",
},
157 : {
"label" : "Low bottled gas level",
"type" : "zone",
},
158 : {
"label" : "Alarm, High temperature",
"type" : "zone",
},
159 : {
"label" : "Alarm, Low temperature",
"type" : "zone",
},
161 : {
"label" : "Alarm, Loss of air flow",
"type" : "zone",
},
162 : {
"label" : "Alarm, Carbon Monoxide Detected",
"type" : "zone",
},
163 : {
"label" : "Alarm, Tank Level",
"type" : "zone",
},
300 : {
"label" : "System Trouble",
"type" : "zone",
},
301 : {
"label" : "AC Power",
"type" : "zone",
},
302 : {
"label" : "Low System Battery/Battery Test Fail",
"type" : "zone",
},
303 : {
"label" : "RAM Checksum Bad",
"type" : "zone",
},
304 : {
"label" : "ROM Checksum Bad",
"type" : "zone",
},
305 : {
"label" : "System Reset",
"type" : "zone",
},
306 : {
"label" : "Panel programming changed",
"type" : "zone",
},
307 : {
"label" : "Self-test failure",
"type" : "zone",
},
308 : {
"label" : "System shutdown",
"type" : "zone",
},
309 : {
"label" : "Battery test failure",
"type" : "zone",
},
310 : {
"label" : "Ground fault",
"type" : "zone",
},
311 : {
"label" : "Battery Missing/Dead",
"type" : "zone",
},
312 : {
"label" : "Power Supply Overcurrent",
"type" : "zone",
},
313 : {
"label" : "Engineer Reset",
"type" : "user",
},
321 : {
"label" : "Bell/Siren Trouble",
"type" : "zone",
},
333 : {
"label" : "Trouble or Tamper Expansion Module",
"type" : "zone",
},
341 : {
"label" : "Trouble, ECP Cover Tamper",
"type" : "zone",
},
344 : {
"label" : "RF Receiver Jam",
"type" : "zone",
},
351 : {
"label" : "Telco Line Fault",
"type" : "zone",
},
353 : {
"label" : "Long Range Radio Trouble",
"type" : "zone",
},
373 : {
"label" : "Fire Loop Trouble",
"type" : "zone",
},
374 : {
"label" : "Exit Error Alarm",
"type" : "zone",
},
380 : {
"label" : "Global Trouble, Trouble Day/Night",
"type" : "zone",
},
381 : {
"label" : "RF Supervision Trouble",
"type" : "zone",
},
382 : {
"label" : "Supervision Auxillary Wire Zone",
"type" : "zone",
},
383 : {
"label" : "RF Sensor Tamper",
"type" : "zone",
},
384 : {
"label" : "RF Sensor Low Battery",
"type" : "zone",
},
393 : {
"label" : "Clean Me",
"type" : "zone",
},
401 : {
"label" : "AWAY/MAX",
"type" : "user",
},
403 : {
"label" : "Scheduled Arming",
"type" : "user",
},
406 : {
"label" : "Cancel by User",
"type" : "user",
},
407 : {
"label" : "Remote Arm/Disarm (Downloading)",
"type" : "user",
},
408 : {
"label" : "Quick AWAY/MAX",
"type" : "user",
},
409 : {
"label" : "AWAY/MAX Keyswitch",
"type" : "user",
},
411 : {
"label" : "Callback Requested",
"type" : "user",
},
412 : {
"label" : "Success-Download/Access",
"type" : "user",
},
413 : {
"label" : "Unsuccessful Access",
"type" : "user",
},
414 : {
"label" : "System Shutdown",
"type" : "user",
},
415 : {
"label" : "Dialer Shutdown",
"type" : "user",
},
416 : {
"label" : "Successful Upload",
"type" : "user",
},
421 : {
"label" : "Access Denied",
"type" : "user",
},
422 : {
"label" : "Access Granted",
"type" : "user",
},
423 : {
"label" : "PANIC Forced Access",
"type" : "zone",
},
424 : {
"label" : "Egress Denied",
"type" : "user",
},
425 : {
"label" : "Egress Granted",
"type" : "user",
},
426 : {
"label" : "Access Door Propped Open",
"type" : "zone",
},
427 : {
"label" : "Access Point DSM Trouble",
"type" : "zone",
},
428 : {
"label" : "Access Point RTE Trouble",
"type" : "zone",
},
429 : {
"label" : "Access Program Mode Entry",
"type" : "user",
},
430 : {
"label" : "Access Program Mode Exit",
"type" : "user",
},
431 : {
"label" : "Access Threat Level Change",
"type" : "user",
},
432 : {
"label" : "Access Relay/Triger Failure",
"type" : "zone",
},
433 : {
"label" : "Access RTE Shunt",
"type" : "zone",
},
434 : {
"label" : "Access DSM Shunt",
"type" : "zone",
},
441 : {
"label" : "STAY/INSTANT",
"type" : "user",
},
442 : {
"label" : "STAY/INSTANT Keyswitch",
"type" : "user",
},
570 : {
"label" : "Zone Bypass",
"type" : "zone",
},
574 : {
"label" : "Group Bypass",
"type" : "user"
},
601 : {
"label" : "Operator Initiated Dialer Test",
"type" : "user",
},
602 : {
"label" : "Periodic Test",
"type" : "zone",
},
606 : {
"label" : "AAV to follow",
"type" : "zone",
},
607 : {
"label" : "Walk Test",
"type" : "user",
},
623 : {
"label" : "Event Log 80% Full",
"type" : "zone",
},
625 : {
"label" : "Real-Time Clock Changed",
"type" : "user",
},
627 : {
"label" : "Program Mode Entry",
"type" : "zone",
},
628 : {
"label" : "Program Mode Exit",
"type" : "zone",
},
629 : {
"label" : "1-1/3 Day No Event",
"type" : "zone",
},
642 : {
"label" : "Latch Key",
"type" : "user",
},
}