Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/EcoStruxureIT-DCE/v1/configValidation.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"displayName": "Connect to Data Center Expert",
"dataStream": { "name": "rootDeviceGroup" },
"required": true,
"error": "Could not sign in to Data Center Expert. Check the Server URL is reachable from SquaredUp (or the on-premise agent), the username and password are correct, and enable Ignore certificate errors if the server uses a self-signed certificate.",
"error": "The first request to Data Center Expert failed. Check the Server URL is reachable from SquaredUp (or the relay agent), the username and password are correct, and Ignore certificate errors is on if the server uses a self-signed certificate. To find the exact error, see [Troubleshooting](https://github.com/squaredup/plugins/blob/main/plugins/EcoStruxureIT-DCE/v1/docs/README.md#troubleshooting).",
"success": "Connected to Data Center Expert."
},
{
"displayName": "Check device access",
"dataStream": { "name": "devices" },
"required": false,
"error": "Signed in, but no devices were returned. Check the user has access to at least one device group in Data Center Expert.",
"error": "No devices were returned. If the check above also failed, fix that first. Otherwise, check the user has access to at least one device group in Data Center Expert.",
"success": "Devices are accessible."
}
]
Expand Down
35 changes: 24 additions & 11 deletions plugins/EcoStruxureIT-DCE/v1/dataStreams/alarmHistory.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
{
"name": "alarmHistory",
"displayName": "Alarm History",
"description": "Resolved alarms that started within the timeframe, optionally filtered by device",
"description": "Alarms resolved within the timeframe, optionally filtered by device (across all devices, the last 24 hours at most)",
"tags": [
"Alerts",
"Device"
],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "v1/alarms/history",
"endpointPath": "{{ typeof device !== 'undefined' && Array.isArray(device) && device.length === 1 ? 'v1/devices/' + encodeURIComponent([].concat(device[0].rawId)[0]) + '/alarms/history' : 'v1/alarms/history' }}",
"getArgs": [
{
"key": "startTime",
"value": "{{ typeof device !== 'undefined' && Array.isArray(device) && device.length === 1 ? String(new Date(timeframe.start).getTime()) : null }}"
},
{
"key": "endTime",
"value": "{{ typeof device !== 'undefined' && Array.isArray(device) && device.length === 1 ? String(new Date(timeframe.end).getTime()) : null }}"
},
{
"key": "startDateTime",
"value": "{{ String(new Date(timeframe.start).getTime()) }}"
"value": "{{ typeof device !== 'undefined' && Array.isArray(device) && device.length === 1 ? null : String(Math.max(new Date(timeframe.start).getTime(), new Date(timeframe.end).getTime() - 86400000)) }}"
},
{
"key": "endDateTime",
"value": "{{ String(new Date(timeframe.end).getTime()) }}"
"value": "{{ typeof device !== 'undefined' && Array.isArray(device) && device.length === 1 ? null : String(new Date(timeframe.end).getTime()) }}"
}
],
"postRequestScript": "alarms.js",
Expand Down Expand Up @@ -49,6 +57,16 @@
"shape": "string",
"role": "label"
},
{
"name": "category",
"displayName": "Category",
"shape": "string"
},
{
"name": "statusText",
"displayName": "Status Text",
"shape": "string"
},
{
"name": "severityText",
"displayName": "Severity",
Expand Down Expand Up @@ -100,13 +118,6 @@
"sourceType": "Device",
"objectPropertyPath": "name"
},
{
"name": "sensorName",
"displayName": "Sensor",
"sourceId": "sensorGuid",
"sourceType": "Sensor",
"objectPropertyPath": "name"
},
{
"name": "recommendedAction",
"displayName": "Recommended Action",
Expand Down Expand Up @@ -150,6 +161,8 @@
{
"name": "deviceGuid",
"displayName": "Device ID",
"sourceId": "deviceGuid",
"sourceType": "Device",
"shape": "string",
"visible": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"displayName": "Status",
"shape": ["state", { "map": { "success": ["success"], "warning": ["warning"], "error": ["error"] } }]
},
{ "name": "deviceGroupGuid", "displayName": "Device Group ID", "shape": "string", "role": "id", "visible": false }
{ "name": "deviceGroupGuid", "displayName": "Device Group ID", "sourceId": "deviceGroupGuid", "sourceType": "Device Group", "shape": "string", "role": "id", "visible": false }
],
"defaultShaping": { "sort": { "by": [["criticalAlarmCount", "desc"], ["warningAlarmCount", "desc"]] } },
"timeframes": false
Expand Down
39 changes: 29 additions & 10 deletions plugins/EcoStruxureIT-DCE/v1/dataStreams/alarms.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"name": "alarms",
"displayName": "Active Alarms",
"description": "Currently active alarms, optionally filtered by device",
"description": "Currently active alarms, optionally filtered by device or device group",
"tags": [
"Alerts",
"Device"
"Device",
"Device Group"
],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "v1/alarms",
"endpointPath": "{{ typeof deviceGroup !== 'undefined' && Array.isArray(deviceGroup) && deviceGroup.length === 1 ? 'v1/deviceGroups/' + encodeURIComponent([].concat(deviceGroup[0].rawId)[0]) + '/alarms' : 'v1/alarms' }}",
"postRequestScript": "alarms.js",
"errorHandling": {
"type": "script",
Expand All @@ -30,6 +31,19 @@
]
}
}
},
{
"type": "objects",
"name": "deviceGroup",
"label": "Device group (optional)",
"matches": {
"sourceType": {
"type": "oneOf",
"values": [
"Device Group"
]
}
}
}
],
"metadata": [
Expand All @@ -39,6 +53,16 @@
"shape": "string",
"role": "label"
},
{
"name": "category",
"displayName": "Category",
"shape": "string"
},
{
"name": "statusText",
"displayName": "Status Text",
"shape": "string"
},
{
"name": "severityText",
"displayName": "Severity",
Expand Down Expand Up @@ -85,13 +109,6 @@
"sourceType": "Device",
"objectPropertyPath": "name"
},
{
"name": "sensorName",
"displayName": "Sensor",
"sourceId": "sensorGuid",
"sourceType": "Sensor",
"objectPropertyPath": "name"
},
{
"name": "recommendedAction",
"displayName": "Recommended Action",
Expand Down Expand Up @@ -135,6 +152,8 @@
{
"name": "deviceGuid",
"displayName": "Device ID",
"sourceId": "deviceGuid",
"sourceType": "Device",
"shape": "string",
"visible": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@
"config": {
"httpMethod": "get",
"endpointPath": "v1/deviceGroups/{{encodeURIComponent(object.rawId)}}/devices",
"postRequestScript": "statusText.js",
"errorHandling": { "type": "script", "script": "errorHandling/dceError.js" }
},
"matches": {
"sourceType": { "type": "oneOf", "values": ["Device Group"] }
},
"metadata": [
{ "sourceId": "isxcGuid", "sourceType": "Device", "name": "label", "displayName": "Device", "shape": "string", "role": "label" },
{ "name": "statusText", "displayName": "Status Text", "shape": "string" },
{
"name": "severityText",
"displayName": "Status",
"shape": [
"state",
{
"map": {
"success": ["Information", "Informational", "Normal", "OK", "None"],
"success": ["Information", "Informational", "Normal", "OK", "Ok", "None"],
"warning": ["Warning"],
"error": ["Error", "Critical", "Failure"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
"config": {
"httpMethod": "get",
"endpointPath": "v1/deviceGroups",
"postRequestScript": "statusText.js",
"errorHandling": { "type": "script", "script": "errorHandling/dceError.js" }
},
"matches": "none",
"metadata": [
{ "sourceId": "isxcGuid", "sourceType": "Device Group", "name": "name", "displayName": "Device Group", "shape": "string", "role": "label" },
{ "name": "statusText", "displayName": "Status Text", "shape": "string" },
{
"name": "severityText",
"displayName": "Status",
"shape": [
"state",
{
"map": {
"success": ["Information", "Informational", "Normal", "OK", "None"],
"success": ["Information", "Informational", "Normal", "OK", "Ok", "None"],
"warning": ["Warning"],
"error": ["Error", "Critical", "Failure"]
}
Expand Down
105 changes: 105 additions & 0 deletions plugins/EcoStruxureIT-DCE/v1/dataStreams/deviceSensorHistory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"name": "deviceSensorHistory",
"displayName": "Device Sensor History",
"description": "Readings over the timeframe from the sensors of the selected devices that match the given names and kinds (their environmental sensors if neither is given)",
"tags": ["Sensor", "Power", "Environment"],
"baseDataSourceName": "httpRequestScopedSingle",
"config": {
"httpMethod": "get",
"endpointPath": "v1/devices/{{encodeURIComponent(object.rawId)}}/sensors",
"paging": { "mode": "nextUrl", "in": { "realm": "payload", "path": "nextPageUrl" } },
"postRequestScript": "sensorHistory.js",
"errorHandling": { "type": "script", "script": "errorHandling/dceError.js" }
},
"matches": {
"sourceType": { "type": "oneOf", "values": ["Device"] }
},
"ui": [
{
"type": "autocomplete",
"name": "sensorName",
"label": "Sensor name(s) (optional)",
"isMulti": true,
"isClearable": true,
"allowCustomValues": true,
"data": {
"source": "fixed",
"values": [
{ "value": "Battery Capacity Remaining", "label": "Battery Capacity Remaining" },
{ "value": "Battery Time Remaining", "label": "Battery Time Remaining" },
{ "value": "Output Load", "label": "Output Load" },
{ "value": "Battery Temperature", "label": "Battery Temperature" },
{ "value": "Battery Voltage", "label": "Battery Voltage" },
{ "value": "Input Voltage", "label": "Input Voltage" },
{ "value": "Output Voltage", "label": "Output Voltage" },
{ "value": "Output Current", "label": "Output Current" },
{ "value": "Input Frequency", "label": "Input Frequency" },
{ "value": "Output Frequency", "label": "Output Frequency" },
{ "value": "UPS Operation Mode", "label": "UPS Operation Mode" },
{ "value": "Battery Status", "label": "Battery Status" }
]
}
},
{
"type": "autocomplete",
"name": "kind",
"label": "Sensor kind(s) (optional)",
"isMulti": true,
"isClearable": true,
"allowCustomValues": true,
"data": {
"source": "fixed",
"values": [
{ "value": "TEMPERATURE", "label": "Temperature" },
{ "value": "DIFF_TEMP", "label": "Temperature difference" },
{ "value": "HUMIDITY", "label": "Humidity" },
{ "value": "DEW_POINT", "label": "Dew point" },
{ "value": "AIRFLOW", "label": "Airflow" },
{ "value": "CURRENT", "label": "Current" },
{ "value": "AMP_DETECTOR", "label": "Current (amp detector)" },
{ "value": "VOLTAGE", "label": "Voltage" },
{ "value": "POWER_WATTS", "label": "Power (W)" },
{ "value": "POWER_KWATTS", "label": "Power (kW)" },
{ "value": "POWER_VA", "label": "Apparent power (VA)" },
{ "value": "POWER_KVA", "label": "Apparent power (kVA)" },
{ "value": "ENERGY_KWH", "label": "Energy (kWh)" },
{ "value": "KWATT_HOUR", "label": "Energy (kW hour)" },
{ "value": "DOOR", "label": "Door" },
{ "value": "MOTION_SENSOR", "label": "Motion" },
{ "value": "DRY_CONTACT", "label": "Dry contact" },
{ "value": "COMMUNICATION_SENSOR", "label": "Communication" },
{ "value": "STATE", "label": "State" },
{ "value": "NUMBER", "label": "Number" }
]
}
}
],
"metadata": [
{ "name": "time", "displayName": "Time", "shape": "date", "role": "timestamp" },
{ "name": "value", "displayName": "Value", "shape": "number", "role": "value" },
{ "name": "series", "displayName": "Sensor", "shape": "string", "role": "label" },
{ "name": "units", "displayName": "Units", "shape": "string", "role": "unitLabel" },
{ "name": "category", "displayName": "Category", "shape": "string" },
{ "name": "valueText", "displayName": "Reading", "shape": "string" },
{
"name": "severityText",
"displayName": "Status",
"shape": [
"state",
{
"map": {
"success": ["Information", "Informational", "Normal", "OK", "Ok", "None"],
"warning": ["Warning"],
"error": ["Error", "Critical", "Failure"]
}
}
]
},
{ "name": "sensorLabel", "displayName": "Sensor Name", "shape": "string" },
{ "sourceId": "deviceGuid", "sourceType": "Device", "name": "deviceLabel", "displayName": "Device", "shape": "string" },
{ "name": "kind", "displayName": "Kind", "shape": "string" },
{ "name": "sensorGuid", "displayName": "Sensor ID", "shape": "string", "visible": false },
{ "name": "deviceGuid", "displayName": "Device ID", "shape": "string", "visible": false }
],
"timeframes": ["last1hour", "last12hours", "last24hours", "last7days", "last30days"]
}
4 changes: 3 additions & 1 deletion plugins/EcoStruxureIT-DCE/v1/dataStreams/devices.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
"config": {
"httpMethod": "get",
"endpointPath": "v1/devices",
"postRequestScript": "statusText.js",
"errorHandling": { "type": "script", "script": "errorHandling/dceError.js" }
},
"matches": "none",
"metadata": [
{ "sourceId": "isxcGuid", "sourceType": "Device", "name": "label", "displayName": "Device", "shape": "string", "role": "label" },
{ "name": "statusText", "displayName": "Status Text", "shape": "string" },
{
"name": "severityText",
"displayName": "Status",
"shape": [
"state",
{
"map": {
"success": ["Information", "Informational", "Normal", "OK", "None"],
"success": ["Information", "Informational", "Normal", "OK", "Ok", "None"],
"warning": ["Warning"],
"error": ["Error", "Critical", "Failure"]
}
Expand Down
Loading
Loading