1.5.0-rc.21 • Published 4 years ago

@synapsestudios/securecom v1.5.0-rc.21

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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 ID
  • payload is the object returned from getSkeleton with the necessary values updated, likely the following:
    • customer_id - the Customer ID
    • name - a name for the panel
    • panels_attributes[0].name - a name for the panel
    • panels_attributes[0].hardware_model - one of XTL, XTLP, XTLT, XT30, XT50, XR500, XR150, XR550, CellComSL, iComSL, DualCom, iComLNC, Video Only
    • panels_attributes[0].account_number - an integer from 1-65535
    • panels_attributes[0].serial_number - the panel serial number
    • panels_attributes[0].comm_type - one of persistent, persistent_w_cell_backup, cell, network
    • panels_attributes[0].comm_address - a string representing the phone number of the installed SIM card, or null
    • panels_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 ID
  • controlSystemId is a Control System ID
  • payload is the object returned from get 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 ID
  • page is the page of results to fetch, default 1
  • pageSize is the number of results to fetch, default 25 max 100
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 ID
  • page is the page of results to fetch, default 1
  • pageSize is the number of results to fetch, default 25 max 100

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 ID
  • payload 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 of force (any faulted zones will be armed as soon as fault clears), bypass (faulted zones will not be armed), or refuse (faulted zones will cause arming to fail)
panels.disarm(panelId, payload)

Disarms the panel where:

  • panelId is a Panel ID
  • payload is an object with any of the following keys:
    • areas - a string in the format "1,2,3", see panels.arm for more information

lightStatuses

panels.lightStatuses.get(panelId, deviceNumber)

Get the status of a Zwave light where:

  • panelId is a Panel ID
  • deviceNumber is an integer from zwaveSetups representing the Zwave device
panels.lightStatuses.set(panelId, deviceNumber, payload)

Sets the status of a Zwave light where:

  • panelId is a Panel ID
  • deviceNumber is an integer from zwaveSetups representing the Zwave device
  • payload is an object with any of the following keys:
    • level - an integer from 0 to 99 representing the light's brightness

lockStatuses

panels.lockStatuses.get(panelId, deviceNumber)

Get the status of a Zwave lock where:

  • panelId is a Panel ID
  • deviceNumber is an integer from zwaveSetups representing the Zwave device
panels.lockStatuses.set(panelId, deviceNumber, payload)

Sets the status of a Zwave light where:

  • panelId is a Panel ID
  • deviceNumber is an integer from zwaveSetups representing the Zwave device
  • payload is an object with any of the following keys:
    • status - any one of SECURED, UNSECURED

thermostatStatuses

panels.thermostatStatuses.get(panelId, deviceNumber)

Get the status of a Zwave thermostat where:

  • panelId is a Panel ID
  • deviceNumber is an integer from zwaveSetups representing the Zwave device
panels.thermostatStatuses.set(panelId, deviceNumber, payload)

