Create a Guardrail

When setting up the Kelvin Platform, one of the initial tasks is to install an edge computer and establish two-way data transfer with your Assets.

Guardrails is a safety feature designed to prevent sending erroneous data to your Assets, whether through the API, the Kelvin UI, or automatically via a Kelvin SmartApp™. It acts as a final safeguard, overriding any data write decisions made by Operations or programs.

Reference:

Field Option Description
Control Enabled/Disabled or true/false This enables or disables the guardrail
Min/Max Value Number Number
Increase Min/Max Value Number The minimum or maximum value increase change allowed from the current value for the asset / data stream pair
Decrease Min/Max Value Number The minimum or maximum value decrease change allowed from the current value for the asset / data stream pair

In this brief demo you can see the basic method;

To start, click on Guardrails in the Contextualization section of the left side bar and click on the Create Guardrail button.

In Step 1 select an Asset / Data Stream pair then click Next to go to Step 2.

Success

When you select an Asset, you will be presented with a selection of Data Streams that have already been associated with the Asset in Connections.

In Step 2 you can select whether to enable the guardrail immediately and set the minimum and maximum values allowed.

Control

This option allows you to immediately enable this guardrail or opt to keep is disabled and enable it later.

Basic - Min/Max Values

This option sets the minimum and maximum values allowed for the Asset / Data Stream pair.

Warning

Any values sent to the Asset / Data Stream pair outside of this range will be automatically rejected and the original value will remain in the Asset's data.

Option Description
Static Value A fixed value
Data Stream A dynamic value set by the last value of a selected Asset / Data Stream pair

Advanced - Increase/Decrease Min/Max Values

This option defines the minimum or maximum allowable change in a data value for the Asset / Data Stream pair.

Warning

Any values sent to the Asset / Data Stream pair outside of this allowable change range will be automatically rejected and the original value will remain in the Asset's data.

Option Description
Static Value A fixed value
% of Last Value The min / max change rate will be base on the percentage of the last value of the Asset / Data Steam range

Then click the Create button.

Congratulations, you have created an Asset / Data Stream pair Guardrail.

Warning

Any values sent to the Asset / Data Stream pair outside of this min/max range will be automatically rejected and the original value will remain in the Asset's data.

Any values sent to the Asset / Data Stream pair outside of the defined allowable change range will be automatically rejected and the original value will remain in the Asset's data.

API cURL Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
curl -X 'POST' \
'https://<url.kelvin.ai>/api/v4/guardrails/create' \
-H "Authorization: Bearer <Your Current Token>" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"resource": "krn:ad:98-ac-01/motor_torque",
"control_disabled": false,
"number": {
    "min": {
    "value": 33,
    "inclusive": true
    },
    "max": {
    "value": 35,
    "inclusive": true
    },
    "relative": {
    "increase": {
        "min": {
        "value": 0.5,
        "inclusive": true,
        "type": "value"
        },
        "max": {
        "value": 1,
        "inclusive": false,
        "type": "percentage"
        }
    },
    "decrease": {
        "min": {
        "value": 0.5,
        "inclusive": true,
        "type": "value"
        },
        "max": {
        "value": 1,
        "inclusive": true,
        "type": "percentage"
        }
    }
    }
},
"updater": {
    "number": {
    "min": {
        "source": "krn:ad:asset1/setpoint-min",
        "inclusive": true
    },
    "max": {
        "source": "krn:ad:asset1/setpoint-max",
        "inclusive": true
    }
    }
}
}'

You will get a response similar to this;

API cURL Example Response
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
"number": {
    "min": {
    "updated_at": "2024-10-02T08:10:35.572028Z",
    "updated_by": "krn:user:user@example.com",
    "inclusive": true,
    "value": 33
    },
    "max": {
    "updated_at": "2024-10-02T08:10:35.572028Z",
    "updated_by": "krn:user:user@example.com",
    "inclusive": true,
    "value": 35
    },
    "relative": {
    "increase": {
        "min": {
        "type": "value",
        "value": 0.5,
        "inclusive": true
        },
        "max": {
        "type": "percentage",
        "value": 1,
        "inclusive": false
        }
    },
    "decrease": {
        "min": {
        "type": "value",
        "value": 0.5,
        "inclusive": true
        },
        "max": {
        "type": "percentage",
        "value": 1,
        "inclusive": true
        }
    }
    }
},
"updater": {
    "number": {
    "min": {
        "source": "krn:ad:asset1/setpoint-min",
        "inclusive": true
    },
    "max": {
        "source": "krn:ad:asset1/setpoint-max",
        "inclusive": true
    }
    }
},
"created_by": "krn:user:user@example.com",
"created_at": "2024-10-02T08:10:35.572028Z",
"updated_by": "krn:user:user@example.com",
"updated_at": "2024-10-02T08:10:35.572028Z",
"resource": "krn:ad:98-ac-01/motor_torque",
"control_disabled": false
}

Currently this is not possible in the Kelvin Python API client.