This guide will walk you through the steps to configure automations for your microcontroller in both offline and online setups. Automations allow you to link sensor data with actuators, enabling automated responses based on specified conditions.
Before setting up automations, you must first configure the General-Purpose Input/Output (GPIO) settings for your microcontroller. If you haven’t done this yet, refer to the GPIO Configuration instructions first.
Step-by-Step Guide for Configuring Automations
1. Accessing the Automations Configuration Page
After successfully configuring the GPIO, follow these steps to set up automations:
Navigate to the automations section in the navigation bar.
You will be taken to the automation configuration page.
Once you are on the automation configuration page, you will see a table with six columns, allowing you to configure your automation rules for the offline setup. Here's how to configure each column:
Column 1: Sensor
Use the dropdown menu to select the sensor you want to monitor.
Sensors available in the dropdown list are those you configured earlier in the GPIO setup.
Column 2: Condition
In this column, select a condition that the sensor reading must meet to trigger the automation.
Conditions include:
Greater than (>)
Less than (<)
Equal to (=)
Column 3: Threshold
Manually enter the threshold value that the sensor reading must meet for the automation to trigger.
Example: If you want the automation to trigger when the temperature exceeds 30°C, input "30" in this field.
Column 4: Actuator
In this column, select the actuator that will respond when the sensor meets the condition.
This could be a relay, motor, or any other device connected to the microcontroller.
Column 5: Action
Set the action you want the actuator to take. You can choose between:
ON
OFF
Example: Turn the relay ON when the temperature exceeds 30°C.
Column 6: Add/Delete Row
Use the plus (+) button to add a new automation rule.
To remove an existing rule, click the delete (x) button in the same row.
Once you have configured all your automation rules, click the Save button to save the configurations.
The online automation setup is similar to the offline process, but with a few additional features and a slightly different interface:
Add New Automation Rule:
In the online setup, click the Add New button to create a new automation rule.
A modal pop-up will appear where you can configure the automation in the same manner as the offline setup.
Additional Option - Enable/Disable Rule:
In the online setup, you will have an additional option to enable or disable the automation rule.
Only enabled rules will be executed by the microcontroller.
Save Automations:
After configuring the automation rule, click the Save Automations button.
The rule will be added to the list of automation rules in the table.
Edit or Delete Automation Rule:
You can edit or delete any existing automation rules by clicking the Edit or Delete buttons in the last column of the table.
When setting up automations online, the automation rules will be saved to the cloud database. These rules will only be transferred to the microcontroller after the microcontroller's token has been successfully verified and it is connected to the online IoT platform.
If your microcontroller has existing offline automations that differ from the online automations, offline automations will be automatically deleted and replaced with the online configurations.
Only enabled automation rules will be transferred and applied to the microcontroller.