GetTrend

GetTrend provides the time series for the data definition on a node.

Request example

{
 "requests": [{
     "message": "GetTrend",
     "node": "hierarchy:/TridiumBuildings",
     "data": "hs:power",
 "timerange":"yesterday",
 "interval":"hour"
 }]
}

Request elements

Request element Value Description
message text GetTrend
Node or node (required) ORD (defaults to a relative ORD slot, which is resolved against the config space to which the Px view is assigned) Defines the ORD to the desired slot.
Data algorithm (or tag) name; data=algorithm or tag name Specifies the an algorithm (or tag) used to retrieve data.

The purpose of an alert is to detect a fault condition (Boolean value result). In most cases, you would pick an algorithm that has a Boolean result when configuring this property for an alert. Algorithms with a numeric or enum value greater than zero are considered true and less than zero are considered false.

This is how output from one algorithm becomes the input data source to another algorithm. The prefix for algorithms is alg:.

Rollup check box (if optional, and) drop-down list or ORD parameter (when configured in the data definition, defaults to First, when configured elsewhere, defaults to the value as defined in the Data Definition); rollup=option

If rollup is not enabled in the binding/settings window, the rollup value configured in the Data Definition applies to all chart bindings, reports and tables.

And returns the logical “and” of Boolean values.

Avg returns the statistical mean, which is determined by calculating the sum of all values and dividing by the number of values.

Count returns the total number or quantity of values in a combination. If you request this value on a binding in a PX view, the system counts the number of values based on the properties defined by the data source block and the algorithm’s Property Sheet.

First returns the first value in the combination.

Last returns the last value in the combination.

Max returns the highest value in the combination.

Median returns the value in the middle of a sorted combination—the number that separates the higher half from the lower half.

Min returns the lowest value in the combination.

Mode returns the statistically most frequently occurring number in the combination.

Or returns the logical “or” of Boolean values.

Range returns the statistical difference between the largest and smallest values in the combination.

Sum adds together all values in the combination resulting in a single value.

Std Dev calculates the standard deviation of the values in the combination.

Load Factor calculates the average divided by peak (Max) value.

Aggregation check box (if optional, and) drop-down list (property, defaults to First) or ORD parameter (aggregation=option)

If aggregation is not enabled in the binding/settings window, the aggregation value defined in the Data Definition applies to all chart bindings, reports and tables.

And returns the logical “and” of Boolean values.

Avg returns the statistical mean, which is determined by calculating the sum of all values and dividing by the number of values.

Count returns the total number or quantity of values in a combination. If you request this value on a binding in a PX view, the system counts the number of values based on the properties defined by the data source block and the algorithm’s Property Sheet.

First returns the first value in the combination.

Last returns the last value in the combination.

Max returns the highest value in the combination.

Median returns the value in the middle of a sorted combination—the number that separates the higher half from the lower half.

Min returns the lowest value in the combination.

Mode returns the statistically most frequently occurring number in the combination.

Or returns the logical “or” of Boolean values.

Range returns the statistical difference between the largest and smallest values in the combination.

Sum adds together all values in the combination resulting in a single value.

Load Factor returns the average value divided by peak value.

Std Dev returns the standard deviation of the values in the combination.

Interval, interval optional drop-down list (defaults to the optimal number of records on reports); interval=option Refers to the BInterval component, which the framework uses to identify the time between values in a trend (time series). When specified, a rollup is required, which causes the system to combine all values that fall into a single interval.

Options range from None to a Year.

Above the drop-down list, the Use This Value check box turns on and off the check box next to Interval in the Settings window (you access this window by clicking the Edit button (Image), followed by clicking the Settings button (Image) on the chart). The availability of this check box provides an easy way for a user to enable and disable the use of intervals in chart calculations.

