For situations where an integer value is relating to a state/status (e.g. 1 = Clear, 2 = Caution, 3 = Warning, etc) it can be helpful to display the corresponding status rather than the integer value. To do this:
- From ExoSense, click on Configuration
- Click on Insights at the top
- Click on the** + **button and select Create New Custom Insight Function
- Name the function and give it a brief description
- For the Input, enter a name and description and select Numeric as the Primitive Type leaving the Data Type(s) and Unit unchanged
- For the Output, enter a name and description and select String as the Primitive Type, again leaving Data Type(s) and Unit unchanged. See example picture below:
- Delete any Constant that is currently set
- Under the Logic section, select MathJS for the Library and use the following, tweaking the integer values and states as necessary:
(A == 1)?"Clear":(A == 2)?"Caution":(A == 3)?"Warning":(A == 4)?"Critical":"error"
- Click Save to create the Insight Function
You are now ready to use this Insight Function on your signal. To apply this Insight Function to a signal, we will need to add a transform to your signal. To do this:
- Navigate to your asset in ExoSense
- Click on Modify Asset Config in the top right
- Select the three-dot menu on the signal you want to apply this Insight Function to and select Add Transform
- Change from the Standard Insights Module to your custom Insights Module
- Select your newly made function from the drop-down list
- Click Save to apply the change
You should see now that there is a transform under your original signal that is ready to be used.