Skip to main content

Conditional statements

Conditional statements are used to add intelligence to the automation. They can be found in the Logic section of the editor and include several custom logic controls for dates and time. In the example below a If then else block is inserted and the if part is connected to an and/or block where you can insert two conditions. In this case two time conditions are used based on the value of the sunset and sunrise time obtained from the OpenWeather weather service. This information is then used to control garden lighting connected to the Tuya platform.

Wildcard control

When you have a lot of devices it is not practical to include all devices individually. Instead you can use a wildcard pattern such as office.htc.garden.*.on. All topics that match this pattern are updated to the specified value.