forked from Tertiush/ParadoxIP150v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParadoxMap.py
928 lines (830 loc) · 42.8 KB
/
ParadoxMap.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
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
"""
This package is statically programmed and dynamically refernce in from the main script.
Within the config.ini file your "Alarm_Registry_Map" and "Alarm_Event_Map" values are appended
with "Registers()" and "EventMap" respectively to load the correct classes for your alarm.
To enable the updating of label names to those configured in your alarm, update the "SupportedItems"
dictionary in the ..."Registers" Class below. The main script will iterate through this list and dynamically
build the relevant get and set functions from the Registers and EventMap classes to update the values
it publishes.
For this reason (dynamic build of function names) the function names listed in the "supportedItems" dictionary
must be an exact (case-sensitive) replica of the relevant functions to interact with its dictionaries.
"""
"""
MG5050: This class maps all MG5050 V4.xx register to labels or output actions
"""
class ParadoxMG5050Registers():
# Link different registry mappings here to event label entries, note that functions to
# poll & retrieve these externally must be structure as get/set/getall in the respctive classes
# with names that exactly match the "supportedItems" below and dictionary names.
supportedItems = {"zoneLabel",
"outputLabel",
"partitionLabel",
"userLabel",
"busModuleLabel",
"wirelessRepeaterLabel",
"wirelessSirenLabel",
"wirelessKeypadLabel",
"siteNameLabel"
}
zoneLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x00\x10", "Receive": {"Start": 20, "Finish": 36}}, # I.e. get data from register \x50000010, extract text from posisiton 20 to 36
2: {"Send": "\x50\x00\x00\x10", "Receive": {"Start": 36, "Finish": 52}},
3: {"Send": "\x50\x00\x00\x30", "Receive": {"Start": 20, "Finish": 36}},
4: {"Send": "\x50\x00\x00\x30", "Receive": {"Start": 36, "Finish": 52}},
5: {"Send": "\x50\x00\x00\x50", "Receive": {"Start": 20, "Finish": 36}},
6: {"Send": "\x50\x00\x00\x50", "Receive": {"Start": 36, "Finish": 52}},
7: {"Send": "\x50\x00\x00\x70", "Receive": {"Start": 20, "Finish": 36}},
8: {"Send": "\x50\x00\x00\x70", "Receive": {"Start": 36, "Finish": 52}},
9: {"Send": "\x50\x00\x00\x90", "Receive": {"Start": 20, "Finish": 36}},
10: {"Send": "\x50\x00\x00\x90", "Receive": {"Start": 36, "Finish": 52}},
11: {"Send": "\x50\x00\x00\xb0", "Receive": {"Start": 20, "Finish": 36}},
12: {"Send": "\x50\x00\x00\xb0", "Receive": {"Start": 36, "Finish": 52}},
13: {"Send": "\x50\x00\x00\xd0", "Receive": {"Start": 20, "Finish": 36}},
14: {"Send": "\x50\x00\x00\xd0", "Receive": {"Start": 36, "Finish": 52}},
15: {"Send": "\x50\x00\x00\xf0", "Receive": {"Start": 20, "Finish": 36}},
16: {"Send": "\x50\x00\x00\xf0", "Receive": {"Start": 36, "Finish": 52}},
17: {"Send": "\x50\x00\x01\x10", "Receive": {"Start": 20, "Finish": 36}},
18: {"Send": "\x50\x00\x01\x10", "Receive": {"Start": 36, "Finish": 52}},
19: {"Send": "\x50\x00\x01\x30", "Receive": {"Start": 20, "Finish": 36}},
20: {"Send": "\x50\x00\x01\x30", "Receive": {"Start": 36, "Finish": 52}},
21: {"Send": "\x50\x00\x01\x50", "Receive": {"Start": 20, "Finish": 36}},
22: {"Send": "\x50\x00\x01\x50", "Receive": {"Start": 36, "Finish": 52}},
23: {"Send": "\x50\x00\x01\x70", "Receive": {"Start": 20, "Finish": 36}},
24: {"Send": "\x50\x00\x01\x70", "Receive": {"Start": 36, "Finish": 52}},
25: {"Send": "\x50\x00\x01\x90", "Receive": {"Start": 20, "Finish": 36}},
26: {"Send": "\x50\x00\x01\x90", "Receive": {"Start": 36, "Finish": 52}},
27: {"Send": "\x50\x00\x01\xb0", "Receive": {"Start": 20, "Finish": 36}},
28: {"Send": "\x50\x00\x01\xb0", "Receive": {"Start": 36, "Finish": 52}},
29: {"Send": "\x50\x00\x01\xd0", "Receive": {"Start": 20, "Finish": 36}},
30: {"Send": "\x50\x00\x01\xd0", "Receive": {"Start": 36, "Finish": 52}},
31: {"Send": "\x50\x00\x01\xf0", "Receive": {"Start": 20, "Finish": 36}},
32: {"Send": "\x50\x00\x01\xf0", "Receive": {"Start": 36, "Finish": 52}},
}
outputLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x02\x10", "Receive": {"Start": 20, "Finish": 36}},
2: {"Send": "\x50\x00\x02\x10", "Receive": {"Start": 36, "Finish": 52}},
3: {"Send": "\x50\x00\x02\x30", "Receive": {"Start": 20, "Finish": 36}},
4: {"Send": "\x50\x00\x02\x30", "Receive": {"Start": 36, "Finish": 52}},
5: {"Send": "\x50\x00\x02\x50", "Receive": {"Start": 20, "Finish": 36}},
6: {"Send": "\x50\x00\x02\x50", "Receive": {"Start": 36, "Finish": 52}},
7: {"Send": "\x50\x00\x02\x70", "Receive": {"Start": 20, "Finish": 36}},
8: {"Send": "\x50\x00\x02\x70", "Receive": {"Start": 36, "Finish": 52}},
9: {"Send": "\x50\x00\x02\x90", "Receive": {"Start": 20, "Finish": 36}},
10: {"Send": "\x50\x00\x02\x90", "Receive": {"Start": 36, "Finish": 52}},
11: {"Send": "\x50\x00\x02\xb0", "Receive": {"Start": 20, "Finish": 36}},
12: {"Send": "\x50\x00\x02\xb0", "Receive": {"Start": 36, "Finish": 52}},
13: {"Send": "\x50\x00\x02\xd0", "Receive": {"Start": 20, "Finish": 36}},
14: {"Send": "\x50\x00\x02\xd0", "Receive": {"Start": 36, "Finish": 52}},
15: {"Send": "\x50\x00\x02\xf0", "Receive": {"Start": 20, "Finish": 36}},
16: {"Send": "\x50\x00\x02\xf0", "Receive": {"Start": 36, "Finish": 52}}
}
partitionLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x03\x10", "Receive": {"Start": 20, "Finish": 36}},
2: {"Send": "\x50\x00\x03\x10", "Receive": {"Start": 36, "Finish": 52}}
}
userLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x03\x30", "Receive": {"Start": 20, "Finish": 36}},
2: {"Send": "\x50\x00\x03\x30", "Receive": {"Start": 36, "Finish": 52}},
3: {"Send": "\x50\x00\x03\x50", "Receive": {"Start": 20, "Finish": 36}},
4: {"Send": "\x50\x00\x03\x50", "Receive": {"Start": 36, "Finish": 52}},
5: {"Send": "\x50\x00\x03\x70", "Receive": {"Start": 20, "Finish": 36}},
6: {"Send": "\x50\x00\x03\x70", "Receive": {"Start": 36, "Finish": 52}},
7: {"Send": "\x50\x00\x03\x90", "Receive": {"Start": 20, "Finish": 36}},
8: {"Send": "\x50\x00\x03\x90", "Receive": {"Start": 36, "Finish": 52}},
9: {"Send": "\x50\x00\x03\xb0", "Receive": {"Start": 20, "Finish": 36}},
10: {"Send": "\x50\x00\x03\xb0", "Receive": {"Start": 36, "Finish": 52}},
11: {"Send": "\x50\x00\x03\xd0", "Receive": {"Start": 20, "Finish": 36}},
12: {"Send": "\x50\x00\x03\xd0", "Receive": {"Start": 36, "Finish": 52}},
13: {"Send": "\x50\x00\x03\xf0", "Receive": {"Start": 20, "Finish": 36}},
14: {"Send": "\x50\x00\x03\xf0", "Receive": {"Start": 36, "Finish": 52}},
15: {"Send": "\x50\x00\x04\x10", "Receive": {"Start": 20, "Finish": 36}},
16: {"Send": "\x50\x00\x04\x10", "Receive": {"Start": 36, "Finish": 52}},
17: {"Send": "\x50\x00\x04\x30", "Receive": {"Start": 20, "Finish": 36}},
18: {"Send": "\x50\x00\x04\x30", "Receive": {"Start": 36, "Finish": 52}},
19: {"Send": "\x50\x00\x04\x50", "Receive": {"Start": 20, "Finish": 36}},
20: {"Send": "\x50\x00\x04\x50", "Receive": {"Start": 36, "Finish": 52}},
21: {"Send": "\x50\x00\x04\x70", "Receive": {"Start": 20, "Finish": 36}},
22: {"Send": "\x50\x00\x04\x70", "Receive": {"Start": 36, "Finish": 52}},
23: {"Send": "\x50\x00\x04\x90", "Receive": {"Start": 20, "Finish": 36}},
24: {"Send": "\x50\x00\x04\x90", "Receive": {"Start": 36, "Finish": 52}},
25: {"Send": "\x50\x00\x04\xb0", "Receive": {"Start": 20, "Finish": 36}},
26: {"Send": "\x50\x00\x04\xb0", "Receive": {"Start": 36, "Finish": 52}},
27: {"Send": "\x50\x00\x04\xd0", "Receive": {"Start": 20, "Finish": 36}},
28: {"Send": "\x50\x00\x04\xd0", "Receive": {"Start": 36, "Finish": 52}},
29: {"Send": "\x50\x00\x04\xf0", "Receive": {"Start": 20, "Finish": 36}},
30: {"Send": "\x50\x00\x04\xf0", "Receive": {"Start": 36, "Finish": 52}},
31: {"Send": "\x50\x00\x05\x10", "Receive": {"Start": 20, "Finish": 36}},
32: {"Send": "\x50\x00\x05\x10", "Receive": {"Start": 36, "Finish": 52}},
}
busModuleLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x05\x30", "Receive": {"Start": 20, "Finish": 36}},
2: {"Send": "\x50\x00\x05\x30", "Receive": {"Start": 36, "Finish": 52}},
3: {"Send": "\x50\x00\x05\x50", "Receive": {"Start": 20, "Finish": 36}},
4: {"Send": "\x50\x00\x05\x50", "Receive": {"Start": 36, "Finish": 52}},
5: {"Send": "\x50\x00\x05\x70", "Receive": {"Start": 20, "Finish": 36}},
6: {"Send": "\x50\x00\x05\x70", "Receive": {"Start": 36, "Finish": 52}},
7: {"Send": "\x50\x00\x05\x90", "Receive": {"Start": 20, "Finish": 36}},
8: {"Send": "\x50\x00\x05\x90", "Receive": {"Start": 36, "Finish": 52}},
9: {"Send": "\x50\x00\x05\xb0", "Receive": {"Start": 20, "Finish": 36}},
10: {"Send": "\x50\x00\x05\xb0", "Receive": {"Start": 36, "Finish": 52}},
11: {"Send": "\x50\x00\x05\xd0", "Receive": {"Start": 20, "Finish": 36}},
12: {"Send": "\x50\x00\x05\xd0", "Receive": {"Start": 36, "Finish": 52}},
13: {"Send": "\x50\x00\x05\xf0", "Receive": {"Start": 20, "Finish": 36}},
14: {"Send": "\x50\x00\x05\xf0", "Receive": {"Start": 36, "Finish": 52}},
15: {"Send": "\x50\x00\x06\x10", "Receive": {"Start": 20, "Finish": 36}},
}
wirelessRepeaterLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x06\x10", "Receive": {"Start": 36, "Finish": 52}},
2: {"Send": "\x50\x00\x06\x30", "Receive": {"Start": 20, "Finish": 36}}
}
wirelessKeypadLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x06\x30", "Receive": {"Start": 36, "Finish": 52}},
2: {"Send": "\x50\x00\x06\x50", "Receive": {"Start": 20, "Finish": 36}},
3: {"Send": "\x50\x00\x06\x50", "Receive": {"Start": 36, "Finish": 52}},
4: {"Send": "\x50\x00\x06\x70", "Receive": {"Start": 20, "Finish": 36}},
5: {"Send": "\x50\x00\x06\x70", "Receive": {"Start": 36, "Finish": 52}},
6: {"Send": "\x50\x00\x06\x90", "Receive": {"Start": 20, "Finish": 36}},
7: {"Send": "\x50\x00\x06\x90", "Receive": {"Start": 36, "Finish": 52}},
8: {"Send": "\x50\x00\x06\xb0", "Receive": {"Start": 20, "Finish": 36}}
}
siteNameLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x06\xb0", "Receive": {"Start": 36, "Finish": 52}}
}
wirelessSirenLabel = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"Send": "\x50\x00\x06\xd0", "Receive": {"Start": 20, "Finish": 36}},
2: {"Send": "\x50\x00\x06\xd0", "Receive": {"Start": 36, "Finish": 52}},
3: {"Send": "\x50\x00\x06\xf0", "Receive": {"Start": 20, "Finish": 36}},
4: {"Send": "\x50\x00\x06\xf0", "Receive": {"Start": 36, "Finish": 52}}
}
controlOutput = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"ON": "\x40\x00\x30\x00", "OFF": "\x40\x00\x31\x00"},
2: {"ON": "\x40\x00\x30\x01", "OFF": "\x40\x00\x31\x01"},
3: {"ON": "\x40\x00\x30\x02", "OFF": "\x40\x00\x31\x02"},
4: {"ON": "\x40\x00\x30\x03", "OFF": "\x40\x00\x31\x03"},
5: {"ON": "\x40\x00\x30\x04", "OFF": "\x40\x00\x31\x04"},
6: {"ON": "\x40\x00\x30\x05", "OFF": "\x40\x00\x31\x05"},
7: {"ON": "\x40\x00\x30\x06", "OFF": "\x40\x00\x31\x06"},
8: {"ON": "\x40\x00\x30\x07", "OFF": "\x40\x00\x31\x07"},
9: {"ON": "\x40\x00\x30\x08", "OFF": "\x40\x00\x31\x08"},
10: {"ON": "\x40\x00\x30\x09", "OFF": "\x40\x00\x31\x09"},
11: {"ON": "\x40\x00\x30\x0a", "OFF": "\x40\x00\x31\x0a"},
12: {"ON": "\x40\x00\x30\x0b", "OFF": "\x40\x00\x31\x0b"},
13: {"ON": "\x40\x00\x30\x0c", "OFF": "\x40\x00\x31\x0c"},
14: {"ON": "\x40\x00\x30\x0d", "OFF": "\x40\x00\x31\x0d"},
15: {"ON": "\x40\x00\x30\x0e", "OFF": "\x40\x00\x31\x0e"},
16: {"ON": "\x40\x00\x30\x0f", "OFF": "\x40\x00\x31\x0f"},
}
controlAlarm = {"Header": "\xaa\x25\x00\x04\x08\x00\x00\x14\xee\xee\xee\xee\xee\xee\xee\xee",
1: {"ARM": "\x40\x00\x04\x00", "DISARM": "\x40\x00\x05\x00", "SLEEP": "\x40\x00\x03\x00", "STAY": "\x40\x00\x01\x00"},
2: {"ARM": "\x40\x00\x04\x01", "DISARM": "\x40\x00\x05\x01", "SLEEP": "\x40\x00\x03\x01", "STAY": "\x40\x00\x01\x01"}}
@staticmethod
def getzoneLabelRegister():
return ParadoxMG5050Registers.zoneLabel
@staticmethod
def getpartitionLabelRegister():
return ParadoxMG5050Registers.partitionLabel
@staticmethod
def getuserLabelRegister():
return ParadoxMG5050Registers.userLabel
@staticmethod
def getbusModuleLabelRegister():
return ParadoxMG5050Registers.busModuleLabel
@staticmethod
def getwirelessRepeaterLabelRegister():
return ParadoxMG5050Registers.wirelessRepeaterLabel
@staticmethod
def getwirelessKeypadLabelRegister():
return ParadoxMG5050Registers.wirelessKeypadLabel
@staticmethod
def getsiteNameLabelRegister():
return ParadoxMG5050Registers.siteNameLabel
@staticmethod
def getwirelessSirenLabelRegister():
return ParadoxMG5050Registers.wirelessSirenLabel
@staticmethod
def getoutputLabelRegister():
# try:
return ParadoxMG5050Registers.outputLabel
@staticmethod
def getcontrolOutputRegister():
# try:
return ParadoxMG5050Registers.controlOutput
@staticmethod
def getcontrolAlarmRegister():
# try:
return ParadoxMG5050Registers.controlAlarm
@staticmethod
def getsupportedItems():
# try:
return ParadoxMG5050Registers.supportedItems
"""
MG5050: This class is used for reporting events. The generic names for grouped items will be
updated if a corresponding register location is given in the Registers class
See: E.g. the mappings for an MG5050: http://www.imotionsecurite.com/pdf/paradox/MGSP-EP20.pdf
"""
class ParadoxMG5050EventMap():
def __init__(self):
print 'init'
'''mapping of event and subevent groups here'''
eventGroupMap = {0: 'Zone OK',
1: 'Zone open',
2: 'Partition status',
3: 'Bell status (Partition 1)',
# 5: 'Non-Reportable Event',
6: 'Non-reportable event',
# 7: 'PGM Activation',
8: 'Button B pressed on remote',
9: 'Button C pressed on remote',
10: 'Button D pressed on remote',
11: 'Button E pressed on remote',
12: 'Cold start wireless zone',
13: 'Cold start wireless module (Partition 1)',
14: 'Bypass programming',
15: 'User code activated output (Partition 1)',
16: 'Wireless smoke maintenance signal',
17: 'Delay zone alarm transmission',
18: 'Zone signal strength weak 1 (Partition 1)',
19: 'Zone signal strength weak 2 (Partition 1)',
20: 'Zone signal strength weak 3 (Partition 1)',
21: 'Zone signal strength weak 4 (Partition 1)',
22: 'Button 5 pressed on remote',
23: 'Button 6 pressed on remote',
24: 'Fire delay started',
# 25: 'N/A',
26: 'Software access',
27: 'Bus module event',
28: 'StayD pass acknowledged',
29: 'Arming with user',
30: 'Special arming',
31: 'Disarming with user',
32: 'Disarming after alarm with user',
33: 'Alarm cancelled with user',
34: 'Special disarming',
35: 'Zone bypassed',
36: 'Zone in alarm',
37: 'Fire alarm',
38: 'Zone alarm restore',
39: 'Fire alarm restore',
40: 'Special alarm',
41: 'Zone shutdown',
42: 'Zone tampered',
43: 'Zone tamper restore',
44: 'New trouble (Partition 1, both for sub event 7',
45: 'Trouble restored ',
46: 'Bus / EBus / Wireless module new trouble (Partition 1)',
47: 'Bus / EBus / Wireless module trouble restored (Partition 1)',
48: 'Special (Partition 1)',
49: 'Low battery on zone',
50: 'Low battery on zone restore',
51: 'Zone supervision trouble',
52: 'Zone supervision restore',
53: 'Wireless module supervision trouble (Partition 1)',
54: 'Wireless module supervision restore (Partition 1)',
55: 'Wireless module tamper trouble (Partition 1)',
56: 'Wireless module tamper restore (Partition 1)',
57: 'Non-medical alarm (paramedic)',
58: 'Zone forced',
59: 'Zone included',
64: 'System Status'
}
_zoneLabel = {1: 'Zone 1',
2: 'Zone 2',
3: 'Zone 3',
4: 'Zone 4',
5: 'Zone 5',
6: 'Zone 6',
7: 'Zone 7',
8: 'Zone 8',
9: 'Zone 9',
10: 'Zone 10',
11: 'Zone 11',
12: 'Zone 12',
13: 'Zone 13',
14: 'Zone 14',
15: 'Zone 15',
16: 'Zone 16',
17: 'Zone 17',
18: 'Zone 18',
19: 'Zone 19',
20: 'Zone 20',
21: 'Zone 21',
22: 'Zone 22',
23: 'Zone 23',
24: 'Zone 24',
25: 'Zone 25',
26: 'Zone 26',
27: 'Zone 27',
28: 'Zone 28',
29: 'Zone 29',
30: 'Zone 30',
31: 'Zone 31',
32: 'Zone 32',
99: 'Any zone'}
_partitionStatus = {0: 'N/A',
1: 'N/A',
2: 'Silent alarm',
3: 'Buzzer alarm',
4: 'Steady alarm',
5: 'Pulse alarm',
6: 'Strobe',
7: 'Alarm stopped',
8: 'Squawk ON (Partition 1)',
9: 'Squawk OFF (Partition 1)',
10: 'Ground Start (Partition 1)',
11: 'Disarm partition',
12: 'Arm partition',
13: 'Entry delay started',
14: 'Exit delay started',
15: 'Pre-alarm delay',
16: 'Report confirmation',
99: 'Any partition status event'
}
_bellStatus = {0: ' Bell OFF',
1: ' Bell ON',
2: ' Bell squawk arm',
3: ' Bell squawk disarm',
99: 'Any bell status event'}
_nonReportableEvents = {0: 'Telephone line trouble',
1: '[ENTER]/[CLEAR]/[POWER] key was pressed (Partition 1 only)',
2: 'N/A',
3: 'Arm in stay mode',
4: 'Arm in sleep mode',
5: 'Arm in force mode',
6: 'Full arm when armed in stay mode',
7: 'PC fail to communicate (Partition 1)',
8: 'Utility Key 1 pressed (keys [1] and [2]) (Partition 1)',
9: 'Utility Key 2 pressed (keys [4] and [5]) (Partition 1)',
10: 'Utility Key 3 pressed (keys [7] and [8]) (Partition 1)',
11: 'Utility Key 4 pressed (keys [2] and [3]) (Partition 1)',
12: 'Utility Key 5 pressed (keys [5] and [6]) (Partition 1)',
13: 'Utility Key 6 pressed (keys [8] and [9]) (Partition 1)',
14: 'Tamper generated alarm',
15: 'Supervision loss generated alarm',
16: 'N/A',
17: 'N/Ad',
18: 'N/A',
19: 'N/A',
20: 'Full arm when armed in sleep mode',
21: 'Firmware upgrade -Partition 1 only (non-PGM event)',
22: 'N/A',
23: 'StayD mode activated',
24: 'StayD mode deactivated',
25: 'IP Registration status change',
26: 'GPRS Registration status change',
99: 'Any non-reportable event'}
_userLabel = {1: 'User Number 1',
2: 'User Number 2',
3: 'User Number 3',
4: 'User Number 4',
5: 'User Number 5',
6: 'User Number 6',
7: 'User Number 7',
8: 'User Number 8',
9: 'User Number 9',
10: 'User Number 10',
11: 'User Number 11',
12: 'User Number 12',
13: 'User Number 13',
14: 'User Number 14',
15: 'User Number 15',
16: 'User Number 16',
17: 'User Number 17',
18: 'User Number 18',
19: 'User Number 19',
20: 'User Number 20',
21: 'User Number 21',
22: 'User Number 22',
23: 'User Number 23',
24: 'User Number 24',
25: 'User Number 25',
26: 'User Number 26',
27: 'User Number 27',
28: 'User Number 28',
29: 'User Number 29',
30: 'User Number 30',
31: 'User Number 31',
32: 'User Number 32'
}
_remoteLabel = {1: 'Remote control number 1',
2: 'Remote control number 2',
3: 'Remote control number 3',
4: 'Remote control number 4',
5: 'Remote control number 5',
6: 'Remote control number 6',
7: 'Remote control number 7',
8: 'Remote control number 8',
9: 'Remote control number 9',
10: 'Remote control number 10',
11: 'Remote control number 11',
12: 'Remote control number 12',
13: 'Remote control number 13',
14: 'Remote control number 14',
15: 'Remote control number 15',
16: 'Remote control number 16',
17: 'Remote control number 17',
18: 'Remote control number 18',
19: 'Remote control number 19',
20: 'Remote control number 20',
21: 'Remote control number 21',
22: 'Remote control number 22',
23: 'Remote control number 23',
24: 'Remote control number 24',
25: 'Remote control number 25',
26: 'Remote control number 26',
27: 'Remote control number 27',
28: 'Remote control number 28',
29: 'Remote control number 29',
30: 'Remote control number 30',
31: 'Remote control number 31',
32: 'Remote control number 32',
99: 'Any remote control number'
}
_specialArming = {0: 'Auto-arming (on time/no movement)',
1: 'Late to close',
2: 'No movement arming',
3: 'Partial arming',
4: 'Quick arming',
5: 'Arming through WinLoad',
6: 'Arming with keyswitch',
99: 'Any special arming'
}
_specialDisarming = {0: 'Auto-arm cancelled (on time/no movement)',
1: 'Disarming through WinLoad',
2: 'Disarming through WinLoad after alarm',
3: 'Alarm cancelled through WinLoad',
4: 'Paramedical alarm cancelled',
5: 'Disarm with keyswitch',
6: 'Disarm with keyswitch after an alarm',
7: 'Alarm cancelled with keyswitch',
99: 'Any special disarming'
}
_specialAlarm = {0: 'Panic non-medical emergency',
1: 'Panic medical',
2: 'Panic fire',
3: 'Recent closing',
4: 'Global shutdown',
5: 'Duress alarm',
6: 'Keypad lockout (Partition 1)',
99: 'Any special alarm event'
}
_newTrouble = {0: 'N/A',
1: 'AC failure',
2: 'Battery failure',
3: 'Auxiliary current overload',
4: 'Bell current overload',
5: 'Bell disconnected',
6: 'Clock loss',
7: 'Fire loop trouble',
8: 'Fail to communicate to monitoring station telephone #1',
9: 'Fail to communicate to monitoring station telephone #2',
11: 'Fail to communicate to voice report',
12: 'RF jamming',
13: 'GSM RF jamming',
14: 'GSM no service',
15: 'GSM supervision lost',
16: 'Fail To Communicate IP Receiver 1 (GPRS)',
17: 'Fail To Communicate IP Receiver 2 (GPRS)',
18: 'IP Module No Service',
19: 'IP Module Supervision Loss',
20: 'Fail To Communicate IP Receiver 1 (IP)',
21: 'Fail To Communicate IP Receiver 2 (IP)',
99: 'Any new trouble event'
}
_troubleRestored = {0: 'Telephone line restore',
1: 'AC failure restore',
2: 'Battery failure restore',
3: 'Auxiliary current overload restore',
4: 'Bell current overload restore',
5: 'Bell disconnected restore',
6: 'Clock loss restore',
7: 'Fire loop trouble restore',
8: 'Fail to communicate to monitoring station telephone #1 restore',
9: 'Fail to communicate to monitoring station telephone #2 restore',
11: 'Fail to communicate to voice report restore',
12: 'RF jamming restore',
13: 'GSM RF jamming restore',
14: 'GSM no service restore',
15: 'GSM supervision lost restore',
16: 'Fail To Communicate IP Receiver 1 (GPRS) restore',
17: 'Fail To Communicate IP Receiver 2 (GPRS) restore',
18: 'IP Module No Service restore',
19: 'IP Module Supervision Loss restore',
20: 'Fail To Communicate IP Receiver 1 (IP) restore',
21: 'Fail To Communicate IP Receiver 2 (IP) restore',
99: 'Any trouble event restore'
}
_softwareAccess = {0: 'Non-valid source ID',
1: 'WinLoad direct',
2: 'WinLoad through IP module',
3: 'WinLoad through GSM module',
4: 'WinLoad through modem',
9: 'IP100 direct',
10: 'VDMP3 direct',
11: 'Voice through GSM module',
12: 'Remote access',
13: 'SMS through GSM module',
99: 'Any software access'
}
_outputLabel = {1: 'PGM Number 1',
2: 'PGM Number 2',
3: 'PGM Number 3',
4: 'PGM Number 4',
5: 'PGM Number 5',
6: 'PGM Number 6',
7: 'PGM Number 7',
8: 'PGM Number 8',
9: 'PGM Number 9',
10: 'PGM Number 10',
11: 'PGM Number 11',
12: 'PGM Number 12',
13: 'PGM Number 13',
14: 'PGM Number 14',
15: 'PGM Number 15',
16: 'PGM Number 16'
}
_wirelessRepeater = {1: 'Wireless repeater 1',
2: 'Wireless repeater 2'}
_wirelessKeypad = {1: 'Wireless keypad 1',
2: 'Wireless keypad 2',
3: 'Wireless keypad 3',
4: 'Wireless keypad 4',
5: 'Wireless keypad 5',
6: 'Wireless keypad 6',
7: 'Wireless keypad 7',
8: 'Wireless keypad 8'
}
_wirelessSiren = {1: 'Wireless siren 1',
2: 'Wireless siren 2',
3: 'Wireless siren 3',
4: 'Wireless siren 4'}
_busModuleEvent = {0: 'A bus module was added',
1: 'A bus module was removed',
2: '2-way RF Module Communication Failure',
3: '2-way RF Module Communication Restored'
}
_moduleTrouble = {0: 'Bus / EBus / Wireless module communication fault',
1: 'Tamper trouble',
2: 'Power fail',
3: 'Battery failure',
99: 'Any bus module new trouble event'
}
_moduleTroubleRestore = {0: 'Bus / EBus / Wireless module communication fault restore',
1: 'Tamper trouble restore',
2: 'Power fail restore',
3: 'Battery failure restore',
99: 'Any bus module trouble restored event'
}
_special = {0: 'System power up',
1: 'Reporting test',
2: 'Software log on',
3: 'Software log off',
4: 'Installer in programming mode',
5: 'Installer exited programming mode',
6: 'Maintenance in programming mode',
7: 'Maintenance exited programming mode',
8: 'Closing delinquency delay elapsed',
99: 'Any special event'
}
_systemStatus = {0: 'Follow Arm LED status',
1: 'PGM pulse fast in alarm',
2: 'PGM pulse fast in exit delay below 10 sec.',
3: 'PGM pulse slow in exit delay over 10 sec.',
4: 'PGM steady ON if armed',
5: 'PGM OFF if disarmed',
}
_eventOpt1 = {1: _outputLabel[1],
2: _outputLabel[2],
3: _outputLabel[3],
4: _outputLabel[4],
5: _outputLabel[5],
6: _outputLabel[6],
7: _outputLabel[7],
8: _outputLabel[8],
9: _outputLabel[9],
10: _outputLabel[10],
11: _outputLabel[11],
12: _outputLabel[12],
13: _outputLabel[13],
14: _outputLabel[14],
15: _outputLabel[15],
16: _outputLabel[16],
17: _wirelessRepeater[1],
18: _wirelessRepeater[2],
19: _wirelessKeypad[1],
20: _wirelessKeypad[2],
21: _wirelessKeypad[3],
22: _wirelessKeypad[4],
27: _wirelessSiren[1],
28: _wirelessSiren[2],
29: _wirelessSiren[3],
30: _wirelessSiren[4],
99: 'Any output number'
}
'''dictionary consisting of dictionary'''
subEventGroupMap = {0: _zoneLabel,
1: _zoneLabel,
2: _partitionStatus,
3: _bellStatus,
6: _nonReportableEvents,
8: _remoteLabel,
9: _remoteLabel,
10: _remoteLabel,
11: _remoteLabel,
12: _zoneLabel,
13: _eventOpt1,
14: _zoneLabel,
15: _zoneLabel,
16: _zoneLabel,
17: _zoneLabel,
18: _zoneLabel,
19: _zoneLabel,
20: _zoneLabel,
21: _zoneLabel,
22: _remoteLabel,
23: _remoteLabel,
24: _zoneLabel,
# 25 :_zoneLabel,
26: _softwareAccess,
27: _busModuleEvent,
28: _zoneLabel,
29: _userLabel,
30: _specialArming,
31: _userLabel,
32: _userLabel,
33: _userLabel,
34: _specialDisarming,
35: _zoneLabel,
36: _zoneLabel,
37: _zoneLabel,
38: _zoneLabel,
39: _zoneLabel,
40: _specialAlarm,
41: _zoneLabel,
42: _zoneLabel,
43: _zoneLabel,
44: _newTrouble,
45: _troubleRestored,
46: _moduleTrouble,
47: _moduleTroubleRestore,
48: _special,
49: _zoneLabel,
50: _zoneLabel,
51: _zoneLabel,
52: _zoneLabel,
53: _eventOpt1,
54: _eventOpt1,
55: _eventOpt1,
56: _eventOpt1,
57: _userLabel,
58: _zoneLabel,
59: _zoneLabel,
64: _systemStatus
}
_partitionLabel = {1: 'Partition 1',
2: 'Partition 2'
}
_busModuleLabel = {1: 'Bus Module 1',
2: 'Bus Module 2',
3: 'Bus Module 3',
4: 'Bus Module 4',
5: 'Bus Module 5',
6: 'Bus Module 6',
7: 'Bus Module 7',
8: 'Bus Module 8',
9: 'Bus Module 9',
10: 'Bus Module 10',
11: 'Bus Module 11',
12: 'Bus Module 12',
13: 'Bus Module 13',
14: 'Bus Module 14',
15: 'Bus Module 15'
}
_siteNameLabel = {1: 'Site Name'}
'''mapping of Label Types'''
labelTypeMap = {0: 'Zone Label',
1: 'User Label',
2: 'Partition Label',
3: 'PGM Label',
4: 'Bus Module Label',
5: 'Wireless Repeater Label',
6: 'Wireless Keypad Label'}
@staticmethod
def getEventGroupDescription(eg):
try:
return ParadoxMG5050EventMap.eventGroupMap[eg]
except KeyError:
print "No ParadoxMap for: eg=%d"%(eg)
return "-"
@staticmethod
def getSubEventGroupDescription(eg, seg):
try:
return ParadoxMG5050EventMap.subEventGroupMap[eg][seg]
except KeyError:
print "No ParadoxMap for: eg=%d \t seg=%d"%(eg,seg)
return "-"
@staticmethod
def getEventDescription(eg, seg):
try:
return ParadoxMG5050EventMap.eventGroupMap[eg], ParadoxMG5050EventMap.subEventGroupMap[eg][seg]
except KeyError:
print "No ParadoxMap for: eg=%d \t seg=%d" % (eg, seg)
return "-"
@staticmethod
def getLabelTypeDescription(lt):
return ParadoxMG5050EventMap.labelTypeMap[lt]
@staticmethod
def setzoneLabel(number, value):
ParadoxMG5050EventMap._zoneLabel.update({number: value})
return
@staticmethod
def getzoneLabel(number):
value = ParadoxMG5050EventMap._zoneLabel[number]
return value
@staticmethod
def getAllzoneLabel():
return ParadoxMG5050EventMap._zoneLabel
@staticmethod
def setuserLabel(number, value):
ParadoxMG5050EventMap._userLabel.update({number: value})
return
@staticmethod
def getAlluserLabel():
return ParadoxMG5050EventMap._userLabel
@staticmethod
def setpartitionLabel(number, value):
ParadoxMG5050EventMap._partitionLabel.update({number: value})
return
@staticmethod
def getAllpartitionLabel():
return ParadoxMG5050EventMap._partitionLabel
@staticmethod
def setbusModuleLabel(number, value):
ParadoxMG5050EventMap._busModuleLabel.update({number: value})
return
@staticmethod
def getbusModuleLabel(number):
value = ParadoxMG5050EventMap._busModuleLabel[number]
return value
@staticmethod
def getAllbusModuleLabel():
return ParadoxMG5050EventMap._busModuleLabel
@staticmethod
def setwirelessRepeaterLabel(number, value):
ParadoxMG5050EventMap._wirelessRepeater.update({number: value})
return
@staticmethod
def getwirelessRepeaterLabel(number):
value = ParadoxMG5050EventMap._wirelessRepeater[number]
return value
@staticmethod
def getAllwirelessRepeaterLabel():
return ParadoxMG5050EventMap._wirelessRepeater
@staticmethod
def setwirelessKeypadLabel(number, value):
ParadoxMG5050EventMap._wirelessKeypad.update({number: value})
return
@staticmethod
def getwirelessKeypadLabel(number):
value = ParadoxMG5050EventMap._wirelessKeypad[number]
return value
@staticmethod
def getAllwirelessKeypadLabel():
return ParadoxMG5050EventMap._wirelessKeypad
@staticmethod
def setsiteNameLabel(number, value):
ParadoxMG5050EventMap._siteNameLabel.update({number: value})
return
@staticmethod
def getsiteNameLabel(number):
value = ParadoxMG5050EventMap._siteNameLabel[number]
return value
@staticmethod
def getAllsiteNameLabel():
return ParadoxMG5050EventMap._siteNameLabel
@staticmethod
def setwirelessSirenLabel(number, value):
ParadoxMG5050EventMap._wirelessSiren.update({number: value})
return
@staticmethod
def getwirelessSirenLabel(number):
value = ParadoxMG5050EventMap._wirelessSiren[number]
return value
@staticmethod
def getAllwirelessSirenLabel():
return ParadoxMG5050EventMap._wirelessSiren
@staticmethod
def setoutputLabel(number, value):
ParadoxMG5050EventMap._outputLabel.update({number: value})
return
@staticmethod
def getoutputLabel(number):
value = ParadoxMG5050EventMap._outputLabel[number]
return value
@staticmethod
def getAlloutputLabel():
return ParadoxMG5050EventMap._outputLabel
if __name__ == '__main__':
print "Loaded Paradox Mapping"
#print ParadoxEventMap.getEventGroupDescription(0)
#print ParadoxEventMap.getSubEventGroupDescription(1,22)
#print ParadoxEventMap.getEventDescription(34,2)