API Reference

Events

Events are specific triggers that will run specified actions. An example event would be an outlet current draw being greater than 5 amps, aith an example action being sending an email to your destination of choice.


Endpoints

GET      /api/events              Gets a list of all events
POST     /api/events              Create new event
POST     /api/events/:event_id    Modify existing event
DELETE   /api/events/:event_id    Remove event

Event Object

{
  "name": "16A Warning Threshold for Banks/Circuit Breaker",
  "id": 2,
  "enabled": true,
  "code": 31,
  "numTicksBeyond": 0,
  "triggered": false,
  "params": [
    "any",
    "16",
    "10"
  ],
  "actions": [
    1,
    2
  ]
}
KeyTypeDescription
namestringName for event
idnumberUnique identifier
enabledbooleanEnable or disable event trigger
codenumberEvent Code. see Event Codes Table
paramsarrayArray of strings for associated to particular event code. See event codes table.
actionsarrayArray of action ID's
triggeredbooleanDescribes whether or not the trigger has met it's threshold
numTicksBeyondnumberNumber of steps beyond the threshold. For example, 3 ticks beyond for max current is 3 seconds beyond
 

List All Events

GET    /api/events     Returns list of events

Example Request

  curl 'http://192.168.1.100/api/events' \
  --header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k'

Expected response is an array of Event Objects

Create New Event

POST /api/events      Create a new Event

Request

Follows Authentication Scheme

{
  "name": "Outlet #2 Amperage Threshold",
  "code": 45,
  "params": [
    "8-286331153",
    "5",
    "3"
  ],
  "actions": [
    2
  ]
}

name required
Name string up to 100 characters

code required
Event code for particular trigger. See Event Code Table.

params required for certain triggers
See Event Code Table. Array of strings, maximum 3 parameters.

actions required
Array of action ID's.

Example Request

curl 'http://192.168.1.100/api/events' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k' \
--data '{"name":"Outlet #2 Amperage Threshold","code":"45","params":["8-286331153",5,3],"actions":[2]}'

Expected response is an Event Object

Modify Event

POST  /api/events/:event_id    Modifies specific event

Request

Follows Authentication Scheme

{
  "name": "Outlet #2 Amperage Threshold",
  "code": 45,
  "params": [
    "8-286331153",
    "5",
    "3"
  ],
  "actions": [
    2
  ]
}

Same request body as Creating New Events

Example Request

curl 'http://192.168.1.100/api/events/1' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k' \
--data '{"name":"Outlet #2 Amperage Threshold","code":"45","params":["8-286331153","6","3"],"actions":[2]}'

Expected response is an Event Object

Delete Event Permanently

DELETE  /api/events/:event_id   Permanently remove event

Request

Follows Authentication Scheme

{} // no request parameters

Example Request

curl -X DELETE 'http://192.168.1.100/api/events/1' \
--header 'Cookie: SPID=j2d36cG2ciHKDDqFc3k'

Response

Expected response is a 200 HTTP response for success.

200

 

Event Codes Table

Code

Name

Parameter 1

Parameter 2

Parameter 3

Description

12

AutoPing Timeout

Target IP Address

fails before action

--

IP Address to Ping. Failure to ping creates trigger.

13

Inlet Line Max Current Threshold

Inlet Line

Amperage Threshold

secs past threshold

Applies to 3 phase PDUs with line measurements. Amperage threshold in amps

14

Inlet Line Min Current Threshold

Inlet Line

Amperage Threshold

secs past threshold

Applies to 3 phase PDUs with line measurements. Amperage threshold in amps

15

Inlet Max Current Threshold

Inlet ID

Amperage Threshold

secs past threshold

Applies to single phase PDUs. Amperage threshold in amps

16

Inlet Min Current Threshold

Inlet ID

Amperage Threshold

secs past threshold

Applies to single phase PDUs. Amperage threshold in amps

17

Inlet Max Voltage Threshold

Inlet ID

Voltage Threshold

secs past threshold

Applies to single phase PDUs. Voltage threshold in volts

18

Inlet Min Voltage Threshold

Inlet ID

Voltage Threshold

secs past threshold

Applies to single phase PDUs. Voltage threshold in volts

19

Inlet Max Line Frequency Threshold

Inlet ID

Line Frequency Threshold

secs past threshold

Applies to single phase PDUs. Line frequency threshold in hertz

20

Inlet Max Line Frequency Threshold

Inlet ID

Line Frequency Threshold

secs past threshold

Applies to single phase PDUs. Line frequency threshold in hertz

21

Inlet Min Power Factor

Inlet ID

Power Factor Threshold

secs past threshold

Power Factor Threshold as a ratio

22

Inlet Active Energy Accumulation Max

Inlet ID

kWh Threshold

--

--

24

Inlet Min Active Power Threshold

Inlet ID

Active Power Threshold

secs past threshold

Active Power Threshold in watts

23

Inlet Max Active Power Threshold

Inlet ID

Active Power Threshold

secs past threshold

Active Power Threshold in watts

25

Inlet Max Apparent Power Threshold

