Skip to content

Web Application - Admin User Manuals

Configuring the State Schema

9 min readUpdated

In this section, you will learn how to:

State schema is used for tracking and monitoring variables associated with a specific utility device or unit. For example, you are monitoring the performance of an AC unit, you can define:

  • Constants: fixed parameters such as the make, model, threshold temperature, and so on.
  • Variables: dynamic parameters such as actual/current temperature reading.

By applying a State Schema, you can establish rules to assess the unit's performance. For instance, you can configure the schema to monitor whether the actual temperature stays within the defined threshold. This setup helps you identify potential issues and ensures the AC unit operates optimally by displaying real-time status updates.

Adding a State Schema

  1. In the Main Menu, under the ADMIN OPTIONS, in the Misc Config subsection, click State Schema.
    ‎The State Schema page is displayed, with a list of configured state schema, if any.
  2. Click Add State Schema.
  3. Enter the Name* of the state schema. For example, Threshold temperature.
  4. Select the Color Schema* to be associated with the state schema.
  5. Enter a corresponding Unit for the state schema. For example, ℃ for Threshold temperature.
  6. Under Add/Edit State Schema Variables, enter or select the required field information.
    Field Description

    Variable*

    Enter a variable name.

    Digital Twin Property

    Select the Digital Twin property to be associated with this variable.

    Note: For more information on Digital Twins, click here.

    Flag Id

    Select the variable slot to be associated with this variable.

    Note: Flag IDs can be associated with the defined constants and variables. For more information on the Flag IDs, click here.

    Not Older Than

    Select the maximum duration beyond which the unit’s last reported state becomes invalid.

    For example, if you set this duration to 15 mins, any state older than 15 minutes will be considered invalid, and the unit will display the default state.

    Object Index

    Enter the index assigned to the object that was added under the insight unit for monitoring. This value must match the index defined for the same object in the Insight module (under Add Object section) to ensure proper data mapping.

    State Value Index

    Enter the state value index to be assigned to the variable. This value is mapped to the corresponding Data State in the Insight module and must be referenced accordingly.

    Random Generator  

    Select the random generator to be used for the state schema variable. For more information, click here.

    Label

    Enter a specific label to be associated with the variable.

    Unit

    Enter the unit to be associated with the variable.

    Hidden

    Select this checkbox to prevent the insight unit details (for example, the last updated state) from being displayed on the Insight Unit page when you hover over the Info icon icon under the Action column. The data remains stored in the system but is kept hidden.

  7. Click Add State Schema Variable.
    ‎The variable is added to the table.
  8. Repeat steps 4 and 5 to add more variables.
  9. Under Add/Edit State Schema Rules, enter or select the required field information.
    Field Description

    Priority*

    Enter the order in which the rule should be evaluated. Lower numbers indicate higher priority, meaning the system will check this rule before others.

    Condition

    Enter the conditional formula to ensure that this rule is skipped if the conditional formula returns a negative outcome.

    No Compute

    Enter one of the variables defined while adding the state schema variable.

    Formula

    Enter the formula for the schema. For more information on formulas, click here.

    Color Schema*

    Select the color schema to be applied for this rule.

    Note: For more information on color schema, click here.

    Unit

    Enter the unit of measurement for this rule. For example, degrees Celsius for monitoring AC temperatures.

    Random Generator

    Select a random generator to be used for this rule.

    Note: For more information on random generators, click here.

  10. Click Add State Schema Rule.
    ‎The rule is added to the table.
  11. Repeat steps 7 and 8 to add more rules.
  12. Once all variables and rules are defined, click Save.

Creating Formulas for State Schema

You can create different formulas based on your requirement. Formulas can be created using several operators and functions. For example, a formula could be something like ("3 * sin(y) - 2 / (x - 2)"), where x and y are the defined variables.

Here are some operators and functions that can be used for creating formulas (2 represents a variable):

Operators

Addition '2 + 2'

Used to add two values together. Returns the sum of the two numbers.

Subtraction '2 - 2'

Used to subtract the second value from the first. Returns the difference between the two numbers.

Multiplication  '2 * 2'

Used for scaling or repeated addition of variables or multiplying two values. Returns the product of the two numbers.

Division '2 / 2'

Used for dividing one variable by the other. Division by zero is not allowed and usually throws an error.

Exponential '2  2'

Used in the case of scaling or mathematical modeling.

Unary Minus, Plus '^+2 - (-2)'

These are sign operators, applied to single value. Used to explicitly mark positive or negative numbers, flip the sign of a value dynamically (e.g., -amount), or to handle cases where subtraction from a negative is required. Unary + keeps the value positive, unary - changes the value to negative.

