# Using Adafruit IO Actions to Make an IoT Door Detector

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/136/745/medium800thumb/proximity_Comp_1_4_1.jpg?1746809605)

Is someone sneaking into your lab or workshop? Are family members raiding your secret chocolate drawer? Are your colleagues taking all your shiny new Adafruit components without asking first?

Using Adafruit IO, you can get notified by Email or SMS (paid Adafruit IO plans only) when a door or drawer opens.

In this guide, you will create a door detector project by uploading Adafruit's [open-source Wippersnapper firmware](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper/welcome-to-wippersnapper) to a Raspberry Pi Pico WH, connecting it to [Adafruit IO](https://io.adafruit.com/welcome), and using the Adafruit IO web interface to add a door sensor component to your board. Next, you'll create a new Action on Adafruit IO to email you when the door opens. Finally, you'll customize and configure the Action to send a message to your inbox.

### **This project can be built without programming or soldering!**
# Required Parts:

The microcontroller board chosen for this project is the Raspberry Pi Pico WH, a powerful little beast with 2MB of flash and the RP2040 as the main processor. In addition, it comes with 2.4GHz Wireless networking support (the W in the model name), and pre-soldered pin headers (the H in WH).

Wippersnapper supports a [wide variety of microcontroller boards](https://www.adafruit.com/search?q=wippersnapper&c=851), so feel free to try an alternative combination.

### Raspberry Pi Pico WH - Pico Wireless with Headers Soldered

[Raspberry Pi Pico WH - Pico Wireless with Headers Soldered](https://www.adafruit.com/product/5544)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico WH**....

In Stock
[Buy Now](https://www.adafruit.com/product/5544)
[Related Guides to the Product](https://learn.adafruit.com/products/5544/guides)
![Angled shot of green rectangular microcontroller with a Wi-Fi module and pre-soldered headers.](https://cdn-shop.adafruit.com/640x480/5544-02.jpg)

To complete the no-soldering promise, it's recommended to use a screw-terminal companion board for the pico:

### Adafruit Terminal PiCowbell for Pico with Pre-Soldered Sockets

[Adafruit Terminal PiCowbell for Pico with Pre-Soldered Sockets](https://www.adafruit.com/product/5907)
Ding dong! Hear that? It's the PiCowbell ringing, letting you know that the new **&nbsp;Adafruit Terminal PiCowbell** &nbsp;is finally in stock and ready to assist your&nbsp;[Raspberry Pi Pico](https://www.adafruit.com/product/4864)&nbsp;and&nbsp;<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/5907)
[Related Guides to the Product](https://learn.adafruit.com/products/5907/guides)
![Angled Shot ](https://cdn-shop.adafruit.com/640x480/5907-02.jpg)

Or if you prefer your own headers and the Terminal PiCowbell to require soldering, then pickup this one instead:

### Adafruit Terminal PiCowbell for Pico - Reset Button & STEMMA QT

[Adafruit Terminal PiCowbell for Pico - Reset Button & STEMMA QT](https://www.adafruit.com/product/5904)
Ding dong! Hear that? It's the PiCowbell ringing, letting you know that the new **Adafruit Terminal PiCowbell** is finally in stock and ready to assist your [Raspberry Pi Pico](https://www.adafruit.com/product/4864) and <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/5904)
[Related Guides to the Product](https://learn.adafruit.com/products/5904/guides)
![Angled shot of rectangular prototyping PCB lined with green terminal blocks and mounting holes.](https://cdn-shop.adafruit.com/640x480/5904-00.jpg)

Next, the main star of the show is the humble **Reed Switch,** or [Magnetic contact switch](https://learn.adafruit.com/make-it-switch/other-types-of-switches#step-2993506) as it's commonly known.

A pre-wired magnetically activated switch in one piece, and a matching magnet in the other piece, this gives a really easy way to detect two surfaces meeting. It can be used for so many things, from the obvious door or window being open, to the more secretive hidden cupboard or interactive puzzle in an escape room; the limit is your imagination.

### Magnetic contact switch (door sensor)

[Magnetic contact switch (door sensor)](https://www.adafruit.com/product/375)
This sensor is essentially a reed switch, encased in an ABS plastic shell. Normally the reed is 'open' (no connection between the two wires). The other half is a magnet. When the magnet is less than 13mm (0.5") away, the reed switch closes. They're often used to detect when a...

In Stock
[Buy Now](https://www.adafruit.com/product/375)
[Related Guides to the Product](https://learn.adafruit.com/products/375/guides)
![Top view of magnetic contact switch with three screws.](https://cdn-shop.adafruit.com/640x480/375-01.jpg)

If they are out of stock then try a local retailer/distributer, [DigiKey](https://www.digikey.com/en/products/detail/adafruit-industries-llc/375/6691113), or last resort grab some from Amazon (MC-38):

### Part: Magnetic Reed Switch Wired Normally Open (NO)
quantity: 1
Contact Sensor Alarm Magnetic Door Switch with 2 Wires, ABS
[Magnetic Reed Switch Wired Normally Open (NO)](https://www.amazon.com/Magnetic-Switch-Window-Contact-Normally/dp/B09ZTP1S4Q/)

To **power the system** use a good quality USB Micro-B ended data cable. This is required for installing the firmware, be careful not to use a charge-only cable, but one can be used later during final physical deployment.

### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

Alternatively the VSYS pin can accept 1.8volts to 5.5volts, which is internally used by the Switched-Mode Power Supply (SMPS) to generate the 3.3V for the RP2040 and its GPIO. To easily locate the VSYS pin look at the pin silkscreen labels on back of the Terminal PiCowbell (or check [the pinout photos in the product learn guide](https://learn.adafruit.com/adafruit-terminal-picowbell-for-pico/pinouts)).

For now, it's best to power the device with a mains-powered USB adapter to avoid worrying about battery recharging, but you could explore using a 3xAA battery case with switch and JST-PH 2 pin connector.

### 3x AA Battery Holder with On/Off Switch and 2-Pin JST

[3x AA Battery Holder with On/Off Switch and 2-Pin JST](https://www.adafruit.com/product/4779)
Here's another addition to our growing family of&nbsp;[AA battery holders](https://www.adafruit.com/category/563). Behold! A&nbsp;holder for three (3) AA batteries! It's got&nbsp;a 6" long genuine JST-PH 2-pin cable connector, an On/Off switch, and, oh yes, it's in...

In Stock
[Buy Now](https://www.adafruit.com/product/4779)
[Related Guides to the Product](https://learn.adafruit.com/products/4779/guides)
![Angled shot of 3 x AA battery holder with on-off switch and JST SH connector.](https://cdn-shop.adafruit.com/640x480/4779-02.jpg)

### JST PH 2-Pin Cable – Male Header 200mm

[JST PH 2-Pin Cable – Male Header 200mm](https://www.adafruit.com/product/3814)
For a really long time we assumed that the JST PH didn't have a free-hanging male header version. But then we found this **JST-PH 2-pin Male Cable,** and we were like,&nbsp;_this is perfect!_ It's not a genuine JST connector, but it's 100%...

In Stock
[Buy Now](https://www.adafruit.com/product/3814)
[Related Guides to the Product](https://learn.adafruit.com/products/3814/guides)
![Top view shot of JST PH 2-Pin Cable - Male Header - 200mm.](https://cdn-shop.adafruit.com/640x480/3814-02.jpg)

Warning: Although the current Wippersnapper firmware (version 1.0.0-beta.100 as of May 1st 2025) is not yet optimised for low power battery usage, it is firmly on the roadmap, so don't forget to check back in the future and install the latest available Wippersnapper update.

# Using Adafruit IO Actions to Make an IoT Door Detector

## Assembly

Attaching the components is relatively straightforward; just be careful to align the rows of pins slowly together when mating the two boards. I find it easiest to rest one set first against their mating socket, not yet inserted, and then slowly lower the other half into place and verify that alignment, re-adjusting if necessary.

- Verify that the Pin labelled 1 on the **Pico WH** aligns with the Pin labelled 1 on the **Terminal PiCowbell** , then connect the boards together carefully (insert both pin rows at the same time with even force)  
  
- The next steps require a **small flat headed screwdriver** (approximately 2mm)  
  
- Attach one wire of the&nbsp; **Magnetic Contact Switch** to the screw terminal for Pin&nbsp;`GPIO 13` (or chosen pin)  
  
- Attach the other wire of the **Magnetic Contact Switch** to a ground pin terminal (labelled `GND`)

![A Raspberry Pi Pico W H with pin 13 connected to the reed switch and the other wire to ground. The Pico is mounted on a Screw Terminal PiCowbell](https://cdn-learn.adafruit.com/assets/assets/000/136/582/medium640/adafruit_io_picowh-door-latch-reed_bb.png?1746130253)

If not using a USB cable to power the Pico, then wire your connector into the Terminal PiCowbell, for example the Male JST-PH 2-pin connector wires to VSYS and GND (do not connect the battery yet).

On the next page, the firmware (software) will be installed onto the microcontroller, and then afterwards move on to configuring the Wippersnapper device and switch component, and finally setup an automated Action to send the notification message.

# Using Adafruit IO Actions to Make an IoT Door Detector

## Install WipperSnapper

Warning: 

## What is WipperSnapper

WipperSnapper is a firmware designed to turn any WiFi-capable board into an Internet-of-Things device without programming a single line of code. WipperSnapper connects to [Adafruit IO](https://io.adafruit.com/), a web&nbsp;platform designed ([by Adafruit!](https://www.adafruit.com/about)) to&nbsp;_display_,&nbsp;_respond_, and&nbsp;_interact_&nbsp;with your project's data.

Simply load the WipperSnapper firmware onto your board, add credentials, and plug it into power. Your board will automatically register itself with your Adafruit IO account.

From there, you can add&nbsp;_components_&nbsp;to your board such as buttons, switches, potentiometers, sensors, and more! Components are&nbsp;_dynamically&nbsp;_added to hardware, so you can&nbsp;immediately start interacting, logging, and streaming the data your projects produce without writing code.

## Sign up for Adafruit.io

You will need an Adafruit IO account to use WipperSnapper on your board. If you do not already have one, head over to [io.adafruit.com](https://io.adafruit.com/) to create a&nbsp;_free_ account.

## Add a New Device to Adafruit IO

Log into your [Adafruit IO](https://io.adafruit.com/) account. Click the _New Device_ button at the top of the page.

![](https://cdn-learn.adafruit.com/assets/assets/000/112/548/medium800/wippersnapper_setup__board_selector__web__new_device_1.png?1655919766)

After clicking New Device, you should be on the _board selector_ page. This page displays every board that is compatible with the WipperSnapper firmware.

![](https://cdn-learn.adafruit.com/assets/assets/000/112/550/medium800/wippersnapper_setup__board_selector__web__selector_maion.png?1655920178)

In the board selector page's search bar, search for _Pico W.&nbsp;_ Pick either the Pico W or Pico 2W as needed.

Click the&nbsp;_Choose Board_&nbsp;button to bring you to the self-guided installation wizard.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/979/medium800/microcontrollers_Pico2Wboardpicker.png?1733489694)

Follow the step-by-step instructions on the page to install Wippersnapper on your device and connect it to Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/117/111/medium800/adafruit_io_wizard_raspi.png?1671126255)

If the installation was successful, a popover should appear displaying that your board has successfully been detected by Adafruit IO.

Give your board a name and click "Continue to Device Page".

![](https://cdn-learn.adafruit.com/assets/assets/000/117/112/medium800/adafruit_io_name_board.png?1671126389)

You should be brought to your board's device page.

![](https://cdn-learn.adafruit.com/assets/assets/000/117/114/medium800/adafruit_io_empty_device_page.png?1671126432)

## Feedback

Adafruit.io WipperSnapper is in **beta** and you can help improve it!

If you have&nbsp; suggestions or general feedback about the installation process - visit [https://io.adafruit.com/support](https://io.adafruit.com/support), click _"Contact Adafruit IO Support"_ and select _"I have feedback or suggestions for the WipperSnapper Beta"._

## Troubleshooting

If you encountered an issue during installation, please try the steps below first.

If you're still unable to resolve the issue, or if your issue is not listed below, get in touch with us directly at [https://io.adafruit.com/support](https://io.adafruit.com/support "https://io.adafruit.com/support"). Make sure to click&nbsp; _"Contact Adafruit IO Support"_ and select "_There is an issue with WipperSnapper. Something is broken!"_

### 

First, make sure that you selected the correct board on the board selector.

Next, please make sure that you entered your WiFi credentials properly, there are no spaces/special characters in either your network name (SSID) or password, and that you are connected to a 2.4GHz wireless network.

If you're still unable to connect your board to WiFi, please [make a new post on the WipperSnapper technical support forum with the error you're experiencing, the LED colors which are blinking, and the board you're using.](https://forums.adafruit.com/viewforum.php?f=66)

### 

Try hard-resetting your board by unplugging it from USB power and plugging it back in.

If the error is still occurring, please&nbsp;[make a new post on the WipperSnapper technical support forum with information about what you're experiencing, the LED colors which are blinking (if applicable), and the board you're using.](https://forums.adafruit.com/viewforum.php?f=66)

## "Uninstalling" WipperSnapper&nbsp;

WipperSnapper firmware is an application that is loaded onto your board. There is nothing to "uninstall". However, you may want to "move" your board from running WipperSnapper to running Arduino or CircuitPython. You also may need to restore your board to the state it was shipped to you from the Adafruit factory.&nbsp;

### Moving from WipperSnapper to CircuitPython

Follow the steps on the [Installing CircuitPython page](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython) to install CircuitPython on your board running WipperSnapper.

- If you are unable to double-tap the RST button to enter the UF2 bootloader, follow the _"Factory Resetting a WipperSnapper Board"_ instructions below.

Uploading this sketch will overwrite WipperSnapper. If you want to re-install WipperSnapper, follow the instructions at the top of this page.

### Moving from WipperSnapper to Arduino

If you want to use your board with Arduino, you will use the Arduino IDE to load&nbsp;_any_ sketch onto your board.

First, follow the page below to set up your Arduino IDE environment for use with your board.

[Setup Arduino IDE for Pico W](https://learn.adafruit.com/rp2040-arduino-with-the-earlephilhower-core/installing-the-earlephilhower-core)
[Connect your Pico W to Arduino IDE](https://learn.adafruit.com/rp2040-arduino-with-the-earlephilhower-core/connecting-your-rp2040)
Then, follow the page below to upload the "Arduino Blink" sketch to your board.

[Upload a sketch to Pico W from Arduino IDE](https://learn.adafruit.com/rp2040-arduino-with-the-earlephilhower-core/installing-a-sketch)
Uploading this sketch will overwrite WipperSnapper. If you want to re-install WipperSnapper, follow the instructions at the top of this page.

### Factory Resetting a WipperSnapper Board

Sometimes, hardware gets into a state that requires it to be "restored" to the original state it shipped in. If you'd like to get your board back to its original factory state, follow the guide below.

[Resetting RP2040 Flash Memory](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#resetting-flash-memory)
# Using Adafruit IO Actions to Make an IoT Door Detector

## Configure Wippersnapper

![](https://cdn-learn.adafruit.com/assets/assets/000/136/584/medium800/adafruit_io_image.png?1746204571)

This guide page assumes that&nbsp;you have Wippersnapper installed, your board is Online, and you are currently looking at the boards Device Info page. If you need to locate the page, visit [io.adafruit.com/devices](https://io.adafruit.com/devices) and click on your board to be taken to the device page.

Warning: If your board is not online, then reboot it and double check the secrets.json file contains the correct values. If you need a fresh secrets file then download a new one using the **Set up Secrets file** step of the Web installer.

Still not online? Ideally connect a serial monitor, or use a [web-based one](https://webserial.io/), to view the diagnostic messages from the board.
A really low supply voltage can sometimes cause the flash memory to corrupt and the device erases any saved settings (like the WiFi secrets).

From the boards device page, use the **New Component** button to bring up the New Component dialog.&nbsp;

Wippersnapper supports a wide variety of components, currently over 100 input and output devices.

To quickly find your Magnetic Contact Switch, referred to as a 'Reed Switch' in the component picker, type `Magnetic` into the search bar, then select the&nbsp; **Reed Switch** component from the search results.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/583/medium800/adafruit_io_image.png?1746203744)

Now on the&nbsp; **Create Reed Switch Component** dialog, select the pin used for the switch e.g. `GPIO 13`.

Now select the **On Change** option for _Return Interval_, as opposed to Periodically (on a time schedule).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/585/medium800/adafruit_io_image.png?1746204731)

Finally select the checkbox for&nbsp; **Specify Pin Pull Direction?** and then choose&nbsp; **Pull Up** from the dropdown, followed by clicking the&nbsp; **Create Component&nbsp;** button. The dialog should look like the image below:

![](https://cdn-learn.adafruit.com/assets/assets/000/136/586/medium800/adafruit_io_image.png?1746204939)

Now you'll be welcomed with the new component displayed on the boards device page.

Notice the graph symbol and settings cog in the top right of the component panel, click the first to be taken to the components feed page, and the second to go to the configuration options (Edit Component dialog).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/587/medium800/adafruit_io_image.png?1746205242)

You will probably find that the&nbsp; **Closed** and **Open** labels for the component are the wrong way compared to the current switch state. That's no problem, use the settings cog to reconfigure the reed switch component, and update the labels and icons to your preferred options.

The reason is that the default label for 0 volts (or a Low digital signal) is "Closed" assuming a Normally Closed switch, while it's recommended to do the the opposite (a Normally Open switch) as it's the one usually stocked.&nbsp;

Electrically this is connecting the reed switch between ground (0 volts) and the input pin (Pin 13), and the input pin has a pull up resistor enabled raising it up to 3 volts if nothing is attached. This means the input pin will sink to 0 volts when it becomes attached to ground as the switch is closed / activated (assuming a Normally Open switch).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/589/medium800/adafruit_io_image.png?1746205645)

At this point it's worth mentioning that a devices configuration can be **export** ed (then those exports can be **import** ed by other users even on a different device), or use the new **Magic-Config** option to automatically configure any components built-in to your microcontroller board (like the built in button and LED).

You can find each of these options under the **Auto Config** button at the top of the device page.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/590/medium800/adafruit_io_image.png?1746233082)

Here I've exported the config for my device. Notice the icon names are actually font-awesome glyphs!

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Adafruit_IO_Reed_Switch/rpi-pico-w112213141.json

Now that you have the contact-sensor wired up and sending data to Adafruit IO, you can move on to creating an automated reactive **Action** to send you a notification when the sensor is triggered.

# Using Adafruit IO Actions to Make an IoT Door Detector

## Create an Action

Visit [the&nbsp; **Actions** page](https://io.adafruit.com/actions) 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.**

![](https://cdn-learn.adafruit.com/assets/assets/000/136/747/medium800/proximity_arrows_Screenshot_2025-05-09_190904.png?1746814286)

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.&nbsp;

_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 ⁉️

![](https://cdn-learn.adafruit.com/assets/assets/000/136/600/medium640/adafruit_io_image.png?1746542045)

![](https://cdn-learn.adafruit.com/assets/assets/000/136/601/medium640/adafruit_io_Screenshot_2025-05-06_153330.png?1746542069)

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&nbsp;`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&nbsp; **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).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/603/medium640/adafruit_io_Screenshot_2025-05-06_154212.png?1746543025)

## What is a trigger and what kinds of triggers are supported?
Triggers are important for two reasons. First, they define the condition(s) to match that cause the action to fire.

Second, actions have a&nbsp; **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.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/605/medium800/adafruit_io_image.png?1746548402)

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&nbsp; **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.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/733/medium800thumb/proximity_chrome_spljuhSnZu.jpg?1746801594)

Move it into position (click and drag) to get in into the top Triggers: section of the root block in the diagram.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/734/medium800thumb/proximity_chrome_gqQdvHINEU.jpg?1746801630)

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).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/735/medium800thumb/proximity_chrome_jbtfrTm5ia.jpg?1746802041)

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 (=).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/612/medium800/adafruit_io_image.png?1746549609)

## 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](https://accounts.adafruit.com/settings/phone) (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).&nbsp;The [IO+ paid upgrade](https://io.adafruit.com/plus) 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).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/624/medium800/adafruit_io_image.png?1746551876)

## Create an Email Notification Block
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.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/742/medium800thumb/proximity_chrome_obRon3d2fC-ezgif.com-cut.jpg?1746804651)

The Email block is initially composed of template blocks shown by the double opening curly braces&nbsp;`{{`, with text or paragraph blocks nested inside the template blocks.

This allows variables and other things to be substituted for placeholders, for example using&nbsp;`{{ 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.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/628/medium800/adafruit_io_QF3u0YvFm9.png?1746552419)

Enter a subject and body for the email, anything that feels appropriate, maybe try using the placeholders...

![](https://cdn-learn.adafruit.com/assets/assets/000/136/641/medium800/adafruit_io_image.png?1746553877)

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&nbsp; **Save** button to update the Action, when asked just choose **Enable and Save**.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/634/medium800/adafruit_io_image.png?1746552867)

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&nbsp; **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!

![](https://cdn-learn.adafruit.com/assets/assets/000/136/637/medium800/adafruit_io_YNrJ2DLxar.png?1746553339)

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.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/639/medium800/adafruit_io_mUVySZuBrl.png?1746553666)

![](https://cdn-learn.adafruit.com/assets/assets/000/136/719/medium800/adafruit_io_1chrome_PiZhcqMx5D.png?1746635131)

# Using Adafruit IO Actions to Make an IoT Door Detector

## Usage

This should be a relatively quick final testing process as the action has already been tested.

I like to have either the Wippersnapper device page open (so I can see it's components and status), or the feed page for the switch, or both! Sometimes the IO pages get stale (they use a live connection) so it's a good idea to refresh the tab/window if it's been open for a while or isn't showing data.

Then open the door (or whatever) to trigger the magnetic contact switch, then watch the status change on the device page and a new data point arriving on the feed page.

Very shortly afterwards an email will be winding it's way into your inbox, it can take a few seconds for the phone to check for new emails (as you can see below in the video), but expect that ping momentarily...

https://www.youtube.com/watch?v=uAKWo7g0Hq4

Your work here is done, nice one!

Maybe it's time to look through the Wippersnapper Essentials pages for your board!

You can find a handy **Docs** link beneath each board on the main Devices page.

Alternatively you could explore some crazier ideas with Actions on Adafruit IO.

Have a look at some of the other projects we have available on [Learn.adafruit.com](https://learn.adafruit.com/)&nbsp;for inspiration, or checkout some&nbsp;[community Playground notes](https://adafruit-playground.com/).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/746/medium640/proximity_image.png?1746811216)

## Troubleshooting 🔬

These kinds of Actions are relatively new for Adafruit IO, so if you run into trouble, have a quick go at troubleshooting yourself and then [pop over to the forums](https://forums.adafruit.com/viewtopic.php?t=218077) and let us know as much as you can tell us about the issue.

If I were you, I would probably duplicate the action in a new one (disabling the first one) and see if it works, then, also adding data manually to trigger it, failing that, break the problem (and action) down into smaller chunks.

Check the logs from the Run Now button inside the Edit action page, and use the information (ℹ️) button on the Actions list page for a more detailed overview. See the [end of the previous page](https://learn.adafruit.com/iot-open-door-detector-using-notifications-with-adafruit-io/automated-actions#running-your-action-3198067) for details.

Lastly, also verify the hardware and expectations with a&nbsp;[multimeter](https://www.adafruit.com/category/637)!


## Featured Products

### Raspberry Pi Pico WH - Pico Wireless with Headers Soldered

[Raspberry Pi Pico WH - Pico Wireless with Headers Soldered](https://www.adafruit.com/product/5544)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico WH**....

In Stock
[Buy Now](https://www.adafruit.com/product/5544)
[Related Guides to the Product](https://learn.adafruit.com/products/5544/guides)
### Adafruit Terminal PiCowbell for Pico with Pre-Soldered Sockets

[Adafruit Terminal PiCowbell for Pico with Pre-Soldered Sockets](https://www.adafruit.com/product/5907)
Ding dong! Hear that? It's the PiCowbell ringing, letting you know that the new **&nbsp;Adafruit Terminal PiCowbell** &nbsp;is finally in stock and ready to assist your&nbsp;[Raspberry Pi Pico](https://www.adafruit.com/product/4864)&nbsp;and&nbsp;<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/5907)
[Related Guides to the Product](https://learn.adafruit.com/products/5907/guides)
### Magnetic contact switch (door sensor)

[Magnetic contact switch (door sensor)](https://www.adafruit.com/product/375)
This sensor is essentially a reed switch, encased in an ABS plastic shell. Normally the reed is 'open' (no connection between the two wires). The other half is a magnet. When the magnet is less than 13mm (0.5") away, the reed switch closes. They're often used to detect when a...

In Stock
[Buy Now](https://www.adafruit.com/product/375)
[Related Guides to the Product](https://learn.adafruit.com/products/375/guides)
### 3 x AAA Battery Holder with On/Off Switch and 2-Pin JST

[3 x AAA Battery Holder with On/Off Switch and 2-Pin JST](https://www.adafruit.com/product/727)
This battery holder connects 3 AAA batteries together in series for powering all kinds of projects. We spec'd these out because the box is slim, and 3 AAA's add up to about 3.3-4.5V, a very similar range to Lithium Ion/polymer (Li-Ion) batteries and have an on-off switch. That makes...

In Stock
[Buy Now](https://www.adafruit.com/product/727)
[Related Guides to the Product](https://learn.adafruit.com/products/727/guides)
### JST PH 2-Pin Cable – Male Header 200mm

[JST PH 2-Pin Cable – Male Header 200mm](https://www.adafruit.com/product/3814)
For a really long time we assumed that the JST PH didn't have a free-hanging male header version. But then we found this **JST-PH 2-pin Male Cable,** and we were like,&nbsp;_this is perfect!_ It's not a genuine JST connector, but it's 100%...

In Stock
[Buy Now](https://www.adafruit.com/product/3814)
[Related Guides to the Product](https://learn.adafruit.com/products/3814/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)

## Related Guides

- [Adafruit Terminal PiCowbell for Pico](https://learn.adafruit.com/adafruit-terminal-picowbell-for-pico.md)
- [Arcade Stick Conversion](https://learn.adafruit.com/arcade-stick-conversion.md)
- [Bass MIDI Stomp Box](https://learn.adafruit.com/midi-bass-synth-stomp-box.md)
- [No-Code Counters and Email Reports with Adafruit IO Actions](https://learn.adafruit.com/no-code-counters-and-email-reports-with-adafruit-io-actions.md)
- [Soundbox RP2040](https://learn.adafruit.com/soundbox-rp2040.md)
- [Air Quality Sensor 3D Printed Enclosure](https://learn.adafruit.com/air-quality-sensor-silo-house.md)
- [Scannable Links with NFC](https://learn.adafruit.com/scannable-links-with-nfc.md)
- [Build a Cloud-Connected ESP8266 Power Meter](https://learn.adafruit.com/build-a-cloud-connected-esp8266-power-meter.md)
- [Adafruit APDS9960 breakout](https://learn.adafruit.com/adafruit-apds9960-breakout.md)
- [Fog Machine with Motion Sensor and Adafruit IO](https://learn.adafruit.com/fog-machine-remote-trigger.md)
- [Blinka LED Sign](https://learn.adafruit.com/blinka-led-sign.md)
- [Holiday IoT Switch](https://learn.adafruit.com/holiday-iot-switch.md)
- [IoT Bird Feeder with Camera](https://learn.adafruit.com/iot-window-bird-feeder-with-camera.md)
- [Raspberry Pi SelfieBlock](https://learn.adafruit.com/selfieblock.md)
- [No-Code Indoor Air Quality Monitor with Separate Display](https://learn.adafruit.com/no-code-indoor-air-quality-monitor-with-separate-display.md)
