Timer Blocks
Boolean Delay
Introduction
The Boolean Delay logic block is used to delay the change of a boolean value (true / false). When the input boolean value changes, the output will sync with it only after a set delay time. You can set different delay times for true and false status separately.
This block does not change the original data. It only delays the output of status changes. This is helpful for debounce, delayed triggering, or requiring a state to be true or false for a certain period before running the next logic.
You can use the parameters “Delay when input is true” and “Delay when input is false” to control delay times. You can enter the delay directly, or connect a number-type input for more flexible automation.
Attribute Description
- Input / Output: Configured on the block
- Input: Connect the boolean data to the left side.
- Output: Connect the output to a node that stores boolean data on the right.
- On Delay / Off Delay: Double-click the block to enter the settings panel and configure the corresponding delay times.
- On Delay: Set the wait time (number type) for the true value.
- Off Delay: Set the wait time (number type) for the false value.
Example
Here is an example of turning on a light with a delay when someone enters a room, and turning off the light with a delay after the room is empty:
- Add a "Human Presence Sensor - Presence Status" (Boolean) as the input node on the left side of the canvas.
- Add a Boolean Delay logic block in the center of the canvas.
- Connect the output of the "Human Presence Sensor - Presence Status" to the input of the Boolean Delay block.
- Set the On delay to 2 seconds. This means when someone is detected, it will output true after a 2-second delay.
- Set the Off delay to 10 seconds. This means when no one is detected, it will output false after a 10-second delay.
- Add a "Light - Switch Status" as the output node on the right side of the canvas.
- Connect the output of the Boolean Delay logic block to the input of "Light - Switch Status".
With this setup, the system will turn on the light with a 2-second delay after detecting someone, and turn off the light with a 10-second delay after no one is detected. This helps prevent false triggers and makes your lighting control smarter.
Delay Event
Introduction
When you want to delay the next action until the previous one finishes, you can use this logic block. It allows you to add a delay between two actions easily.
How to Use
- Add the Delay Event logic block to your canvas.
- Connect the operation you want to delay to the
Fireinput of this block. - Double-click the block, and set the delay duration in the
Delay Timeparameter. - In the
Inputfield, enter or connect the data you want to pass along after the delay (this can be a number, string, etc.). - Connect the
Delay Eventoutput to the next node that needs to receive the delayed data. This completes the delayed triggering.
Example
Let’s take “delay 3 seconds to turn off the air conditioner after a door/window opens” as an example:
- Add a “Door/Window Sensor - State” point on the left of the canvas.
- Add a Delay Event block.
- Connect the output of the “Door/Window Sensor - State” to the
Fireinput of the Delay Event block. - Double-click the block, set the delay time to
3seconds, and set theInputto the value to turn off the AC (for example,false). - Add an “Air Conditioner - Switch State” node on the right side of the canvas.
- Connect the
Delay Eventoutput to theInputof the “Air Conditioner - Switch State” node.
With this setup, when the door or window is opened, the system will turn off the air conditioner after 3 seconds. This automation helps reduce energy waste.
Time Trigger
Introduction
The Time Trigger logic block is used to automatically trigger specific actions based on preset days and times. You can flexibly choose which days in a week and the exact time to trigger your devices. This makes scheduled automation, like turning devices on or off, simple.
Attribute Description
- Fire: Connect this output to the action you want to trigger.
- Days: Set which days of the week this trigger takes effect (multiple selection is supported).
- Time: Set the exact time for the trigger.
To set Days and Time, double-click the block to see the configuration panel, and then you can set the Value.
Example
For “open the curtain at 8:00 every morning”, follow these steps:
- Add a Time Trigger block to your canvas.
- Set
Daysto every Monday to Sunday (select all), and setTimeto08:00. - Add a “Curtain - Switch State” node on the right side as the target device.
- Connect the
Triggeroutput of the Time Trigger block to theInputof “Curtain - Switch State”. - Double-click the connection line to open the configuration panel, expand
Converter > Target, and open the toggle button of theValue.
In this setup, the system will automatically open the curtain at 8:00 every morning.
Time Period
Introduction
This logic block helps you check if the current time falls within a specified period (based on selected days, start, and end times). When the time is within the range, it triggers the “Match” branch; otherwise, it triggers the “Not Match” branch.
Attribute Description
- Attributes displayed on block:
- True: Connect the action to trigger when the time is in the specified range.
- Trigger: Connect the action that should trigger this check on the left side.
- Attributes hidden in configuration panel:
- Days: Set which days of the week the time period applies to (can select multiple).
- Start Time: Set the start time for the period.
- End Time: Set the end time for the period.
- False: (Optional)Connect the action to trigger when outside the range.
Example
For “turn on the conference room lights during working hours”, follow these steps:
- Add a "Light - Switch State" node to the left side of the canvas. This will be the action to turn on the lights.
- Add a Time Period logic block.
- Double-click the block, set
Daysto Monday through Friday. SetStart Timeto09:00andEnd Timeto18:00, so it only works from 9 AM to 6 PM on workdays. - Connect the output of the "Light - Switch State" node to the
Triggerport of the Time Period block. - In the
Truebranch, connect the input of "Light - Switch State" - Double-click the connection line to open the configuration panel. Edit the
ValueofConverter > Target, turn on the toggle switch in the popup, and make sure no Status is selected. So it will turn on during working hours.