-
Notifications
You must be signed in to change notification settings - Fork 6
/
VistaAlarm.yaml
546 lines (454 loc) · 14.5 KB
/
VistaAlarm.yaml
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
#for documentation see project at https://github.com/Dilbert66/esphome-VistaECP
substitutions:
name: "vistaalarm" #unique network name, system name
friendlyName: "Vista Alarm" #used as the friendly name of your application in HomeAssistant
panelId: "VistaAlarm" #used as the service variable name.
vista_alarm_panel:
id: $panelId
accesscode: !secret access_code #Only comes into effect if needed for arming and quickarm is not set
maxzones: "48" #maximum amount of zones that your panel supports
maxpartitions: "1" #maximum amount of partitions that your panel supports
# Enroll your RF serial devices here. Format: serial#:loop#:zone# Each record is comma separated.
# For most devices loop1 is used such as 5800pir, other devices such as 5816 will use loop2. Please refer to your
# RF device programming (*56 program) to see what loop and zones are assigned to your RF devices.
# You can refer to the pdf link below for more details on loop numbers
# https://advancedsecurityllc.com/wp-content/uploads/5800%20Wireless%20Device%20List.pdf
rfseriallookup: "0019994:2:66,0818433:4:22,0123456:1:55,0399512:1:17" # serial1:loop#:zone1,serial2:loop#:zone2
defaultpartition: "1" #set to your main partition
vistadebuglevel: "3" #component debug level for messages
#assign a new virtual keypad address to each active partition using programs *190 - *196
#and enter it below. For unused partitions, use 0 as the keypad address.
keypadaddr1: "17" #partition 1 virtual keyapd
keypadaddr2: "0" #partition 2 virtual keypad. set to 0 to disable
keypadaddr3: "0" #partition 3 virtual keypad. set to 0 to disable
##esp32
rxpin: "22" #GPIO pin to use for data receive (yellow line)
txpin: "21" #GPIO pin to use for data transmit (green line)
monitorpin: "18" #GPIO pin to use for monitoring module traffic such as RF or Expanders . Set to -1 to disable
##esp8266
#rxpin: "5" #GPIO pin to use for data receive (yellow line)
#txpin: "4" #GPIO pin to use for data transmit (green line)
#monitorpin: "14" #GPIO pin to use for monitoring module traffic such as RF or Expanders . Set to -1 to disable
#note for the vista128 and vista250, the expanderaddr and relayaddr addresses must be 0
# module addresses:
# 07 4229 zone expander zones 9-16
# 08 4229 zone expander zones 17-24
# 09 4229 zone expander zones 25-32
# 10 4229 zone expander zones 33-40
# 11 4229 zone expander zones 41 48
# 12 4204 relay module
# 13 4204 relay module
# 14 4204 relay module
# 15 4204 relay module
expanderaddr1: "0" # 1st zone expander emulator (4229) address to use . Set to 0 to disable.
expanderaddr2: "0" # 2nd expander emulator address to use . Set to 0 to disable.
relayaddr1: "0" # relay module emulation (4204) addresses. Set to 0 to disable
relayaddr2: "0"
relayaddr3: "0"
relayaddr4: "0"
ttl: "30000" # time to live in ms for zone/fire status before expiring;
quickarm: "false"
lrrsupervisor: "false" # set to true if we don't have an LRR monitoring supervisor we can emulate one to get the statuses
clean_build: "false" #default is false. only set to true if getting duplication errors in linking step. Once you compile, reset it back to false.
esp32:
board: nodemcu-32s
framework:
type: arduino
version: recommended
#esp8266:
#board: nodemcuv2
#framework:
#version: recommended
#location of alarm panel code. You can use the github release version or
#copy the code to directory "my_components" in your main esphome directory
# see here for more info: https://esphome.io/components/external_components
external_components:
- source: github://Dilbert66/esphome-components@main #uncomment to use github repository
#- source: my_components #uncomment to use local directory
components: [vista_alarm_panel,binary_sensor,text_sensor]
refresh: 10min
#you can remove/disable this section if you don't want your panel time updated automatically.
#interval:
#- interval: 7200s
# then:
# - lambda: |-
# $panelId->set_panel_time();
esphome:
name: $name
friendly_name: $friendlyName
#Example of how to set the panel time from the esp time on bootup
#on_boot:
#priority: 600
#then:
#- lambda: |-
# $panelId->set_panel_time();
# output sympols to output.map for debugging. you can remove if not needed
platformio_options:
build_flags:
- "-Wl,-Map,output.map"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "$name"
password: !secret wifi_password
logger:
baud_rate: 115200
level: debug
api:
encryption:
key: !secret encryption_key
#to use mqtt disable the api: section above. This enables you to use esphome with
#non homeassistant systems
#modify the mqtt section to your needs
#See: https://esphome.io/components/mqtt.html
#mqtt:
#broker: 192.168.2.175
#port: 1883
#username: mqttuser
#password: mqttuser
#discovery_prefix: "homeassistant"
#topic_prefix: $name
safe_mode:
ota:
password: !secret ota_password
platform: esphome
#on_begin: #disabled due to bug in esphome
#switch.turn_off: connection_status_switch
time:
- platform: sntp
########################################################################
# Edit binary and text sensors below to suit your alarm setup.
# You can safely add or remove any sensor as needed.
# The id code is entered using the "id_code:" tag. Alternatively you can
# add the id code in round brackets at the end of the sensor name: eg. (z1)
binary_sensor:
### zone sensors ###
# open/close status for each zone
# zone id code = z+zone number
- platform: template
name: "Front door (z1)"
device_class: door
id_code: z1
publish_initial_state: true
- platform: template
id_code: z2
name: "Garage door (z2)"
device_class: door
publish_initial_state: true
- platform: template
name: "Back door (z3)"
id_code: z3
device_class: door
publish_initial_state: true
- platform: template
id_code: z4
name: "Living room window (z4)"
device_class: window
publish_initial_state: true
- platform: template
id_code: z5
name: "Dining room window (z5)"
device_class: window
publish_initial_state: true
- platform: template
id_code: z6
name: "Family room window LF (z6)"
device_class: window
publish_initial_state: true
- platform: template
id_code: z7
name: "Family room window RF (z7)"
device_class: window
publish_initial_state: true
- platform: template
id_code: z8
name: "Basement windows (z8)"
device_class: window
publish_initial_state: true
- platform: template
id_code: z10
name: "Basement windows (z10)"
device_class: window
publish_initial_state: true
- platform: template
id_code: z17
name: "zone 17 (z17)"
device_class: window
publish_initial_state: true
# you can also add fields to show fault statuses of other devices you have. The id will be 1 + device address.
#relay addresses are 12/13/14/15
- platform: template
id_code: z112
name: "check relay 12 (z112)"
device_class: problem
publish_initial_state: true
#zone expander device addresses are 07/08/09/10/11
- platform: template
id_code: z108
name: "check expander 08 (z108)"
device_class: problem
publish_initial_state: true
#comm device address such as Alarmnet/LRR is 03
- platform: template
id_code: z103
name: "check comm device (z103)"
device_class: problem
publish_initial_state: true
### non zone sensors ###
# partition ready status
# ready id code = rdy_ + partition number
- platform: template
id_code: rdy_1
name: "Ready (rdy_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: rdy_2
name: "Ready (rdy_2)"
publish_initial_state: true
# partition/panel trouble status
# trouble id code = trbl_ + partition number
- platform: template
id_code: trbl_1
name: "Trouble (trbl_1)"
device_class: problem
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: trbl_2
name: "Trouble (trbl_2)"
device_class: problem
publish_initial_state: true
# bypass zones active status
# bypass id code = byp_ + partition number
- platform: template
id_code: byp_1
name: "Bypass (byp_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: byp_2
name: "Bypass (byp_2)"
publish_initial_state: true
# armed away status
# armed away id code = arma_ + partition number
- platform: template
name: "Away (arma_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: arma_2
name: "Away (arma_2)"
publish_initial_state: true
# armed status
# armed id code = arm_ + partition number
- platform: template
id_code: arm_1
name: "Armed (arm_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: arma_1
name: "Armed (arm_2)"
publish_initial_state: true
# armed stay status
# armed stay id code = arms_ + partition number
- platform: template
id_code: arms_1
name: "Stay (arms_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: arms_2
name: "Stay (arms_2)"
publish_initial_state: true
# armed instant status
# armed instant id code = armi_ + partition number
- platform: template
id_code: armi_1
name: "Instant (armi_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: armi_2
name: "Instant (armi_2)"
publish_initial_state: true
# armed night status
# armed night id code = armn_ + partition number
- platform: template
id_code: armn_1
name: "Night (armn_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: armi_2
name: "Instant (armi_2)"
publish_initial_state: true
# ac status
# ac id code = (ac)
- platform: template
id_code: ac
name: "AC (ac)"
device_class: plug
publish_initial_state: true
# chime status
# chime id code = chm_ + partition number
- platform: template
id_code: chm_1
name: "Chime (chm_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: chm_2
name: "Chime (chm_2)"
publish_initial_state: true
# alarm status
# alarm id code = alm_ + partition number
- platform: template
id_code: alm_1
name: "Alarm (alm_1)"
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: alm_2
name: "Alarm (alm_2)"
publish_initial_state: true
# battery status
# battery id code = bat
- platform: template
id_code: bat
name: "Battery (bat)"
device_class: problem
publish_initial_state: true
# fire alarm status
# fire alarm id code = fire_ + partition number
- platform: template
id_code: fire_1
name: "Fire (fire_1)"
device_class: smoke
publish_initial_state: true
#Partition 2 example
- platform: template
id_code: fire_2
name: "Fire (fire_2)"
device_class: smoke
publish_initial_state: true
# relay status
# relay id code = r + address + channel
- platform: template
id_code: r121
name: "Relay1 (r121)"
publish_initial_state: true
- platform: template
id_code: r122
name: "Relay2 (r122)"
publish_initial_state: true
#### text sensors ####
text_sensor:
#alternative zone status as a text sensor. Values: O=open, B=bypass,T=trbl or check,A=alarm
# zone id code = z+zone number
- platform: template
name: "Front door zone (z1)"
id_code: z1s messages
# system status messages
# system status id code = ss_ + partition number
- platform: template
id_code: ss_1
name: "System Status (ss_1)"
icon: "mdi:shield"
#Partition 2 example
- platform: template
id_code: ss_2
name: "System Status (ss_2)"
icon: "mdi:shield"
# long range radio messages
# lrr id code = lrr
- platform: template
id_code: lrr
name: "Lrr Msg (lrr)"
icon: "mdi:alert-box"
# RF zone messages
# RF id code = rf
- platform: template
id_code: rf
name: "RF Msg (rf)"
icon: "mdi:alert-box"
# virtual lcd keypad line1 and line2 messages for each partition
# partition line1 id code = ln1_ + partition number
# partition line2 id code = ln2_ + partition number
# partition 1
- platform: template
name: "Line1 (ln1_1)"
id_code: ln1_1
- platform: template
name: "Line2 (ln2_1)"
id_code: ln2_1
# partition 2
- platform: template
name: "Line1 (ln1_2)"
id_code: ln1_2
- platform: template
name: "Line2 (ln2_2)"
id_code: ln2_2
# partition 3
- platform: template
name: "Line1 (ln1_3)"
id_code: ln1_3
- platform: template
name: "Line2 (ln2_3)"
id_code: ln2_3
# zone status messages bypas/open/alarm
# zone status id code = zs
- platform: template
name: "Zone Status (zs)"
id_code: zs
# system beeps
# beeps id code = bp_ + partition number
- platform: template
name: "Beeps (bp_1)"
id_code: bp_1
#Partition 2 example
- platform: template
name: "Beeps (bp_2)"
id_code: bp_2
#- platform: gpio #example use of pin d8 as a zone trigger port for the emulated zone expander
# pin: D8
# id: pind8
# device_class: window
# on_press: #zone,on/off
# - lambda: |-
# vista.setExpFault(17,1);
# on_release:
# - lambda: |-
# vista.setExpFault(17,0);
# end of panel sensor setup - no need to edit anything below.
##############################################################################
switch:
- platform: template
name: "$name Connection"
id: connection_status_switch
lambda: |-
return vista.keybusConnected;
icon: "mdi:shield-link-variant"
turn_on_action:
- switch.toggle: restart_switch
turn_off_action:
- lambda: |-
disconnectVista();
- platform: restart
id: restart_switch
- platform: safe_mode
name: "Safe Mode"
debug:
update_interval: 300s
sensor:
- platform: debug
free:
name: "Heap Free"
block:
name: "Heap Max Block"
loop_time:
name: "Loop Time"
#fragmentation: #esp8266 only
# name: "Heap Fragmentation"