Modulo '2 % 2'

Used for calculating the remainder of a division. For two numbers, a (dividend) and b (divisor), the operation \(a\quad (\bmod b)\) or \(a\%b\) returns the remainder after dividing \(a\) by \(b\). For example, \(10\%3\) is \(1\) because \(10\) divided by \(3\) is \(3\) with a remainder of \(1\).

Equals "=", 2, true

Used to compare the two values and determine whether they are equal. Returns true if the values are the same, false if they are different.

Not Equals "!=", 2, true

Used to compare two values and determine whether they are not equal. Returns true if the values are different, false if they are the same.

Greater Than ">", 2, true

Used to compare two values and determine whether the first value is greater than the second. Returns true if it is, false otherwise.

Greater Than or Equal ">=", 2, true

Used to compare two values and determine whether the first value is greater than or equal to the second. Returns true if it is, false otherwise.

Less Than "<", 2, true

Used to compare two values and determine whether the first value is less than the second. Returns true if it is, false otherwise.

Less Than or Equal ">=", 2, true

Used to compare two values and determine whether the first value is less than or equal to the second. Returns true if it is, false otherwise.

Logical AND "&", 2, true

Used to combine two boolean values and returns true only if both values are true. Otherwise, it returns false.

Logical OR "|", 2, true

Used to combine two boolean values and returns true if at least one of the values is true. Returns false only if both values are false

Functions

abs

Returns the absolute value of a number. Negative numbers become positive; positive numbers remain unchanged.

acos

Returns the arccosine (inverse cosine) of a value

asin

Returns the arcsine (inverse sine) of a value.

atan

Returns the arctangent (inverse tangent) of a value.

cbrt

Returns the cube root of a number. For example: cbrt(8) returns 2.

ceil

Returns the smallest integer greater than or equal to a number (rounds up).

cos

Returns the cosine of an angle.

cosh

Returns the hyperbolic cosine of a value.

exp

Returns e (Euler’s number, ~2.71828) raised to the power of a value.

floor

Returns the largest integer less than or equal to a number (rounds down).

log

Returns the natural logarithm (base e) of a value.

log2

Returns the logarithm of a value with base 2.

log10

Returns the logarithm of a value with base 10.

sin

Returns the sine of an angle.

sinh

Returns the hyperbolic sine of a value.

sqrt

Returns the square root of a number.

tan

Returns the tangent of an angle.

tanh

Returns the hyperbolic tangent of a value.

signum

Returns the sign of a number: 1 if positive, 0 if zero, -1 if negative.

isNull

Used to check whether the value of the variable is null, or not provided.

not

Used to reverse the value of the input or switch a state from “true” to “false” and vice versa. If the input is 0 (or false), it returns 1 (true). If the input is any value other than 0 (or true), it returns 0 (false).

iff

Used to return one value if a condition is true and another value if the condition is false. For example: if(null(a), 1, 5) returns 1 if a is null, otherwise 5.

greater

Used to compare two values and return the greater value of the two. For example: greater(1,5) returns 5.

smaller

Used to compare two values and return the smaller value of the two. For example: smaller(1,5) returns 1.

Adding a Random Generator

A random generator enables the simulation of data inputs, primarily for testing purposes, especially in a development environment or when real-time data is unavailable. For instance, if your devices are not currently generating data, random generators can be employed to simulate data input to validate system functionality during testing phases.

To add a random generator:

  1. In the Main Menu search bar, search for Random Generator.
    ‎The Random Generator screen is displayed.
  2. Click Add More.
  3. Enter or select the required field information.
    Field Description

    Name*

    Enter a name for the random generator. For example, Temperature

    Type*

    Select the type of random generator you want to create. For example, numeric, if you want to use this value for monitoring AC temperatures.

    Min Val*

    Enter a minimum value. For example, 21.

    Max Val*

    Enter a maximum value. For example, 27.

    Step Val*

    Select the interval between each value within the minimum and maximum values. For example, a step value of 1 means that the gap between two consecutive values that will be checked for is 1.

  4. Click Save.
  5. To edit a random generator, on the Random Generator page, under the Action column, click the Edit icon icon.
  6. Update the required fields and click Save.

Editing a State Schema

  1. In the Main Menu, under the ADMIN OPTIONS, in the Misc Config subsection, click State Schema.
    ‎The State Schema page is displayed, with a list of configured state schema.
  2. Under the Action column, click the Edit icon icon.
  3. Update the required fields. For more information on field descriptions, refer Adding a State Schema.
  4. Click Save.
Was this page helpful?