Cycle Timer Action
Here you'll setup a single action to help with recording how long a washing machine cycle takes to complete, after the vibration is detected (usually in the final spin cycle). You'll handle notifications later in the guide.
Create a new feed to store notification status
Before creating the Action, you need a new feed to hold the notification status. You'll set the value of the feed to "almost-washed", "washed", or "hungout", depending on the state of the system, and respond to that in another action.
Visit the Feeds page using the navigation menu, or by visiting https://io.adafruit.com/feeds/, and then use the New Feed button to create a new feed.
Give it an unambiguous name and description for your future benefit, like "washer-notify".
Create the Cycle Monitoring Action
Start by visiting the Actions page using the navigation menu, or going to https://io.adafruit.com/actions/.
Then click the New Action button and fill in a useful name like 'Washing Cycle Timer' & description.
You'll be taken to the new action's edit page, and be presented with the Actions workspace.
Visit the documentation site regularly for the latest guidance on the available block types and usage.
From the toolbox panel on the left side of the workspace, open the Triggers category, and then drag the "When feed data matching = 0" trigger block onto the main workspace area.
The trigger block you've just dragged + dropped actually goes in the Triggers section of the Root block, and the top connectors lock together along with the target block gaining a yellow highlight when correctly placed.
Then use the feed dropdown, inside the trigger block, to select the Vibration Switch feed, probably called "Adafruit FunHouse: Round Vibration Switch"
Now, as you've got buttons and a display, you'll set the action to use the last button press time.
Then depending if that button is pressed more recently than the last detected vibration, you'll update the display to one of two message templates, along with setting the value of the 'washing-notify' feed.
Start by adding a new variable from the Variables toolbox category called vibrated, then dropping a Set Variable block into the Actions: section.
Then from the Text category, drag the Text Template block ({{ label) and use it to replace the value of the Set Variable block.
Update the text of the template block to this, but with your feed's key instead of mine (details below).
It fetches the updated_at time in seconds for the vibration feed:{{
feeds['funhouse1782526.ws-003'].updated_at
| date: '%s'
}}
To find your feed key visit the Feed Page for your feed and click Feed Info.
Get there quickly either by clicking the graph icon from the device page, or searching the Feeds List page (where on larger displays the second column also shows the feed key).
Then copy the feed key from the Feed Info dialog, under "Show detailed feed JSON record", or from the last path segment of the URL for the feed page.
Create a second variable, to store the time of the start button press, called started.
Exactly the same template as before, but use the FunHouse: Up Button feed key.
Create a third variable called ended, exactly the same template again, and this time use the Down Button feed key.
Your action should look like this before continuing.
Next it's on to the logic section. If you only use one button then you'll need to make minor adjustments.
Start by adding an If/Else/Else-If block from the Logic category of the toolbox into the Actions: section.
Next grab a Numerical Comparison block ( 0 = 0 ) from the Maths toolbox category and replace the IF comparison block (the 'True' dropdown).
Drop a Get Variable block into each half of the new comparison block.
Update the comparison to be "started" > "vibrated".
Click the + next to the phrase "Else If" to add a new Else-If section to the logic block.
Do the same with the Else section to add a third (fallback) option.
Next, replace the Else-If conditional block (another 'true' dropdown) with a Numeric Comparison block, and utilize the Get Variable blocks to do another similar comparison of "ended" > "started".
At this point, it's worth adding in two extra Trigger blocks, to capture When Any Data arrives for both the Up and Down buttons on the FunHouse, and then update the screen message.
Your Action should look like this before continuing:
Now for the Display templates! There's one minor caveat that will improve in the near future when we add Time related blocks, but for now this template includes a hard-coded timezone offset (5h x 3600s = 18000) to render times in GMT instead of EST. You could instead use a variable or feed and update it more easily.
Drop a Set Feed block into the first nested do section beneath the IF.
Replace the child value block of the set feed block with a Text Template block.
Set the template to be this (with the 18000s offset adjusted for your timezone):
Started:
{{ vars.started | plus: 18000 | date: '%H:%M:%S' }}
No Cycle
recorded.
<-- Hung/End
Update the feed dropdown for the Set Feed block to point to the Display.
Repeat for the nested do section of the Else If, using this template:
<-- Start
Started:
{{vars.started | plus: 18000 | date: '%H:%M:%S' }}
Last Cycle:
{{vars.vibrated | plus: 18000 | date: '%H:%M:%S' }}
Ended/Hung:
{{vars.ended | plus: 18000 | date: '%H:%M:%S' }}
And again for the final do section of the Else, using this template:
Started:
{{vars.started | plus: 18000 | date: '%H:%M:%S' }}
Last Cycle:
{{vars.vibrated | plus: 18000 | date: '%H:%M:%S' }}
<-- Hung/End
Add another Set Feed block to the Else-If section. Publish the value "hungout" to the washer-notify feed.
Do the same again for the Else section, but send the value of "almost-washed" to the same feed.
To avoid any issues with a second wash straight after, add another publish block for the If section, setting the washer-notify feed to "not-washed" (it doesn't matter as long as it isn't the two above which we track).
Your action should look like this before using the Save & Run button and continuing on to the next page.
Page last edited December 03, 2025
Text editor powered by tinymce.