Time Range drop-down list or ORD parameter (defaults to Today (current value);timerange=option

This property is required for rollup requests (analyticRollup), trends (analyticTrend), and rollup bindings. It is optional elsewhere.

It is not used if the block’s Use Request Time Range property is true and the request specifies a time range.

Options range from From to All.

Response example

{"responses" : [
{
  "message" : "GetTrend",
  "node" : "hierarchy:/TridiumBuildings",
  "data" : "hs:power",
  "timerange" : "yesterday",
  "interval" : "hour",
  "rows" : [
    [
      "2016-05-17T00:00:00.000-04:00",
      "1611.7379056215286",
      "ok"
    ],
    [
      "2016-05-17T01:00:00.000-04:00",
      "1644.921025633812",
      "ok"
    ],
    [
      "2016-05-17T02:00:00.000-04:00",
      "1686.7962741851807",
      "ok"
    ],
    [
      "2016-05-17T03:00:00.000-04:00",
      "1695.273845076561",
      "ok"
    ],
…
    [
      "2016-05-17T23:00:00.000-04:00",
      "1688.156940460205",
      "ok"
    ]
  ]
}
]}

Response elements

Response Elements Value Description
message text Identifies the type of request being returned.
Aggregation check box (if optional, and) drop-down list (property, defaults to First) or ORD parameter (aggregation=option)

If aggregation is not enabled in the binding/settings window, the aggregation value defined in the Data Definition applies to all chart bindings, reports and tables.

And returns the logical “and” of Boolean values.

Avg returns the statistical mean, which is determined by calculating the sum of all values and dividing by the number of values.

Count returns the total number or quantity of values in a combination. If you request this value on a binding in a PX view, the system counts the number of values based on the properties defined by the data source block and the algorithm’s Property Sheet.

First returns the first value in the combination.

Last returns the last value in the combination.

Max returns the highest value in the combination.

Median returns the value in the middle of a sorted combination—the number that separates the higher half from the lower half.

Min returns the lowest value in the combination.

Mode returns the statistically most frequently occurring number in the combination.

Or returns the logical “or” of Boolean values.

Range returns the statistical difference between the largest and smallest values in the combination.

Sum adds together all values in the combination resulting in a single value.

Load Factor returns the average value divided by peak value.

Std Dev returns the standard deviation of the values in the combination.

Data algorithm (or tag) name; data=algorithm or tag name Specifies the an algorithm (or tag) used to retrieve data.

The purpose of an alert is to detect a fault condition (Boolean value result). In most cases, you would pick an algorithm that has a Boolean result when configuring this property for an alert. Algorithms with a numeric or enum value greater than zero are considered true and less than zero are considered false.

This is how output from one algorithm becomes the input data source to another algorithm. The prefix for algorithms is alg:.

falseText text Returns descriptive word(s) when the result is false, such as offor closed.
Interval optional drop-down list (defaults to the optimal number of records on reports); interval=option Refers to the BInterval component, which the framework uses to identify the time between values in a trend (time series). When specified, a rollup is required, which causes the system to combine all values that fall into a single interval.

Options range from None to a Year.

Above the drop-down list, the Use This Value check box turns on and off the check box next to Interval in the Settings window (you access this window by clicking the Edit button (Image), followed by clicking the Settings button (Image) on the chart). The availability of this check box provides an easy way for a user to enable and disable the use of intervals in chart calculations.

Max number Returns a numeric value.
Min number Returns a numeric value.
Node or node (required) ORD (defaults to a relative ORD slot, which is resolved against the config space to which the Px view is assigned) Defines the ORD to the desired slot.
Range string Identifies an enum range as a list of string values.
Rollup check box (if optional, and) drop-down list or ORD parameter (when configured in the data definition, defaults to First, when configured elsewhere, defaults to the value as defined in the Data Definition); rollup=option

If rollup is not enabled in the binding/settings window, the rollup value configured in the Data Definition applies to all chart bindings, reports and tables.

And returns the logical “and” of Boolean values.

Avg returns the statistical mean, which is determined by calculating the sum of all values and dividing by the number of values.

Count returns the total number or quantity of values in a combination. If you request this value on a binding in a PX view, the system counts the number of values based on the properties defined by the data source block and the algorithm’s Property Sheet.

First returns the first value in the combination.

Last returns the last value in the combination.

Max returns the highest value in the combination.

Median returns the value in the middle of a sorted combination—the number that separates the higher half from the lower half.

Min returns the lowest value in the combination.

Mode returns the statistically most frequently occurring number in the combination.

Or returns the logical “or” of Boolean values.

Range returns the statistical difference between the largest and smallest values in the combination.

Sum adds together all values in the combination resulting in a single value.

Std Dev calculates the standard deviation of the values in the combination.

Load Factor calculates the average divided by peak (Max) value.

rows list of row lists The columns of each row list are : Timestamp (ISO-8601–encoded timestamp), Value and Status.
Time Range drop-down list or ORD parameter (defaults to Today (current value);timerange=option

This property is required for rollup requests (analyticRollup), trends (analyticTrend), and rollup bindings. It is optional elsewhere.

It is not used if the block’s Use Request Time Range property is true and the request specifies a time range.

Options range from From to All.

trueText text Returns descriptive word(s) when the result is true such as on, or open.
Type or type boolean, numeric, enum, string, formula, data definition Defines or returns the object type, which depends on where you are in the system.
unit unit=option (unit of measure) Selects the unit name and display symbol to associate with a data source.