Visit the Actions page on Adafruit IO, using the navigation menu at the top (or "burger" menu in the top left of a smaller display).
Click the button to create a New Action.
A dialog will pop up.
Give your action a Name for your action, along with an optional Description.
Click the Create button to set up your action.
Why should I give my action a name and description?
- Both of these will be displayed in the actions list, along with being used for searching/filtering actions in the list.
- Notice how my actions without descriptions in the screenshot above are very unclear as to their exact functionality. Don't make the same mistake!
- We support an extended character set, so feel free to use emojis ⁉️
Once created, you'll be forwarded to the Edit Action page.
From here you'll add the required trigger block(s) in the top section of the diagram (labelled Triggers:
on the main "root" block in the diagram), followed by the main actions blocks in the Actions section of the diagram (labelled Actions:
on the main root block).
Once the diagram has been altered then the additional option for Save changes appears, and the Run Now button will become the Save and Run button.
Finally by running the Action using the Run Now button you will see if everything is working as intended, and it also gives some useful information to help diagnose any issues with your action diagram (like previous outputs).
Triggers are important for two reasons. First, they define the condition(s) to match that cause the action to fire.
Second, actions have a cooldown period. So every time an action matches the trigger, it's action blocks are executed and then the cooldown is activated (currently 5 seconds), at which point the trigger conditions will be ignored until the cooldown period is over.
Triggers themselves don't affect the cooldown period, and therefore it makes more sense to have any pre-requisite conditions of your automation (like a dial changing to a certain position) in the trigger section of the diagram.
If you do it the other way with the trigger matching any data, and then have your condition in the main action body instead of the trigger section, it results in rapid trigger events being ignored if they come within 5 seconds of the last event.
Now you've understood the why, it's time to look at how...
Pick the Triggers category from the toolbox / side panel. The first trigger is for scheduled actions, and using the Blue bordered Cog button can be adjusted from "Every" to "At" (for a specific minute/hour etc). The next two should be obvious, as a new data point comes in to a feed that you select it will trigger the action, and then if a feed matches a certain value in the second case.
The main trigger worth reading about / explaining for this project is the third data related one, which offers the Starts
drop-down, where I've moused-over (hover) to show the tooltip. It allows you to trigger based on the previous value compared to the new incoming one.
The last two blocks are for the conditions, the first (blue background) is for numerical comparisons, and the final one (teal green background) is for comparing text values (notice the paragraph block). Use these with the trigger blocks that require them (swap numeric with text blocks if needed).
Setting up the Trigger
You will want to select (click on) the trigger block that says When [ Feed ] gets data matching [ = [ 0 ]]
and it will collapse the toolbox and the block will be on the diagram.
Move it into position (click and drag) to get in into the top Triggers: section of the root block in the diagram.
Use the Feeds dropdown inside the trigger block you've placed to select the Feed name that matches your Wippersnapper Device and Reed Switch component (if you only have one feed it will be selected already).
Change the number conditional, enter the value 1 in the value box (assuming your switch sends the value of 1 when the door contact switch opens - otherwise use zero) and leave the operator selected on Equals (=).
Setting up the Notification Block
There are currently three ways to send a notification from Adafruit IO:
- via an email to the address registered (and verified) in your Adafruit account settings
- via a text message (SMS) to your registered and verified phone number (settings -> services)
- and finally using a webhook to a third-party service (sends a message to a web server).
The SMS option is reserved for paying customers of Adafruit IO (and phone numbers in the USA and Canada only). The IO+ paid upgrade to Adafruit IO offers far more generous limits along with additional Power-Ups like SMS's and Apple WeatherKit® (available as a block in the Weather section).
Grab (click and drag) the Email block from the Notifications section of the toolbox/side panel, and drop it into the Actions:
section of the main "root" block. It should lock into place and no longer be greyed out once correctly situated. The child blocks will stop being "shadow" blocks (dimmed) when they get a value populated.
The Email block is initially composed of template blocks shown by the double opening curly braces {{
, with text or paragraph blocks nested inside the template blocks.
This allows variables and other things to be substituted for placeholders, for example using {{ user.name }}
would be replaced with your name. You can try sending an email (or use the Log block under the Utility category) with {{user}}
and {{feeds}}
and {{vars}}
in the email body as a template to see the available options.
Enter a subject and body for the email, anything that feels appropriate, maybe try using the placeholders...
Notice the template blocks (denoted by the {{
label) have become solid now, along with the string block denoted by "
, and paragraph block supporting multiple lines denoted by the P
block label.
Click the Save button to update the Action, when asked just choose Enable and Save.
When you first create an action, it will be disabled / turned off. This is to protect you (and us) from accidentally leaving under-construction actions running, imagine an accidental rocket launch!
The first time the action is saved, you'll be asked if you wish to enable the action at the same time, alternatively, it can be toggled on and off from the Actions list page.
Running the Action and Seeing the Output
Using the Save and Run button, or Run Now button, causes a forced run to immediately take place.
This skips the triggers entirely (no waiting for a trigger to receive data, or slow schedules)!
A results dialog is presented showing the the output of the action, along with a few previous runs.
Click the Run Now button and the action should report the output, in addition to sending your email!
Now return to the Actions list page and find your action in the list.
Click on the information icon at the end of the row to view more details about the Action's last run.
Page last edited May 09, 2025
Text editor powered by tinymce.