@synapsestudios/securecom v1.5.0-rc.21
node-securecom
A Node SDK for DMP's device management API
Install
npm i -S @synapsestudios/securecomUsage
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:
idis a Control System ID
controlSystems.getSkeleton(customerId)
Gets a skeleton object for creating a new control system where:
customerIdis a Customer ID
controlSystems.create(customerId, payload)
Creates a new control system where:
customerIdis a Customer IDpayloadis the object returned fromgetSkeletonwith 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 Onlypanels_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,networkpanels_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:
customerIdis a Customer IDcontrolSystemIdis a Control System IDpayloadis the object returned fromgetwith the necessary values updated
controlSystems.delete(id)
Deletes a single control system where:
idis a Control System ID
Customers
customers.get(id)
Gets a single customer where:
idis a Customer ID
customers.getControlSystems(id, page, pageSize)
Gets a single customer's control systems where:
idis a Customer IDpageis the page of results to fetch, default1pageSizeis the number of results to fetch, default25max100
customers.getDealer(id)
Gets the dealer for a single customer where:
idis a Customer ID
Dealers
dealers.getAllCustomers(dealerId, page, pageSize)
Gets all customers for a Dealer
dealerIdis a Dealer IDpageis the page of results to fetch, default1pageSizeis the number of results to fetch, default25max100
Jobs
jobs.getStatus(id)
Get the status of a job where:
idis a Job ID
Panels
panels.arm(panelId, payload)
Arms the panel where:
panelIdis a Panel IDpayloadis 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:
panelIdis a Panel IDpayloadis an object with any of the following keys:areas- a string in the format"1,2,3", seepanels.armfor more information
lightStatuses
panels.lightStatuses.get(panelId, deviceNumber)
Get the status of a Zwave light where:
panelIdis a Panel IDdeviceNumberis an integer fromzwaveSetupsrepresenting the Zwave device
panels.lightStatuses.set(panelId, deviceNumber, payload)
Sets the status of a Zwave light where:
panelIdis a Panel IDdeviceNumberis an integer fromzwaveSetupsrepresenting the Zwave devicepayloadis an object with any of the following keys:level- an integer from0to99representing the light's brightness
lockStatuses
panels.lockStatuses.get(panelId, deviceNumber)
Get the status of a Zwave lock where:
panelIdis a Panel IDdeviceNumberis an integer fromzwaveSetupsrepresenting the Zwave device
panels.lockStatuses.set(panelId, deviceNumber, payload)
Sets the status of a Zwave light where:
panelIdis a Panel IDdeviceNumberis an integer fromzwaveSetupsrepresenting the Zwave devicepayloadis 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:
panelIdis a Panel IDdeviceNumberis an integer fromzwaveSetupsrepresenting the Zwave device
panels.thermostatStatuses.set(panelId, deviceNumber, payload)
Sets the status of a Zwave light where:
panelIdis a Panel IDdeviceNumberis an integer fromzwaveSetupsrepresenting the Zwave devicepayloadis an object with any of the following keys:setpoint_cooling- an integer from58to95representing the cooling setpoint in Farenheitsetpoint_heating- an integer from58to95representing the heating setpoint in Farenheitmode- any one ofAUTO,OFF,HEAT,COOLfan_mode- any one ofAUTO,ON
zoneStatuses
panels.zoneStatuses.get(panelId)
Get the status of all sensors where:
panelIdis a Panel ID
panels.zoneStatuses.refresh(panelId)
Refresh the status of all sensors where:
panelIdis a Panel ID
zoneInformations
panels.zoneInformations.get(panelId)
Get a list of zones programmed to a panel where:
panelIdis a Panel ID
panels.zoneInformations.refresh(panelId)
Refreshes the list of zones programmed to a panel where:
panelIdis a Panel ID
panels.zoneInformations.create(panelId, payload)
Adds a new zone to the panel where:
panelIdis a Panel IDpayloadis 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),A1orA2(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,6do_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.000do_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 ofNorYcross_zn- enable cross zoning, one ofNorYrec_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 ofNorYfolow_area- unknown, send the string00rptareaacc- unknown, send the string00isNew- 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_areasent_dly- "1",prior_zn- "N",traffic_ct- "N",zn_act_dys- "0",wireless- is wireless zone, one ofNorYserial_no- a string representing the serial number of the DMP wireless devicecontact_no- which contact to use for this zone, usually the string0supv_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 strings2or4wl_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 ofNorYwl_con_no- unknown, send the stringN
barrierStatuses
panels.barrierStatuses.get(panelId, deviceNumber)
Get the status of a barrier where:
panelIdis a Panel IDdeviceNumberis an integer representing the device
panels.barrierStatuses.set(panelId, deviceNumber, payload)
Set the status of a barrier where:
panelIdis a Panel IDdeviceNumberis an integer representing the devicepayloadis an object with any of the following keys:status- The stringOPENorCLOSED
outputStatuses
panels.outputStatuses.get(panelId)
Get the status of an output where:
panelIdis a Panel ID
panels.outputStatuses.set(panelId, deviceNumber, payload)
Set the status of an output where:
panelIdis a Panel IDdeviceNumberis an integer representing the devicepayloadis an object with any of the following keys:type- The stringdoorfor a doorstatus- The stringACCESSopens a door
userCodes
panels.userCodes.refresh(panelId)
Refresh user codes from the panel where:
panelIdis a Panel ID
panels.userCodes.get(panelId)
Gets user codes from the cache where:
panelIdis a Panel ID
panels.userCodes.getSkeletonObject(panelId)
Gets a skeleton userCode object that contains default values where:
panelIdis a Panel ID
panels.userCodes.create(panelId, payload)
Add a user code to a panel where:
panelIdis a Panel IDpayloadis 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 booleantrueorfalsearm_only- whether the user is an Arm Only user. Valid values are booleantrueorfalsesnd_to_lks- whether to send this code to the locks. Valid values are stringYorN
panels.userCodes.edit(panelId, number, payload)
Edit a user code in the panel where:
panelIdis a Panel IDnumberis the user code's slot number in the panel.payloadis 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 booleantrueorfalsearm_only- whether the user is an Arm Only user. Valid values are booleantrueorfalsesnd_to_lks- whether to send this code to the locks. Valid values are stringYorN
panels.userCodes.delete(panelId, number)
Delete a user code in the panel where:
panelIdis a Panel IDnumberis the user code's slot number in the panel.
zwaveSetups
panels.zwaveSetups.get(panelId)
Get a list of paired Zwave devices where:
panelIdis a Panel ID
panels.zwaveSetups.refresh(panelId)
Updates the list of paired Zwave devices where:
panelIdis a Panel ID
profiles
panels.profiles.get(panelId)
Get a list of user profiles where:
panelIdis a Panel ID
communication
panels.communication.refresh(panelId)
Refreshes the communication options for a panel where:
panelIdis a Panel ID
panels.communication.get(panelId)
Get the communication options for a panel where:
panelIdis a Panel ID
panels.communication.set(panelId, payload)
Set the communication options for a panel where:
panelIdis a Panel IDpayloadis 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, send00acct_num- unknown, send ""trans_dly- unknown, send00rec_ip- first receiver IP, e.g.216.9.200.218rec_port- first receiver port as a string, eg.02001rec2_ip- second receiver IP, e.g.216.9.200.218rec2_port- second receiver port as a string, eg.02001a_recl_tm- the test time, e.g.2000-01-01T03:22:00Zcell_apn1- unknown, sendSECURECOM400cell_apn2- unknown, sendSECURECOM400r2_pri_ip- unknown, send0.0.0.0chkin_min- unknown, send120r2_pri_prt- unknown, send02001r2_back_ip- unknown, send0.0.0.0fail_time- unknown, send150r2_bck_prt- unknown, send02001net_trbl- unknown, sendYalarms1- unknown, sendYsupv_trbl1- unknown, sendYo_c_user1- unknown, sendYtest_timr1- unknown, sendYalarms2- unknown, sendNsupv_trbl2- unknown, sendNo_c_user2- unknown, sendNtest_timr2- unknown, send ""isArray- unknown, send falseisBusy- unknown, send true
systemOptions
panels.systemOptions.refresh(panelId)
Refreshes the system options for a panel where:
panelIdis a Panel ID
panels.systemOptions.get(panelId)
Get the system options for a panel where:
panelIdis a Panel ID
activation
panels.activation.checkActivationStatus(dealerId, panelId)
Checks the activation status for a panel where:
dealerIdis a Dealer IDpanelIdis a Panel ID
activate(dealerId, payload)
Activates a panel where:
dealerIdis a Dealer IDpayloadis an object with the following keys:Active- unknown, send boolean trueDealerId- the Dealer IDItemType- unknown, sendpanelSerialNumber- the panel serial numberHardwareModel- the panel type, seecontrolSystems.create->hardware_modeCommunicationType- the communication type, seecontrolSystems.create->comm_typePanelId- the Panel IDOrderType- unknown, sendINVStatus- unknown, sendnewTemplateName- unknown, send ""
panels.activation.checkEasyConnectStatus(dealerId, serialNumber)
Checks the EASYConnect status for a panel where:
dealerIdis a Dealer IDserialNumberis a Panel serial number
panels.activation.checkInitialConnection(panelId)
Checks the initial connection status for a panel where:
panelIdis a Panel ID
panels.activation.checkInitializeStatus(panelId, groupId)
Checks the initializestatus for a panel where:
panelIdis a Panel IDgroupIdis the Group ID from theinitializefunction
panels.activation.initialize(panelId, accountNumber, remoteKey)
Initializes a panel where:
panelIdis a Panel IDaccountNumberis the desired account numberremoteKeyis 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_licensekey 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 thesearchfunctionkey- the key from thesearchfunctionname- 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_plansresults)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
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
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago