SynLink PDUs support a variety of sensors. The most common being a temperature and humidity sensor.
Endpoints
GET /api/sensors Return list of all connected sensors
POST /api/sensors/:sensor_id Modifies individual sensor
Sensor Object
{
"sensorPort": "B",
"sensorName": "Temperature & Humidity Sensor",
"sensorType": "temp_hum",
"sensorId": "2" // temperature sensor ID's will correlate with their port. Smart IO Hubs will be unique per hub.
}| Key | Type | Description |
|---|---|---|
| sensorPort | string | "A" or "B" are the available options. Correspond with physical RJ45 ports. |
| sensorType | string | Specifies which type of sensor. Example: "temp_hum" |
| sensorName | string | Name for sensor. Not changeable. |
| sensorId | string | Unique identifier for sensor within a SynLink control module. Temperature/humidity sensors will be tied to the sensor port. Smart IO Hubs will be unique per hub. |
Sensor Object - SPA-0010 Temperature & Humidity Attributes
If sensorType is "temp_hum" then the sensor object will have the following attributes.
{
"sensorTempInC": 22.90574836730957,
"sensorTempInF": 73.2303466796875,
"sensorHumidity": 39.50677490234375,
}| Key | Type | Description |
|---|---|---|
| sensorTempInF | number | Temperature in fahrenheit |
| sensorTempInC | number | Temperature in celsius |
| sensorHumidity | number | Humidity as a relative percentage |
Sensor Object - SPA-0140 Smart IO Hub Attributes
If sensorType is "dio_hub" then the sensor object will have the following attributes.
{
"outputRelays": [
{
"outputRelayName": "Output Relay 1",
"outputRelayDescription": "Output Relay 1",
"rebootStatus": "none",
"state": "OPEN",
"index": 1
}...
],
"digitalInputs": [
{
"digitalInputName": "Digital Input 1",
"digitalInputDescription": "Digital Input 1",
"state": "HI",
"index": 1
}...
],
"vdcOutputState": true,
"userSwitchState": false
}| Key | Type | Description |
|---|---|---|
| outputRelays | array | Array of output relay objects. See Output Relay Object |
| digitalInputs | array | Array of digital input objects. See Digital Input Object |
| vdcOutputState | boolean | true is ENABLED, false is DISABLED. Changeable. |
| userSwitchState | boolean | true is ON, false is OFF. Read Only. |
Output Relay Object
| Key | Type | Description |
|---|---|---|
| outputRelayName | string | Unique ID for sensor within a SynLink PDU. Changeable. |
| outputRelayDescription | string | User editable description for Output Relay. Max 250 characters. Changeable. |
| state | string | "OPEN", "CLOSE". Changeable. |
| index | number | 1 through 6. Matches label on Smart IO Hub. Read Only. |
Digital Input Object
| Key | Type | Description |
|---|---|---|
| digitalInputName | string | Unique ID for sensor within a SynLink PDU |
| digitalInputDescription | string | User editable description for Digital Input. Max 250 characters |
| state | string | "HI", "LOW" |
| rebootStatus | string | "pendingHI", "pendingLOW", "none" |
| index | number | 1 through 6. Matches label on Smart IO Hub |
List All Sensors
Returns list of all connected sensors.
GET /api/sensors Returns all sensorsExample Request
curl 'http://192.168.1.100/api/sensors' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k'Response
Expected response is an array of Sensor Object(s).
[
{
"sensorId": "1",
"sensorPort": "A",
"sensorName": "Temperature & Humidity Sensor",
"sensorDescription": "Temperature & Humidity Sensor",
"sensorTempInC": 22.90574836730957,
"sensorTempInF": 73.2303466796875,
"sensorHumidity": 39.50677490234375,
"sensorType": "temp_hum"
},
{
"sensorId": "8279312",
"sensorPort": "B",
"sensorName": "Smart IO Hub",
"sensorDescription": "Smart IO Hub",
"sensorType": "dio_hub",
"outputRelays": [
{
"outputRelayName": "Output Relay 1",
"outputRelayDescription": "Output Relay 1",
"rebootStatus": "none",
"state": "OPEN",
"index": 1
}...
],
"digitalInputs": [
{
"digitalInputName": "Digital Input 1",
"digitalInputDescription": "Digital Input 1",
"state": "HI",
"index": 1
}...
],
"vdcOutputState": true,
"userSwitchState": false
}
]
Modify Smart IO Hub Sensor Settings or VDC Output State
PUT /api/sensors/:sensorId Modify Sensor Settings/StateRequest
Follows Authentication Scheme
:sensorId may be replaced with :sensorPort if desired. Endpoint only applies to SPA-0140 Smart IO Hub.
{
"sensorName": "Lab bench #2 sensor hub",
"sensorDescription": "Under desk on right side.",
"vdcOutputState": true
}sensorName
Name string up to 100 characters.
sensorDesription
Description string up to 250 characters.
vdcOutputState
true is ENABLED, false is DISABLED.
Example Request
curl 'http://192.168.1.100/api/sensors/875552' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k' \
--data '{"sensorName":"Lab bench #2 sensor hub","sensorDescription":"Under desk on right side."}'Response
Expected response is a Sensor Object.
{
"sensorId": "8279312",
"sensorPort": "B",
"sensorName": "Smart IO Hub",
"sensorDescription": "Smart IO Hub",
"sensorType": "dio_hub",
"outputRelays": [
{
"outputRelayName": "Output Relay 1",
"outputRelayDescription": "Output Relay 1",
"rebootStatus": "none",
"state": "OPEN",
"index": 1
}...
],
"digitalInputs": [
{
"digitalInputName": "Digital Input 1",
"digitalInputDescription": "Digital Input 1",
"state": "HI",
"index": 1
}...
],
"vdcOutputState": true,
"userSwitchState": false
}Modify Smart IO Hub Output Relay Settings/State
PUT /api/sensors/:sensorId/outputRelay/:outputRelayIndex Modify Sensor Hub Output Relay StateRequest
Follows Authentication Scheme
:sensorId may be replaced with :sensorPort if desired. Endpoint only applies to SPA-0140 Smart IO Hub.
{
"outputRelayName": "Solenoid valve DC-4",
"outputRelayDescription": "Solenoid valve #2. Green tag.",
"state": "OPEN"
}outputRelayName
Name string up to 100 characters.
outputRelayDescription
Description string up to 250 characters.
state
Valid options are "OPEN" or "CLOSE". Case insensitive.
Example Request
curl 'http://192.168.1.100/api/sensors/875552/outputRelay/1' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k' \
--data '{"outputRelayName":"Solenoid valve DC-4","outputRelayDescription":"Solenoid valve #2. Green tag.","state":"OPEN"}'Response
Expected response is a Output Relay Object.
Modify Smart IO Hub Digital Input Settings
PUT /api/sensors/:sensorId/digitalInputs/:digitalInputIndex Modify Sensor Hub Digital Input StateRequest
Follows Authentication Scheme
:sensorId may be replaced with :sensorPort if desired. Endpoint only applies to SPA-0140 Smart IO Hub.
{
"digitalInputName": "Leak Detection Lab Bench #2",
"digitalInputDescription": "On the ground, near the power strip.",
}digitalInputName
Name string up to 100 characters.
digitalInputDescription
Description string up to 250 characters.
Example Request
curl 'http://192.168.1.100/api/sensors/875552/digitalInputs/1' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k' \
--data '{"digitalInputName":"Leak Detection Lab Bench #2","digitalInputDescription":"On the ground, near the power strip."}'Response
Expected response is a Digital Input Object.