A calculated sensor allows you to create a calculation based on readings obtained from other sensors, which allows more flexibility in how you use your data. This lets you model or abstract any additional analysis you want and use this analysis any way a standard sensor can. A calculated sensor can drive rule faults, calculations, and conditional formatting.
Create the calculated sensor the way you would create any other sensor. Except, when selecting the data source, instead of selecting a device and object from IoT Hub, select a K2A formula/template or custom template calculation. There, you can configure the sensors you want to source for the calculation and specify the K2A calculation you want to perform. The output from that calculation will be your new calculated sensor.
Creating a Custom Calculated Sensor
To create a calculated sensor:
Access the Equipment or Systems Dashboard.
Select the Actions button and then select Add New Calculated Sensor.
The tabs available when creating a custom calculated sensor are:
Template: On the Template tab, you can create one or more templates based on a K2A formula or your custom formula. Keeping with the previous example, you can define what A and B are for each template for the selected equipment type. You can name the sensor and select additional sensor information at the template level or from the Assign tab. See Working with Templates below.
Assign: On the Assign tab, you can assign the template to one or more pieces of equipment. See Assigning Templates to Equipment below.
Working with Templates
A template contains pre-defined calculations that leverage formulas. You can create a template by selecting an existing formula or by selecting the Add icon to the right Company Templates. You can clone a K2A template or a Company template and then edit the template formula.
Explanation of each function and operator available in the Formula Builder:
Creating or Editing a Company Template
Access the Equipment or Systems Dashboard.
Select the Actions button and then select Add New Calculated Sensor.
Select the Templates tab.
You can create/edit a template by:
Selecting a formula to create a new template.
Selecting a K2A Template to edit.
Selecting the Add icon to the right Company Templates to create a new template.
Cloning an existing template. See Cloning a Template below.
Enter or select the following at the top of the screen:
Template Name: Enter a name for the template.
Equipment Type: The equipment type auto-populates from the equipment where you initiated the custom calculated sensor from.
Equipment: The equipment name auto-populates from the equipment where you initiated the custom calculated sensor from.
In the formula section:
You have the option to use functions to insert a function formula.
After inserting the optional function, choose each "Select Sensor Type" to select the sensor type associated with the equipment for your formula.
From the Select Sensor Type drop-down, you can add an external sensor for any of the current client's sites. (External sensors are created in the Sensor Configuration window. See Configure the Sensor Graph.)
You can use the operators across the top of the formula section to build your own formula and/or to add on to the function formula.
Enter or select the following information at the bottom of the screen. If you are using a K2A template or a cloned template, this information will auto-populate. However, you can edit these fields.
Sensor Name: Enter the custom calculated sensor name. This name will display in the list of available calculated sensors.
Sensor Type: Select the sensor type.
Data Type
Boolean
Integer
Float
Text
Display Data Type
Boolean
Integer
Float
Text
Raw Unit: See Raw Unit List for a detailed list of all raw units available.
Display Unit: The unit of measure that displays for the calculated sensor. Typically this defaults to the raw unit.
Select Test Calculation to verify the expression is valid. The tested calculation uses sample data to validate the formula and may not reflect actual results. The sample data is comprised of the first sensor value found for each sensor type in your formula.
Select Save Template.
You are not prevented from saving an invalid expression.
Cloning a Template
K2A templates cannot be edited. However, if you can clone a K2A Template and Company Templates and then edit the cloned template.
Click the ellipsis to the right of the template and then select Clone.
The editable template is loaded on the right side.
Enter the Template Name.
Edit the template formula as needed.
See the steps above for field descriptions.
Assigning Templates to Equipment
Assigning the template to equipment is the final step in creating your calculated sensor.
To assign a template to equipment:
Access the Equipment or Systems Dashboard.
Select the Actions button and then select Add New Calculated Sensor.
Select the Assign tab.
Select the Template from the drop-down.
The Equipment Type defaults from the template, or you can select the Equipment Type.
The Equipment associated with the equipment type is displayed by the client and site. The template can be assigned to equipment across multiple clients and sites for the current company.
Mark specific pieces of equipment or to select all equipment, mark the checkbox to the left of the Equipment header.
Select Preview Sensor.
The list of equipment is displayed to the right, with the template formula displayed at the top of the page. While the equipment, client, and site names are grayed out and cannot be edited, you can edit the other fields such as sensor name, sensors, and constants.
If the equipment has the sensor(s) defined on the template, these sensors will auto-populate in the equipment row.
If the equipment does not have the sensor(s) defined on the template, the sensor drop-down displays "Select Sensor" and you can select the appropriate sensor, or if the equipment does not have a substitute sensor, a dashed line displays. You can add an external sensor for any of the current client's sites. (External sensors are created in the Sensor Configuration window. See Configure the Sensor Graph.)
Mark the checkbox to the left of the equipment to which the calculated sensor should be assigned or select the checkbox to the right of the Equipment header to mark all.
You can edit the following fields that may default from the template:
Sensor Type: The type of sensor.
Data Type
Boolean
Integer
Float
Text
Display Data Type
Boolean
Integer
Float
Text
Raw Unit: See Raw Unit List for a detailed list of all raw units available.
Display Unit: The unit of measure that displays for the calculated sensor. Typically, this defaults to the raw unit.
Select Create Sensor.
Editing a Custom Calculated Sensor
A calculated sensor can be edited from the Sensor Overview from the Equipment or Systems Dashboard. The Formula Builder that was used during the creation process is used to edit the calculated sensor. You have the ability to view, edit, and create calculations on the fly within the sensor page. For information on how to use the Formula Builder, see Working with Templates above.
You are able to edit the following:
Sensor Name
Sensor Type
Data Type
Display Data Type
Raw Unit
Display Unit
Formula
You are only able to edit the formula for the current sensor. To add or save templates, you will need to use the Template tab from the Create Calculated Sensor window. See Working with Templates.
To edit a calculated sensor:
Access the Equipment or Systems Dashboard.
From the View dropdown, select Sensors, and then select Overview.
On the Overview page, the Source column provides information on the sensor source. Calculated sensors are indicated with a calculator icon along with the template name used for the calculation. If a template was not used for the calculation, Custom Calculation displays as the source name.
Select the ellipsis to the right of the Source column and then select Edit.
On the Edit Sensor page, the template is automatically selected in the list on the right with the formula displayed in the Formula Builder.
You can make the necessary changes that apply to this sensor only.
After you have completed your edits, select Test Calculation. You are required to test the calculation prior to saving the edited calculation.
Select Save.
Deleting a Custom Calculated Sensor
You can delete a custom calculated sensor from the Equipment or Systems Dashboard.
To delete a custom calculated sensor:
Access the Equipment or Systems Dashboard.
From the View dropdown, select Sensors, and then select Overview.
On the Overview page, the Source column provides information on the sensor source. Calculated sensors are indicated with a calculator icon along with the template name used for the calculation. If a template was not used for the calculation, Custom Calculation displays as the source name.
Select the ellipsis to the right of the Source column and then select Delete.
In the Delete Sensor window, you are prompted to verify that you want to delete the displayed calculated sensor.
Select Yes to delete the custom calculated sensor.