Sets the status of a Zwave light where:

  • panelId is a Panel ID
  • deviceNumber is an integer from zwaveSetups representing the Zwave device
  • payload is an object with any of the following keys:
    • setpoint_cooling - an integer from 58 to 95 representing the cooling setpoint in Farenheit
    • setpoint_heating - an integer from 58 to 95 representing the heating setpoint in Farenheit
    • mode - any one of AUTO, OFF, HEAT, COOL
    • fan_mode - any one of AUTO, 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 ID
  • payload 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 or A2 (Auxillary 1 or 2), FV (Fire Verify), AR (Arming)
    • area_list - the area to place the zone in, one of the strings 1 (Perimeter) or 2 (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 of A (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 of S (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 of N or Y
    • cross_zn - enable cross zoning, one of N or Y
    • rec_route - select which receivers get supervisory/trouble messages from this zone, one of N (Normal), 1 (Rcvr 1), 1 (Rcvr 2), B (Both)
    • wl_dis_dis - is wireless zone, one of N or Y
    • folow_area - unknown, send the string 00
    • rptareaacc - unknown, send the string 00
    • isNew - unknown, send the boolean true
    • isOpen - unknown, send the boolean true
    • chime_snd - unknown, send the string 0

For wireless zones, add the following fields to the payload:

  • prewarn - unknown, but appears to be a comma-separated list of areas similar to armed_areas
  • ent_dly - "1",
  • prior_zn - "N",
  • traffic_ct - "N",
  • zn_act_dys - "0",
  • wireless - is wireless zone, one of N or Y
  • serial_no - a string representing the serial number of the DMP wireless device
  • contact_no - which contact to use for this zone, usually the string 0
  • supv_tm_se - if enabled, the amount of time a zone can fail to check in before it goes missing, one of the strings 0 (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 strings 2 or 4
  • wl_sense - the PIR sensitivity setting, one of the strings L (Low) or H (High)
  • wl_pet_imm - whether pet immunity is enabled, one of F (Off) or N (On)
  • wl_led_en - is LED enabled, one of N or Y
  • wl_con_no - unknown, send the string N

barrierStatuses

panels.barrierStatuses.get(panelId, deviceNumber)

Get the status of a barrier where:

  • panelId is a Panel ID
  • deviceNumber is an integer representing the device
panels.barrierStatuses.set(panelId, deviceNumber, payload)

Set the status of a barrier where:

  • panelId is a Panel ID
  • deviceNumber is an integer representing the device
  • payload is an object with any of the following keys:
    • status - The string OPEN or CLOSED

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 ID
  • deviceNumber is an integer representing the device
  • payload is an object with any of the following keys:
    • type - The string door for a door
    • status - The string ACCESS 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 ID
  • payload 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 boolean true or false
    • arm_only - whether the user is an Arm Only user. Valid values are boolean true or false
    • snd_to_lks - whether to send this code to the locks. Valid values are string Y or N
panels.userCodes.edit(panelId, number, payload)

Edit a user code in the panel where:

  • panelId is a Panel ID
  • number 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 boolean true or false
    • arm_only - whether the user is an Arm Only user. Valid values are boolean true or false
    • snd_to_lks - whether to send this code to the locks. Valid values are string Y or N
panels.userCodes.delete(panelId, number)

Delete a user code in the panel where:

  • panelId is a Panel ID
  • number 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 ID
  • payload is an object encapsulated like { communication: { // the payload }} with all of the following keys:
    • com_type - the communication type, one of the string 7 (Network) or 6 (Cell)
    • ntest_days - "00"
    • back_cell - whether backup cell functionality is enabled, one of Y (Yes) or N (No)
    • ctest_days - unknown, send 00
    • acct_num - unknown, send ""
    • trans_dly - unknown, send 00
    • 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, send SECURECOM400
    • cell_apn2 - unknown, send SECURECOM400
    • r2_pri_ip - unknown, send 0.0.0.0
    • chkin_min - unknown, send 120
    • r2_pri_prt - unknown, send 02001
    • r2_back_ip - unknown, send 0.0.0.0
    • fail_time - unknown, send 150
    • r2_bck_prt - unknown, send 02001
    • net_trbl - unknown, send Y
    • alarms1 - unknown, send Y
    • supv_trbl1 - unknown, send Y
    • o_c_user1 - unknown, send Y
    • test_timr1 - unknown, send Y
    • alarms2 - unknown, send N
    • supv_trbl2 - unknown, send N
    • o_c_user2 - unknown, send N
    • test_timr2 - unknown, send ""
    • isArray - unknown, send false
    • isBusy - 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 ID
  • panelId is a Panel ID
activate(dealerId, payload)

Activates a panel where:

  • dealerId is a Dealer ID
  • payload is an object with the following keys:
    • Active - unknown, send boolean true
    • DealerId - the Dealer ID
    • ItemType - unknown, send panel
    • SerialNumber - the panel serial number
    • HardwareModel - the panel type, see controlSystems.create -> hardware_mode
    • CommunicationType - the communication type, see controlSystems.create -> comm_type
    • PanelId - the Panel ID
    • OrderType - unknown, send INV
    • Status - unknown, send new
    • TemplateName - unknown, send ""
panels.activation.checkEasyConnectStatus(dealerId, serialNumber)

Checks the EASYConnect status for a panel where:

  • dealerId is a Dealer ID
  • serialNumber 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 ID
  • groupId is the Group ID from the initialize function
panels.activation.initialize(panelId, accountNumber, remoteKey)

Initializes a panel where:

  • panelId is a Panel ID
  • accountNumber is the desired account number
  • remoteKey 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 number
  • key - the securecom_license key from the Dealer object (see customers.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 number
  • iccid - the ICCID from the search function
  • key - the key from the search function
  • name - a name for the SIM card
  • rate_subplan - one of Backup-T0, CellComSL-T0 (there are more of these, but I'm not sure how they're derived from the https://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

MIT

1.5.0-rc.21

4 years ago

1.5.0-rc.20

4 years ago

1.5.0-rc.19

4 years ago

1.5.0-rc.18

4 years ago

1.5.0-rc.17

4 years ago

1.5.0-rc.16

4 years ago

1.5.0-rc.15

4 years ago

1.5.0-rc.14

4 years ago

1.5.0-rc.13

4 years ago

1.5.0-rc.12

4 years ago

1.5.0-rc.10

4 years ago

1.5.0-rc.11

4 years ago

1.5.0-rc.9

4 years ago

1.5.0-rc.8

4 years ago

1.5.0-rc.7

4 years ago

1.5.0-rc.6

4 years ago

1.5.0-rc.5

4 years ago

1.5.0-rc.4

4 years ago

1.5.0-rc.3

4 years ago

1.5.0-rc.2

4 years ago

1.5.0-rc.1

5 years ago

1.4.0

5 years ago

1.4.0-rc.1

5 years ago

1.3.0

5 years ago

1.3.0-rc1

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.1.0-rc2

6 years ago

1.1.0-rc1

6 years ago

1.0.0

6 years ago

1.0.0-rc6

6 years ago

1.0.0-rc5

6 years ago

1.0.0-rc4

6 years ago

1.0.0-rc3

6 years ago

1.0.0-rc2

6 years ago

1.0.0-rc1

6 years ago