Before diving into creating your first Adafruit IO Action, you need to create some feeds to have a place to store the data. Head over to the Feeds page, and create a New Group.
Create a group to organize the new feeds, to make it easier to find them later. Click the New Group button and name it Habit Tracker:
In your feeds list, scroll down until you find the Habit Tracker group, then click on the name to view the group. Add in all of the feeds you will need for this project.
Start by clicking the New Feed button to create a new feed within this group.
Now to create a feed to store the name of each habit, and the status of each habit. You'll need the following feeds:
- habit_1_name
- habit_1_status
- habit_2_name
- habit_2_status
- habit_3_name
- habit_3_status
Next is a feed to store the total habit streak (how many days in a row you have completed all 3 tasks). Create a feed named habit_tracker_streak.
Go head and create each of these feeds until your feed group has all the correct feeds:
Next, in order for the Actions to work correctly, you need to set a starting value for each feed. So, pick 3 habits you want to track daily. In my case, I am going to track whether I have meditated, stretched, and taken a walk every day. So, to start with I am going to change habit_1_name to Meditate. To do this, click the name habit_1_name to go to the page for this feed. Then click the green Add Data button:
Then, in the VALUE field, enter the name of your first task, then click Create:
You should now see the name of your task at the top of the table at the bottom of this feed's page.
Now go through all of the feeds created earlier and enter a different task name for each of the habit names. Then for each of the habit statuses, change those to TODO. Finally, for the habit_tracker_streak, set that value to 0. When you are done, your group table should look like this:
Now that the feeds are set up, you can set up the Actions. On the top navigation, click Actions, then click New Action:
To start, create an action that triggers every time the left-most button on the MagTag is clicked. This will change the status of habit_1 from TODO to DONE. So, name the first action Habit 1 Button:
Start by setting up the trigger. In the triggers menu, choose the trigger for When a feed gest any data. Then change the dropdown to My MagTag: Button A.
Learn more about the Any Data trigger block: https://io.adafruit.com/actions-docs/blocks/triggers/when_data.html
The next thing to do is create a new variable that is called 'status':
Learn more about variables here: https://io.adafruit.com/actions-docs/blocks/variables/set.html
Next put together the full action as follows:
So this action will get triggered anytime Button A on the MagTag is pressed. Then it will check to see what the current value of habit_1_status is. If it is TODO, change it to DONE. Then, update the entire MagTag display. For Habit 1, here is how to set up what to send to the E-Ink display:
{{ feeds['habit-tracker.habit-1-name'].value }}: {{ vars.status }}\n{{ feeds['habit-tracker.habit-2-name'].value }}: {{ feeds['habit-tracker.habit-2-status'].value }}\n{{ feeds['habit-tracker.habit-3-name'].value }}: {{ feeds['habit-tracker.habit-3-status'].value }}\nStreak:{{ feeds['habit-tracker.habit-tracker-streak'].value }} Days
This might look complicated, but all this is doing is sending the name of each habit and the status of each habit to the display.
Those {{ ... }} curly brackets are placeholders. Think of them like snapshots that grab the latest values from Adafruit IO.
-
feeds[...]are the actual data feeds (like buckets that store your habit names and statuses). -
vars.statusis the variable set up, sets the feed to TODO or DONE. - When the MagTag updates, it swaps those placeholders with whatever’s inside the feeds right now.
So instead of hard‑coding “Meditate: DONE,” the MagTag is always showing live data from your Adafruit IO feeds.
Setting the Streak
The last action to set up is one that will run every night at midnight. It will set all of the habits back to TODO, and if you have completed all of your tasks for the day, it will increase the streak counter. If you didn't complete all of your tasks, it will set the streak to 0.
I created a new action called Habit Tracker Reset. Set up the trigger to run the action every night at midnight:
Learn more about the schedule trigger: https://io.adafruit.com/actions-docs/blocks/triggers/on_schedule.html
Every day at midnight, this action runs to manage your habits and streaks. It checks whether all three habits were marked as complete the previous day. If they were, the streak counter is increased by one; if not, the streak resets back to zero. After updating the streak, the action resets all three habits to “TODO” so you start fresh each day. Finally, it sets the MagTag display with all of the habits showing TODO and the updated streak count.
Page last edited November 06, 2025
Text editor powered by tinymce.