Inlet ID

Apparent Power Threshold

secs past threshold

Apparent Power Threshold in volt-amperes (VA)

26

Inlet Min Apparent Power Threshold

Inlet ID

Apparent Power Threshold

secs past threshold

Apparent Power Threshold in volt-amperes (VA)

29

Inlet 3 Phase Imbalance

Inlet ID

% Imbalance Threshold

secs past threshold

--

30

Bank Circuit Breaker Trip

Bank ID

--

--

--

31

Bank Max Current Threshold

Bank ID

Amperage Threshold

secs past threshold

Amperage threshold in amps

32

Bank Min Current Threshold

Bank ID

Amperage Threshold

secs past threshold

Amperage threshold in amps

33

Bank Max Voltage Threshold

Bank ID

Voltage Threshold

secs past threshold

Voltage threshold in volts

34

Bank Min Voltage Threshold

Bank ID

Voltage Threshold

secs past threshold

Voltage threshold in volts

35

Bank Max Line Frequency Threshold

Bank ID

Line Frequency Threshold

secs past threshold

Line Frequency threshold in hertz

36

Bank Min Line Frequency Threshold

Bank ID

Line Frequency Threshold

secs past threshold

Line Frequency threshold in hertz

37

Bank Min Power Factor

Bank ID

Power Factor Threshold

secs past threshold

38

Bank Active Energy Accumulation Max

Bank ID

kWh Threshold

--

39

Bank Max Active Power Threshold

Bank ID

Active Power Threshold

secs past threshold

Active Power Threshold in watts

40

Bank Min Active Power Threshold

Bank ID

Active Power Threshold

secs past threshold

Active Power Threshold in watts

41

Bank Max Apparent Power Threshold

Bank ID

Apparent Power Threshold

secs past threshold

Apparent Power Threshold in volt-amperes (VA)

42

Bank Min Apparent Power Threshold

Bank ID

Apparent Power Threshold

secs past threshold

Apparent Power Threshold in volt-amperes (VA)

45

Outlet Max Current Threshold

Outlet ID

Amperage Threshold

secs past threshold

Applies to PDUs with Outlet Current Measurements. Amperage threshold in amps

46

Outlet Min Current Threshold

Outlet ID

Amperage Threshold

secs past threshold

Applies to PDUs with Outlet Current Measurements. Amperage threshold in amps

49

Temperature Max Threshold

Sensor ID

Temperature Threshold

secs past threshold

Requires attached temperature/humidity sensor. Temperature threshold in celsius

50

Temperature Min Threshold

Sensor ID

Temperature Threshold

secs past threshold

Requires attached temperature/humidity sensor. Temperature threshold in celsius

51

Humidity Max Threshold

Sensor ID

Humidity Threshold

secs past threshold

Requires attached temperature/humidity sensor. Humidity threshold as relative humidity %

52

Humidity Min Threshold

Sensor ID

Humidity Threshold

secs past threshold

Requires attached temperature/humidity sensor. Humidity threshold as relative humidity %

53

Scheduled Daily Time

Time to trigger

--

--

Time of day in military time. example: 13:01

54

Scheduled Time Interval

--

--

--

Triggers every X seconds forever

55

ATS Switched to Secondary

--

--

--

Applies to ATS PDUs. Triggers when Primary ATS Inlet has lost power and switches to Secondary

56

ATS Switched to Primary

--

--

--

Applies to ATS PDUs. Triggers when Primary ATS Inlet has recovered and switches from Secondary to Primary

57

Secondary Power Source Lost

--

--

--

Applies to ATS PDUs. Triggers when Secondary ATS Inlet has lost power.

58

Secondary Power Source Restored

--

--

--

Applies to ATS PDUs. Triggers when Secondary ATS Inlet has recovered power.

59

System Power Recovery Event

Bank ID

--

--

Fires when the given Bank has booted up after having no power. Will fire with circuit breaker trip for supported devices. For single inlet devices, choose any bank. For Dual circuit devices, Banks are linked with inlets.

60

Monthly Scheduled Event

Day of Month

Hour Of Day

Minute of Hour

Day of month as a number between 1 and 28, hour of day as 0-23, minute as 0-59

61

Weekly Scheduled Event

Day of Week

Hour of Day

Minute of hour

Day of week as 0-6, hour of day as 0-23, minute at 0-59

62

Digital Input State High

Sensor Port (A or B)

Digital Input Index (1-6)

secs past threshold

Requires SPA-0140 Smart IO Hub. Triggers an event when a hub's digital input senses high for # secs past threshold

63

Digital Input State Low

Sensor Port (A or B)

Digital Input Index (1-6)

secs past threshold

Requires SPA-0140 Smart IO Hub. Triggers an event when a hub's digital input senses low for # secs past threshold

64

User Switch Triggered

Sensor Port (A or B)

State triggered to

--

Requires SPA-0140 Smart IO Hub. If state is triggered OFF, then when user switch is turned off, event is triggered

65

Sensor Connected/Disconnected

Sensor Port (A or B)

Connect/Disconnect

--