Debug Entity Functions
Sep 28 2022 at 12:00 AM
Delay
Function Description:
This function delays the value received from an endpoint for the specified duration. The function will only update to the value received after the delay duration has passed.
Function Structure:
![](/assets/images/commander/functions/delay.png)
Figure 1 - Delay
Inputs Required:
- Endpoint ID - It is the specific endpoint requiring a delay on value output. It can be of any data type.
- Time - This determines how long you wish to delay the endpoint value output for (HH:MM:SS).
Output Expected:
- Datetime - The value returned is in datetime format after the delay duration has passed.
Use Case Example(s):
Example 1:
Live Endpoint Datetime | Endpoint Value | Time | Delay Return |
---|---|---|---|
2022/01/01 00:00:00 | 50 | 00:04:00 | n/a |
2022/01/01 00:02:00 | 50 | 00:04:00 | n/a |
2022/01/01 00:04:00 | 52 | 00:04:00 | 50 |
2022/01/01 00:06:00 | 52 | 00:04:00 | 50 |
2022/01/01 00:08:00 | 52 | 00:04:00 | 52 |
2022/01/01 00:10:00 | 57 | 00:04:00 | 52 |
2022/01/01 00:10:00 | 60 | 00:04:00 | 52 |
2022/01/01 00:10:00 | 60 | 00:04:00 | 57 |
Example | Live Endpoint Datetime | Delay Duration (seconds) | Delayed Endpoint Datetime |
---|---|---|---|
2 | 2018/01/01 00:00:00 | 0 | 2018/01/01 00:00:00 |
3 | 2018/01/01 00:01:30 | 60 | 2018/01/01 00:02:30 |
4 | 2018/01/01 00:03:00 | 120 | 2018/01/01 00:05:00 |
Use Case Scenario(s):
1. If a fridge door has been left open for a period of time (ie. 5 minutes), notify the site manager.
2. If a generator loses more than 5% fuel capacity within ten minutes, notify security. At the same time, if the generator is being refilled at a rate of 5% every 3 minutes, send notification.