We have buttons in several key areas (our cafe, restrooms, etc) when someone presses that button a text message is sent to our maintenance team letting them know that area needs to be cleaned up. The maintenance team member who is taking care of it sends a response letting the rest of the team know that the situation is being responded to.


If you're anything like us, you really want excellence throughout every part of our facility. On the weekends that can get really tough. I've seen those "Press if service is needed" buttons at places like Lowes and in restrooms and that got me thinking, what if we did that for our building?

While looking for a similar solution, I stumbled on this post: https://bwhbulletin.org/2017/11/02/cleaner-restrooms-with-the-push-of-a-button/

After digging around, I learned that Amazon offers programmable IoT one-click dash buttons for $20 each. https://aws.amazon.com/iotbutton/

Using these you could send a custom message to a phone number whenever the button is pressed. The service from Amazon is simple to configure and only costs $0.25 per month per placement.

We launched this using just SMS going to our facilities director but recently realized using Rock we could make it do much more.

We reconfigured the phone number to be our Rock text to workflow number and magic happened!

I hope some of you will find this helpful and you'll find ways to use this to do even cooler stuff!


0. Buy a button, or several: https://www.amazon.com/All-New-AWS-IoT-Enterprise-Button/dp/B075FPHHGG

Trust me, it won't be long until you want more of them.

1. Sign up for a Free Tier AWS account: https://aws.amazon.com/free/

You will need to enter billing info for the ongoing services for which they charge a quarter per month per button!

2. Download AWS IoT 1-Click App

The app is the only way that I've found to configure your devices. Only you as the admin will need this, but you'll use it every time you have a new button come online. You'll sign in using your account.

3. Claim your devices inside the app

You'll add the devices to your account and configure them to connect to your wifi (or they've got ones that support cellular too).

4. Create a project

Pretty basic stuff, give it a name--how about "RockAlerts"

Choose a template, they've already got one for button with the action of Send SMS

5. Add Placement Attributes - message and phoneNumber

The message is the text body content that is going to be sent to whatever number you have it send that text to. For us, all our messages start with Clean or Security (more on that later) followed by the area name. We do this so we don't have to create a new workflow for each new device we bring online.

You can put any SMS capable number in for the phoneNumber attribute and you can even customize it so different buttons send to different phone numbers.

6. Create Placements

Here you override the message to be something like "Clean Concourse Men's Restroom". We use this to identify which button got pressed and send a clear message to the system.

Now if all you wanted was it to send a text message to a single number, you're done! No Rock needed, if you'd like to take things futher, let's change the phoneNumber to our Rock Text-to-Workflow Number.


I'm going to assume you've already got text-to-workflow configured and working, if not see here: http://www.minecartstudio.com/Content/Documentation/TextToWorkflow/TextToWorkflow-1_0.pdf


My workflow for this is pretty simple.


Notification Group - this can be a group attribute (or a security role, if you're like me and want to save time)

FromPhone - Text attribute

FromPerson - Person attribute

MessageBody - Text attribute


I only had one activity for this workflow, so it's of course start.


1. Set person

Action Type: Attribute set to initiator

Person Attribute: FromPerson

Explanation: This is setting the person value if it can find that person in Rock. This little trick assumes that the number AWS texts from isn't in your database. That helps to know if the message came from AWS or a team member.

2. Parse Body Content

Filter: FromPerson Is Blank

Action Type: Attribute Set Value

Attribute: MessageBody

Text Value: {% assign RemoveString = Workflow | Attribute:'MessageBody' | Right:32 %}{{Workflow | Attribute:'MessageBody' | Remove:RemoveString}}

Explanation: This is just cleaning things up for the message from Amazon. They put the identifier info for the button in the message. This parses down to something easier to work with, like "Clean Concourse Men's Restroom"

3. Send Alert

Filter: FromPerson Is Blank

Action Type: SMS Send

From: Select your text to workflow number

Attribute Value: Notification Group

Message: {{Workflow | Attribute:'MessageBody' | Remove:'Clean '}} needs attention. If you're responding please reply "{{Workflow | Attribute:'MessageBody'}}"

Explaination: This sends a message if the workflow receives an alert from Amazon to the people you've selected that says "Concourse Men's Restroom needs attention. If you're responding please reply "Clean Concourse Men's Restroom" -- technically they can reply with anything that starts with the word clean and it will send that to the team. :)

4. Send Acknowledgement

Filter: FromPerson Is Not Blank

Action Type: SMS Send

From: Select your text to workflow number

Attribute Value: Notification Group

Message: {{Workflow | Attribute:'FromPerson' }} is responding to the {{Workflow | Attribute:'MessageBody' | Remove:'Clean '}}

Explaination: This sends an acknowledgment to the team that someone is responding. It only fires if the FromPerson is not blank, meaning it is someone who is in Rock that sent it. Like I said above, if they replied "Clean the pod bay doors" it would still fire and send that message out to the team. It's dumb in that way, or you could choose to call it efficient.

5. Complete

Action Type: Workflow Complete

Explaination: A clean home is a happy home!


You have to create a link between your text keyword and your workflow.

Under Defined Types, Text to Workflow

Add a new value with the phoneNumber you gave Amazon

Keyword Expression: Clean*

Workflow Type: Select the workflow you just created

Workflow Attributes:

FromPhone {{FromPhone}}

MessageBody {{MessageBody}}

Now hold your breath and press the AWS IoT Button.

Now, to make it a little more magical, if you have a 3D printer you can step this up some by making a nice holder. We did this and embossed our logo and basic instructions for what the button does. You can find the file we used here: https://www.thingiverse.com/thing:1993964


An idea we've toyed with is deploying this for LOW PRIORITY security alerts. We have some spots in our building where people or teams are in isolation--our reception area or our cafe. We could deploy this same structure to alert staff when there are potential issues. We have a working beta for this and have a button, we've not rolled it out yet because we need to establish protocols for how to respond when the button gets pressed. This system would send an alert to the staff, anyone responding would send back a keyword and the entire team would be told who is responding. Those who respond could also respond with an "All clear" when the situation is resolved.