@synapsestudios/securecom v1.5.0-rc.21
node-securecom
A Node SDK for DMP's device management API
Install
npm i -S @synapsestudios/securecom
Usage
const SecureCom = require('securecom');
const client = new SecureCom({ token: '#-##################' });
client.controlSystems.get(100000)
.then(system => console.log(system));
API
Control Systems
controlSystems.get(id)
Gets a single control system where:
id
is a Control System ID
controlSystems.getSkeleton(customerId)
Gets a skeleton object for creating a new control system where:
customerId
is a Customer ID
controlSystems.create(customerId, payload)
Creates a new control system where:
customerId
is a Customer IDpayload
is the object returned fromgetSkeleton
with the necessary values updated, likely the following:customer_id
- the Customer IDname
- a name for the panelpanels_attributes[0].name
- a name for the panelpanels_attributes[0].hardware_model
- one ofXTL
,XTLP
,XTLT
,XT30
,XT50
,XR500
,XR150
,XR550
,CellComSL
,iComSL
,DualCom
,iComLNC
,Video Only
panels_attributes[0].account_number
- an integer from 1-65535panels_attributes[0].serial_number
- the panel serial numberpanels_attributes[0].comm_type
- one ofpersistent
,persistent_w_cell_backup
,cell
,network
panels_attributes[0].comm_address
- a string representing the phone number of the installed SIM card, or nullpanels_attributes[0].sim_identifier
- a string representing the SIM number of the installed SIM card
controlSystems.update(customerId, controlSystemId, payload)
Updates a single control system where:
customerId
is a Customer IDcontrolSystemId
is a Control System IDpayload
is the object returned fromget
with the necessary values updated
controlSystems.delete(id)
Deletes a single control system where:
id
is a Control System ID
Customers
customers.get(id)
Gets a single customer where:
id
is a Customer ID
customers.getControlSystems(id, page, pageSize)
Gets a single customer's control systems where:
id
is a Customer IDpage
is the page of results to fetch, default1
pageSize
is the number of results to fetch, default25
max100
customers.getDealer(id)
Gets the dealer for a single customer where:
id
is a Customer ID
Dealers
dealers.getAllCustomers(dealerId, page, pageSize)
Gets all customers for a Dealer
dealerId
is a Dealer IDpage
is the page of results to fetch, default1
pageSize
is the number of results to fetch, default25
max100
Jobs
jobs.getStatus(id)
Get the status of a job where:
id
is a Job ID
Panels
panels.arm(panelId, payload)
Arms the panel where:
panelId
is a Panel IDpayload
is an object with any of the following keys:areas
- a string in the format"1,2,3"
indicating which areas should be armed. iCom panels support zones 1-3, XR550 panels support areas 1-32. XR350 panels support areas 1-16. XR150 panels support areas 1-8. XT30 panels support areas 1-6. Typically, 1 represents Perimeter, 2 represents Interior, and 3 represents Bedrooms.bad_zones
- one offorce
(any faulted zones will be armed as soon as fault clears),bypass
(faulted zones will not be armed), orrefuse
(faulted zones will cause arming to fail)
panels.disarm(panelId, payload)
Disarms the panel where:
panelId
is a Panel IDpayload
is an object with any of the following keys:areas
- a string in the format"1,2,3"
, seepanels.arm
for more information
lightStatuses
panels.lightStatuses.get(panelId, deviceNumber)
Get the status of a Zwave light where:
panelId
is a Panel IDdeviceNumber
is an integer fromzwaveSetups
representing the Zwave device
panels.lightStatuses.set(panelId, deviceNumber, payload)
Sets the status of a Zwave light where:
panelId
is a Panel IDdeviceNumber
is an integer fromzwaveSetups
representing the Zwave devicepayload
is an object with any of the following keys:level
- an integer from0
to99
representing the light's brightness
lockStatuses
panels.lockStatuses.get(panelId, deviceNumber)
Get the status of a Zwave lock where:
panelId
is a Panel IDdeviceNumber
is an integer fromzwaveSetups
representing the Zwave device
panels.lockStatuses.set(panelId, deviceNumber, payload)
Sets the status of a Zwave light where:
panelId
is a Panel IDdeviceNumber
is an integer fromzwaveSetups
representing the Zwave devicepayload
is an object with any of the following keys:status
- any one ofSECURED
,UNSECURED
thermostatStatuses
panels.thermostatStatuses.get(panelId, deviceNumber)
Get the status of a Zwave thermostat where:
panelId
is a Panel IDdeviceNumber
is an integer fromzwaveSetups
representing the Zwave device
panels.thermostatStatuses.set(panelId, deviceNumber, payload)
Sets the status of a Zwave light where:
panelId
is a Panel IDdeviceNumber
is an integer fromzwaveSetups
representing the Zwave devicepayload
is an object with any of the following keys:setpoint_cooling
- an integer from58
to95
representing the cooling setpoint in Farenheitsetpoint_heating
- an integer from58
to95
representing the heating setpoint in Farenheitmode
- any one ofAUTO
,OFF
,HEAT
,COOL
fan_mode
- any one ofAUTO
,ON
zoneStatuses
panels.zoneStatuses.get(panelId)
Get the status of all sensors where:
panelId
is a Panel ID
panels.zoneStatuses.refresh(panelId)
Refresh the status of all sensors where:
panelId
is a Panel ID
zoneInformations
panels.zoneInformations.get(panelId)
Get a list of zones programmed to a panel where:
panelId
is a Panel ID
panels.zoneInformations.refresh(panelId)
Refreshes the list of zones programmed to a panel where:
panelId
is a Panel ID
panels.zoneInformations.create(panelId, payload)
Adds a new zone to the panel where:
panelId
is a Panel IDpayload
is an object encapsulated like{ zone_information: { // the payload }}
with all of the following keys:number
- a string representing the zone number (zones 21-24, 31-34, 41-44 may be reserved for DMP wireless devices, others may be reserved for ZWave devices),name
- a string with a max length of 16 representing the zone name,tipe
- the zone type, one of--
(Blank),NT
(Night),DY
(Day),EX
(Exit),FI
(Fire),PN
(Panic),EM
(Emergency),SV
(Supervisory),A1
orA2
(Auxillary 1 or 2),FV
(Fire Verify),AR
(Arming)area_list
- the area to place the zone in, one of the strings1
(Perimeter) or2
(Interior)armd_areas
- a comma-separated list of areas e.g.1,2,3,4,5,6
do_act_msg
- the disarmed open message, one ofA
(Alarm),T
(Trouble),L
(Local),-
(None)do_out_num
- a string representing the disarmed open output number e.g.000
do_out_act
- the disarmed open output action, one ofS
(Steady),P
(Pulse),M
(Momentary),F
(Follow)ds_act_msg
- the disarmed short message (see above)ds_out_num
- the disarmed short output number (see above)ds_out_act
- the disarmed short output action (see above)ao_act_msg
- the armed open message (see above)ao_out_num
- the armed open output number (see above)ao_out_act
- the armed open output action (see above)as_act_msg
- the armed short message (see above)as_out_num
- the armed short output number (see above)as_out_act
- the armed short output action (see above)swgr_byps
- can zone be swinger bypassed, one ofN
orY
cross_zn
- enable cross zoning, one ofN
orY
rec_route
- select which receivers get supervisory/trouble messages from this zone, one ofN
(Normal),1
(Rcvr 1),1
(Rcvr 2),B
(Both)wl_dis_dis
- is wireless zone, one ofN
orY
folow_area
- unknown, send the string00
rptareaacc
- unknown, send the string00
isNew
- unknown, send the boolean trueisOpen
- unknown, send the boolean truechime_snd
- unknown, send the string0
For wireless zones, add the following fields to the payload
:
prewarn
- unknown, but appears to be a comma-separated list of areas similar toarmed_areas
ent_dly
- "1",prior_zn
- "N",traffic_ct
- "N",zn_act_dys
- "0",wireless
- is wireless zone, one ofN
orY
serial_no
- a string representing the serial number of the DMP wireless devicecontact_no
- which contact to use for this zone, usually the string0
supv_tm_se
- if enabled, the amount of time a zone can fail to check in before it goes missing, one of the strings0
(None),2
(60 min),3
(240 min)wl_pulse
- the number of PIR pulses counted in 25 seconds before the panel will send a short message, one of the strings2
or4
wl_sense
- the PIR sensitivity setting, one of the stringsL
(Low) orH
(High)wl_pet_imm
- whether pet immunity is enabled, one ofF
(Off) orN
(On)wl_led_en
- is LED enabled, one ofN
orY
wl_con_no
- unknown, send the stringN
barrierStatuses
panels.barrierStatuses.get(panelId, deviceNumber)
Get the status of a barrier where:
panelId
is a Panel IDdeviceNumber
is an integer representing the device
panels.barrierStatuses.set(panelId, deviceNumber, payload)
Set the status of a barrier where:
panelId
is a Panel IDdeviceNumber
is an integer representing the devicepayload
is an object with any of the following keys:status
- The stringOPEN
orCLOSED
outputStatuses
panels.outputStatuses.get(panelId)
Get the status of an output where:
panelId
is a Panel ID
panels.outputStatuses.set(panelId, deviceNumber, payload)
Set the status of an output where:
panelId
is a Panel IDdeviceNumber
is an integer representing the devicepayload
is an object with any of the following keys:type
- The stringdoor
for a doorstatus
- The stringACCESS
opens a door
userCodes
panels.userCodes.refresh(panelId)
Refresh user codes from the panel where:
panelId
is a Panel ID
panels.userCodes.get(panelId)
Gets user codes from the cache where:
panelId
is a Panel ID
panels.userCodes.getSkeletonObject(panelId)
Gets a skeleton userCode object that contains default values where:
panelId
is a Panel ID
panels.userCodes.create(panelId, payload)
Add a user code to a panel where:
panelId
is a Panel IDpayload
is an object with the following keys:code
- numerical code the user will use to access the system. Max 12 digits.number
- the slot number in the panel. Cannot be 0. Slot 1 may be reserved for an ambush code.name
- the name assigned to the user code.areas
- the areas to which the user has access in area systems. For non-area arming types, the value is "1-6".user_level
- the user's authority level. For master user, the level is 9. For standard users the level is 6.temp
- whether or not the user is temporary. Valid values are booleantrue
orfalse
arm_only
- whether the user is an Arm Only user. Valid values are booleantrue
orfalse
snd_to_lks
- whether to send this code to the locks. Valid values are stringY
orN
panels.userCodes.edit(panelId, number, payload)
Edit a user code in the panel where:
panelId
is a Panel IDnumber
is the user code's slot number in the panel.payload
is an object with any of the following keys:code
- numerical code the user will use to access the system. Max 12 digits.name
- the name assigned to the user code.areas
- the areas to which the user has access in area systems. For non-area arming types, the value is "1-6".user_level
- the user's authority level. For master user, the level is 9. For standard users the level is 6.temp
- whether or not the user is temporary. Valid values are booleantrue
orfalse
arm_only
- whether the user is an Arm Only user. Valid values are booleantrue
orfalse
snd_to_lks
- whether to send this code to the locks. Valid values are stringY
orN
panels.userCodes.delete(panelId, number)
Delete a user code in the panel where:
panelId
is a Panel IDnumber
is the user code's slot number in the panel.
zwaveSetups
panels.zwaveSetups.get(panelId)
Get a list of paired Zwave devices where:
panelId
is a Panel ID
panels.zwaveSetups.refresh(panelId)
Updates the list of paired Zwave devices where:
panelId
is a Panel ID
profiles
panels.profiles.get(panelId)
Get a list of user profiles where:
panelId
is a Panel ID
communication
panels.communication.refresh(panelId)
Refreshes the communication options for a panel where:
panelId
is a Panel ID
panels.communication.get(panelId)
Get the communication options for a panel where:
panelId
is a Panel ID
panels.communication.set(panelId, payload)
Set the communication options for a panel where:
panelId
is a Panel IDpayload
is an object encapsulated like{ communication: { // the payload }}
with all of the following keys:com_type
- the communication type, one of the string7
(Network) or6
(Cell)ntest_days
- "00"back_cell
- whether backup cell functionality is enabled, one ofY
(Yes) orN
(No)ctest_days
- unknown, send00
acct_num
- unknown, send ""trans_dly
- unknown, send00
rec_ip
- first receiver IP, e.g.216.9.200.218
rec_port
- first receiver port as a string, eg.02001
rec2_ip
- second receiver IP, e.g.216.9.200.218
rec2_port
- second receiver port as a string, eg.02001
a_recl_tm
- the test time, e.g.2000-01-01T03:22:00Z
cell_apn1
- unknown, sendSECURECOM400
cell_apn2
- unknown, sendSECURECOM400
r2_pri_ip
- unknown, send0.0.0.0
chkin_min
- unknown, send120
r2_pri_prt
- unknown, send02001
r2_back_ip
- unknown, send0.0.0.0
fail_time
- unknown, send150
r2_bck_prt
- unknown, send02001
net_trbl
- unknown, sendY
alarms1
- unknown, sendY
supv_trbl1
- unknown, sendY
o_c_user1
- unknown, sendY
test_timr1
- unknown, sendY
alarms2
- unknown, sendN
supv_trbl2
- unknown, sendN
o_c_user2
- unknown, sendN
test_timr2
- unknown, send ""isArray
- unknown, send falseisBusy
- unknown, send true
systemOptions
panels.systemOptions.refresh(panelId)
Refreshes the system options for a panel where:
panelId
is a Panel ID
panels.systemOptions.get(panelId)
Get the system options for a panel where:
panelId
is a Panel ID
activation
panels.activation.checkActivationStatus(dealerId, panelId)
Checks the activation status for a panel where:
dealerId
is a Dealer IDpanelId
is a Panel ID
activate(dealerId, payload)
Activates a panel where:
dealerId
is a Dealer IDpayload
is an object with the following keys:Active
- unknown, send boolean trueDealerId
- the Dealer IDItemType
- unknown, sendpanel
SerialNumber
- the panel serial numberHardwareModel
- the panel type, seecontrolSystems.create
->hardware_mode
CommunicationType
- the communication type, seecontrolSystems.create
->comm_type
PanelId
- the Panel IDOrderType
- unknown, sendINV
Status
- unknown, sendnew
TemplateName
- unknown, send ""
panels.activation.checkEasyConnectStatus(dealerId, serialNumber)
Checks the EASYConnect status for a panel where:
dealerId
is a Dealer IDserialNumber
is a Panel serial number
panels.activation.checkInitialConnection(panelId)
Checks the initial connection status for a panel where:
panelId
is a Panel ID
panels.activation.checkInitializeStatus(panelId, groupId)
Checks the initializestatus for a panel where:
panelId
is a Panel IDgroupId
is the Group ID from theinitialize
function
panels.activation.initialize(panelId, accountNumber, remoteKey)
Initializes a panel where:
panelId
is a Panel IDaccountNumber
is the desired account numberremoteKey
is the desired remote key (optional, defaults to blank)
SIMs
sims.search(params)
Searches for a SIM card where params is an object containing any of these keys:
identifier
- the SIM number
sims.getHistory(params)
Searches for a SIM card (for new SIM cards, this needs to be called before search
to make them show up) where params is an object containing all of these keys:
meid
- the SIM numberkey
- thesecurecom_license
key from the Dealer object (seecustomers.getDealer
)
sims.activate(payload, params)
Activates a SIM card where params is an empty object and payload contains all of these keys:
account
- the account numbericcid
- the ICCID from thesearch
functionkey
- the key from thesearch
functionname
- a name for the SIM cardrate_subplan
- one ofBackup-T0
,CellComSL-T0
(there are more of these, but I'm not sure how they're derived from thehttps://ws.securecomwireless.com/v2/rate_plans
results)receiver
- the account prefix number
sims.deactivate(payload, params)
Deactivates a SIM card where params is an empty object and payload contains the same keys as activate
License
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago