At the time of writing this document (06-06-2025) we have two integrations with Alarm.com. They are the "XML" integration and the "API" integration. I'm writing this document to describe how the flow of data differs from one implementation to the other in the hope that it'll assist in troubleshooting. I will not be writing in detail about the "how" the modules get implemented. I'll only include relevant information of the "how" to better get the point across (and also because I don't fully know how it is setup myself).
XML
When setting up the XML driver in SPA, it'll use driver ID 38. The IP Address will be a loopback address (127.0.0.1) and you can set the port that you want to use for it (in this case I'll use 1040 as an example). Once it's setup and running, when the alarm comes from the receiver and sends a signal to SPA via XML you should see SPA process the alarm like you normally would with any other regular signal from a receiver. What I mean by this is that you will have a "Receive" Line (the raw data we got from the receiver), a "Processing" Line (the data that SPA parsed), and a "Transmit" Line (sometimes we send an ACK package back to the receiver to let it know we successfully got the package) in the SPA log file indicated by the preceding R, P, or T respectively.
Example:
R 05/29/2025 17:07:49.328 IP.26:40004 [LF]<?xml version="1.0"?><Signals Ver="1.0.0"><SignalCount>1</SignalCount><Sequence>10000</Sequence><Signal><LN>01</LN><ACC>8888</ACC><SI>BD</SI><PZ>102</PZ><A>1</A><VF>\\172.26.1.26\servidor\dvr_674\2025-05-29\prevideo_20250529-170724-506_canal_2.avi</VF><DT>2025-05-29</DT><TM>17:07:48</TM></Signal></Signals><Checksum>3F7D</Checksum>[CR]
D 05/29/2025 17:07:49.438 AlarmSignal.pas:1356 (AlarmSignal.InsertAlarmAutoInc) "Storing priority 1 BD alarm into AlarmStack"
P 05/29/2025 17:07:49.458 EM(), PS(***********************************), AS(IS=[LF]<?xml version="1.0"?><Signals Ver="1.0.0"><SignalCount>1</SignalCount><Sequence>10000</Sequence><Signal><LN>01</LN><ACC>8888</ACC><SI>BD</SI><PZ>102</PZ><A>1</A><VF>\\172.26.1.26\servidor\dvr_674\2025-05-29\prevideo_20250529-170724-506_canal_2.avi</VF, RN=, LN=01, AN=8888, A=1, CSID=8888, SI=BD, PZ=102, HD=, OD=Original CSID = 8888DAHUA, CID=, UN=, DT=29/05/25 17:07:48, AC=134, OCTAR=A, ID=0, SN='Pruebas De Tecalsa', SID=10, OnTest=F, OffLine=F, VSignal=T, VSubs=T, OldSub=F, EvntId=0, EvntEx=, ForceVerify=F, CZS=Null, CZP=296480, PZS=27883, PZP=Null, ActiveS=T, ActiveA=T, OCSup=T, VideoFile=\\172.26.1.26\servidor\dvr_674\2025-05-29\prevideo_20250529-170724-506_canal_2.avi, VPL={ACCOUNT}dahua, NewArea=F, 2WayVoice=, HID.HIDSystemID=0, HID.HIDExtentionID=0, HID.DoorID=0, HID.CardID=0, HID.Data=, RedirectCount=0, SignalExempt=F, ZoneName=, GeoInfo=0,0,0, DataOnly=F,, AutomatedUsers='ASP1','AAP1',, AlarmQueueID=0) - Completed. AlarmStackID = 287240010 (Per:141), Task Step - ***********************************
T 05/29/2025 17:07:49.458 IP.26:40004 [CR]<Response><Sequence>10000</Sequence><Status>ACK</Status></Response><Checksum>F270</Checksum>[LF]
API
This is where some of the specific implementation details get's hazy. But the important piece to know is that once the signal comes from the receiver and hits the API, our API will drop the signal/data into the dba.alarmqueue table. This job is specifically done by a stored procedure (dba.mncAlarmQueueInsert). SPA picks up the alarm from the alarm queue table and processes it. What this means is that in the SPA log file, you will see the "Processing" Line for the package, but there will be no "Receive" or "Transmit" line. Unfortunately there is also no specific unique identifier to specify that the package came from the API (unlike with XML and other signals parsed by SPA, you can see where the signal came from based on the last octet of the IP address and Port. An example would be IP.26:40004 from the above package where 26 is the last part of the IP Address and 40004 is the port number).
Development
Development gave me a code snippet to add to the procedure dba.mncAlarmQueueInsert. You can create a backup of the procedure and then add this snippet:
exec dba.MKSSysLogCreate @User, @signal, 'API-ADC', 'IntegrationAPI', 0
Which will add the package to syslog. The script itself with the snippet added will look something like this:
CREATE PROCEDURE dba.mncAlarmQueueInsert (@User varchar(80), @Signal long varchar, @Utc bit = 0) AS
DECLARE
@id int
exec dba.MKSSysLogCreate @User, @signal, 'API-ADC', 'IntegrationAPI', 0
INSERT INTO DBA.AlarmQueue(
SystemAlarm,
CSID,