-
Notifications
You must be signed in to change notification settings - Fork 8
/
ad2iot.ini
521 lines (459 loc) · 18.1 KB
/
ad2iot.ini
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
###############################################################################
# AlarmDecoder IoT configuration file - ad2iot.ini
#
# requires AD2IoT firmware v1.1.0 or later.
#
# Place this file in the root folder of the uSD card formatted with a fat32
# partition and restart the device to load the config. If the file is not found
# or the file can not be loaded the firmware will revert back to internal
# configuration storage. Use the ftpd component to upload changes and restart
# the device remotely from trusted systems.
#
###############################################################################
###############################################################################
# Usage: ad2source [(<mode> <arg>)]
# Manage AlarmDecoder protocol source
#
# Options:
# mode Mode [S]ocket or [C]om port
# arg arg string
# for COM use <TXPIN:RXPIN>
# for SOCKET use <HOST:PORT>
# Examples:
# Set source to ser2sock client at address and port.
# ```ad2source SOCK 192.168.1.2:10000```
# Set source to local attached uart with TX on GPIO 4 and RX on GPIO 36.
# ```ad2source COM 4:36```
###############################################################################
ad2source = C 4:36
###############################################################################
# Usage: ad2config [<configString>]
# Configuration tool for AlarmDecoder hardware settings.
#
# Options:
# configString Name Value config string for the AlarmDecoder
# device. Can be partial config.
# Example set mode Ademco with default address 18.
# ```ad2config mode=A&address=18```
###############################################################################
ad2config = address=18&mode=A
###############################################################################
# Usage: netmode [(N | W | E)] [<arg>]
#
# Configuration tool for ad2iot network settings
#
# Options:
# N Disable(default) networking and allow
# a component to take over networking
# W Enable WiFi core driver
# E Enable Ethernet core driver
# arg Config string to pass to network driver
# Argument string name value pairs sepearted by &.
# Keys: mode,ip,mask,gw,dns1,dns2,sid,password
# Examples:
# WiFi DHCP with SID and password.
# ```netmode W mode=d&sid=example&password=somethingsecret```
# Ethernet DHCP DNS2 override.
# ```netmode E mode=d&dns2=4.2.2.2```
# Ethernet Static IPv4 address.
# ```netmode E mode=s&ip=192.168.1.111&mask=255.255.255.0&gw=192.168.1.1&dns1=4.2.2.2&dns2=8.8.8.8```
###############################################################################
netmode = E mode=d
###############################################################################
# Usage: logmode [<mode>]
# Configuration tool for the ad2iot firmware log settings
#
# Modes:
# I Informational
# V Verbose
# D Debugging
# N Warnings and errors only(default)
###############################################################################
logmode = I
###############################################################################
# Usage: code <codeId> [- | <value>]
# Configuration tool for alarm system codes
#
#
# Options:
# codeId Code ID 1 - 128
# - Delete entry
# value Code string
###############################################################################
[code]
1 = 4112
2 = 1234
###############################################################################
# Usage: partition [(<partId> <address>) [zoneList]]
# Configuration tool for alarm panel partitions
#
# The AD2IoT and the attached AD2pHAT need information about the alarm system
# to function properly. This currently requires some redundent configuration.
#
# Use the ad2term command to connect to the AD2pHat and configure the firmware
# using the '!' or 'C' command.
#
# Set the MODE to DSC or Ademco and configure the devices primary address.
#
# For Ademco Vista panels:
# * This address must be programmed into the panel as an alpha keypad for
# each partition being managed.
# * It must not be used by any other devices.
# For DSC Power Series:
# * Use partition #1-8 and set the partition. no panel programming is needed.
#
# Options:
# partId Partition ID 1-8
# address For DSC 1-8 for Ademco use available keypad address.
# Use - to remove partition
# zoneList Optional Comma separated zone list for this partition
# Examples:
# Set default address mask to 18 for an Ademco system with zones 2, 3, and 4.
# ```partition 1 18 2,3,4```
# Set default send partition Id to 1 for a DSC system.
# ```partition 2 1```
# Show address for partition Id 2.
# ```partition 2```
# Remove partition Id 2.
# ```partition 2 -```
# Note: address - will remove an entry.
###############################################################################
[partition 1]
# Default partition.
address = 18
zones = 2,3,4,5,6,24,25,26
#[partition 2]
## Second partition.
#address = 23
#zones = 7,27
###############################################################################
# Usage: zone <zoneId> [- | <value>]
# Configuration tool for zone json description strings
#
# Options:
# zoneId Zone ID 1 - 255
# - Delete entry
# value json string with type and alpha attributes
# {"type": "smoke", "alpha": "TESTING LAB SMOKE"}
###############################################################################
[zone 2]
description = {"type": "door", "alpha": "Front Door"}
[zone 3]
description = {"type": "door", "alpha": "Den Door"}
[zone 4]
description = {"type": "door", "alpha": "Back Door"}
[zone 24]
description = {"type": "carbon_monoxide", "alpha": "Test CO2 ZONE"}
[zone 26]
description = {"type": "door", "alpha": "test door"}
[zone 191]
description = {"type": "problem", "alpha": "Long Range Radio trouble(bF)"}
[zone 202]
description = {"type": "problem", "alpha": "Alarm Cancel(CA)"}
[zone 204]
description = {"type": "problem", "alpha": "COM Downloading(CC)"}
[zone 209]
description = {"type": "problem", "alpha": "Programming Mode(D1)"}
[zone 234]
description = {"type": "problem", "alpha": "Exit Alarm(EA)"}
[zone 252]
description = {"type": "problem", "alpha": "Failed to call(FC)"}
###############################################################################
# Usage: switch <swid> [command] [<arg>]
#
# Configuration tool for ad2iot virtual switches
#
# This tool allows configuring ad2iot virtual switch that will change
# state based upon one more more filters and REGEX pattern matches.
# Up to 8 REGEX patterns for OPEN, CLOSE, and TROUBLE can be defined
# for complex state matching capabilities.
#
# Commands:
# delete | - Clear switch settings
# default STATE Default STATE [0]CLOSE(OFF) [1]OPEN(ON) [-1]UNKNOWN
# reset TIME Auto rest TIME in ms 0 to disable
# types TYPE, TYPE,... Message type filter list or blank to disable
# filter REGEX Pre filter REGEX or blank to disable
# open IDX REGEX OPEN event REGEX filter for IDX 1-8
# close IDX REGEX CLOSE event REGEX filter for IDX 1-8
# trouble IDX REGEX TROUBLE event REGEX filter for IDX 1-8
# Options:
# switchId ad2iot virtual switch ID 1-255
# IDX REGEX index 1-8 for multiple tests
# REGEX Regular expression or exact match string.
# TYPE Message types [ALPHA,LRR,REL,EXP,RFX,AUI,KPM,KPE,
# CRC,VER,ERR,EVENT]
###############################################################################
[switch 60]
# RFX serial 0123456
default = -1
reset = 0
types = RFX
filter = !RFX:0123456,.*
open 1 = !RFX:0123456,1.......
close 1 = !RFX:0123456,0.......
trouble 1 = !RFX:0123456,......1.
[switch 91]
# AC switch
default = -1
reset = 0
types = EVENT
open 1 = POWER BATTERY
close 1 = POWER AC
[switch 95]
# Fire switch
default = -1
reset = 0
types = EVENT
open 1 = FIRE ON
close 1 = FIRE OFF
[switch 99]
# Alarm Active switch
default = -1
reset = 0
types = EVENT
open 1 = ALARM ON
close 1 = ALARM OFF
[switch 100]
# Generic ARMED/DISARMED switch
default = -1
reset = 0
types = EVENT
open 1 = ^ARMED.*
close 1 = ^DISARMED.*
[switch 103]
# User #3 Armed/Disarmed switch using LRR/Contact ID reporting.
# Using existing communicator or AD2* LRR Emulation. DSC by default
# will have LRR messages enabled with Zero Conf. Ademco must be enabled
# using programming field (*29) and report codes fields (*59–*68)
default = -1
reset = 1
types = LRR
open 1 = !LRR:003,1,CID_34[0,4]1,ff
close 1 = !LRR:003,1,CID_14[0,4]1,ff
###############################################################################
# Usage: mqtt (enable|url|commands|tprefix|dprefix) [<arg>]
# Usage: mqtt switch <swid> [delete|-|open|close|trouble] [<arg>]
#
# Configuration tool for MQTT notification
# Commands:
# enable [Y|N] Component enable flag
# url [url] MQTT URL string
# commands [Y|N] Remote command enable flag
# tprefix [path] Topic prefix
# dprefix [path] Discovery prefix
# switch swid SCMD [ARG] Configure virtual switches
# Sub-Commands:
# delete | - Clear switch notification settings
# description <jsonStr> Send JSON description string for discovery
# open <message> Send <message> for OPEN events
# close <message> Send <message> for CLOSE events
# trouble <message> Send <message> for TROUBLE events
# Options:
# swid ad2iot virtual switch ID 1-255.
# See ```switch``` command
# message Message to send for this notification
# jsonStr ex. {"name": "foo", "type":"door", "value_template": "{{value_json.state}"}
###############################################################################
[mqtt]
## Enable / Disable true or false
enable = false
## Security warning: Allows remote control with no authentication.
## Only use on trusted private MQTT servers when access can be controlled.
commands = false
## Prefix all publish topics with this string.
tprefix = homeassistant
## Publish discovery topics in this url prefix.
dprefix = homeassistant
## MQTT Server URL with optinal USER:PASS
url = mqtt://user:pass@testmqtt.example.com/
## virtual switch configuration
## command: switch N subkey value
## subkey [description]
## json string with required name, type, and value_template values.
## name: The device alpha descriptive name.
## type: The device type.
## value_template: Template used for device auto discovery.
## subkey [open | close | trouble]
## The messages output VALUE using the template {"state": "VALUE"}
switch 60 description = <<<END_OF_TEXT
{
"name": "5800 Micra SN:0041594",
"type": "door",
"value_template": "{{value_json.state}}"
}
END_OF_TEXT
switch 60 open = ON
switch 60 close = OFF
switch 60 trouble = ON
###############################################################################
# Usage: ftpd <command> [arg]
#
# Configuration tool for FTP server
# Commands:
# enable [Y|N] Set or get enable flag
# acl [aclString|-] Set or get ACL CIDR CSV list
# use - to delete
# Examples:
# ```ftpd enable Y```
# ```ftpd acl 192.168.0.0/28,192.168.1.0-192.168.1.10,192.168.3.4```
###############################################################################
[ftpd]
## Enable / Disable true or false
enable = true
## Access control list
acl = 192.168.0.0/16, 10.10.0.0/16
###############################################################################
# Usage: webui <command> [arg]
#
# Configuration tool for FTP server
# Commands:
# enable [Y|N] Set or get enable flag
# acl [aclString|-] Set or get ACL CIDR CSV list
# use - to delete
# Examples:
# ```webui enable Y```
# ```webui acl 192.168.0.0/28,192.168.1.0-192.168.1.10,192.168.3.4```
###############################################################################
[webui]
## Enable / Disable true or false
enable = true
## Access control list
acl = 192.168.0.0/16, 10.10.0.0/16
###############################################################################
# Usage: ser2sockd <command> [arg]
#
# Configuration tool for ser2sock server
# Commands:
# enable [Y|N] Set or get enable flag
# acl [aclString|-] Set or get ACL CIDR CSV list use - to delete
# Examples:
# ```ser2sockd enable Y```
# ```ser2sockd acl 192.168.0.0/28,192.168.1.0-192.168.1.10,192.168.3.4```
###############################################################################
[ser2sockd]
## Enable / Disable true or false
enable = false
## Access control list
## Lock ser2sock down to specific systems. Internal security scanning can
## trigger alarms if connecting to port 10000
acl = 192.168.1.100
###############################################################################
# Usage: pushover (apptoken|userkey) <acid> [<arg>]
# Usage: pushover switch <swid> [delete|-|notify|open|close|trouble] [<arg>]
#
# Configuration tool for Pushover.net notification
# Commands:
# apptoken acid [hash] Application token/key HASH
# userkey acid [hash] User Auth Token HASH
# switch swid SCMD [ARG] Configure virtual switches
# Sub-Commands:
# delete | - Clear switch notification settings
# notify <acid>,... List of accounts [1-8] to use for notification
# open <message> Send <message> for OPEN events
# close <message> Send <message> for CLOSE events
# trouble <message> Send <message> for TROUBLE events
# Options:
# acid Account storage location 1-8
# swid ad2iot virtual switch ID 1-255.
# See ```switch``` command
# message Message to send for this notification
###############################################################################
[pushover]
## Pushover account keys 1-8. Select account by its ID 1-8 in switch settings.
apptoken 1 = aabbccddeeffAABBCCDEEFF
userkey 1 = aabbccddeeffAABBCCDEEFF
apptoken 2 = aabbccddeeffAABBCCDEEFF
userkey 2 = aabbccddeeffAABBCCDEEFF
## enabled notification switches and PUSHOVER specific settings
## To connect a [SWITCH NNN] to notification specify the account and settings
## for each switch used. Prefix each switch with ```switch N``` where N is the switch ID.
switch 60 notify = 1
switch 60 open = SWITCH 1 OPEN
switch 60 close = SWITCH 1 CLOSE
switch 60 trouble = SWITCH 1 TROUBLE
switch 95 notify = 1
switch 95 open = FIRE ON
switch 95 close = FIRE OFF
switch 95 trouble = FIRE TROUBLE
switch 99 notify = 1
switch 99 open = ALARM ACTIVE
switch 99 close = ALARM CLEAR
switch 103 notify = 1
switch 103 open = ARMED USER 3
switch 103 close = DISARMED USER 3
###############################################################################
# Usage: twilio (disable|sid|token|from|to|type|format) <acid> [<arg>]
# Usage: twilio switch <swid> [delete|-|notify|open|close|trouble] [<arg>]
#
# Configuration tool for Twilio + SendGrid notifications
# Commands:
# disable acid [Y|N] Disable notification account(acid)
# sid acid [hash] Twilio String Identifider(SID)
# token acid [hash] Twilio Auth Token
# from acid [address] Validated Email or Phone #
# to acid [address] Email or Phone #
# type acid [M|C|E] Notification type Mail, Call, EMail
# format acid [format] Output format string
# switch swid SCMD [ARG] Configure switches
# Sub-Commands:
# delete | - Clear switch notification settings
# notify <acid>,... List of accounts [1-999] to use for notification
# open <message> Send <message> for OPEN events
# close <message> Send <message> for CLOSE events
# trouble <message> Send <message> for TROUBLE events
# Options:
# acid Account storage location 1-999
# swid ad2iot virtual switch ID 1-255.
# See ```switch``` command
# message Message to send for this notification
# address EMail or Phone # depending on type
# format Template format string
###############################################################################
[twilio]
## Account settting N 1-8
### Example sendgrid email
sid 1 = NA
token 1 = aabbccdd112233..
from 1 = from@example.com
to 1 = to@example.com
type 1 = E
format 1 = {}
### Example Twilio SMS
sid 2 = aabbccdd112233..
token 2 = aabbccdd112233..
from 2 = NXXXYYYZZZZ
to 2 = NXXXYYYZZZZ
type 2 = M
format 2 = {}
### Example Twilio Call
sid 3 = aabbccdd112233..
token 3 = aabbccdd112233..
from 3 = NXXXYYYZZZZ
to 3 = NXXXYYYZZZZ
type 3 = C
format 3 = <<<END_OF_TEXT
<Response>
<Pause length="3"/><Say>{0}</Say><Pause length="3"/>
<Say>{0}</Say><Pause length="3"/><Say>{0}</Say></Response>
END_OF_TEXT
# Notify SOS Call, SMS, EMail EVERYONE!
switch 95 notify = 1,2,3
switch 95 open = FIRE ALARM
switch 95 close = FIRE CLEAR
# Notify SOS Call, SMS, EMail EVERYONE!
switch 99 notify = 1,2,3
switch 99 open = ALARM ACTIVE
switch 99 close = ALARM CLEAR
# Notify POWER STATUS EMail+SMS
switch 2 notify = 1,2
switch 2 open = ON MAIN AC POWER
switch 2 close = ON BATTERY BACKUP POWER
# Notify generic ARMED/DISARMED
switch 100 notify = 1,2
switch 100 open = ALARM ARMED
switch 100 close = ALARM DISARMED
# Notify ARM/DISARM USER #3 on LRR/CID report but not both.
#switch 103 notify = 1,2
#switch 103 open = ARMED USER 3
#switch 103 close = DISARMED USER 3