Hi All,
Today we're going to look at sending SMS messages from your IoT devices using Wia and Twilio.
P.S. If you want to see your devices on iOS and Android, pre-register here for our beta.
Create Your Wia Account
If you haven't already got one, click here to sign up.
Setup a Space
Once logged in, setup a new Space for your devices. I'm going to call mine My Devices
. When your Space is ready, you should see a screen like the one below.
Start Setting Up Integration
Open the Space dropdown, by clicking on the Space name in the top left corner, and click Settings
. Select Integrations
in the sidebar.
On the Twilio
row, click Setup
to begin setting up the integration.
Get Your Twilio API Keys
If you don't already have a Twilio account, click here to set one up for free.
- Go to the Twilio Console and login.
- In the
Project Info
panel, copy and pasteAccount Sid
andAuth Token
into the integration panel in Wia and clickCreate Integration
.
You will need to setup a phone number before you can setup SMS. Go to Phone Numbers and check you have one setup.
Create a Flow
- Go to the
Flows
and clickCreate Flow
. - Enter a name for your
Flow
. I'm going to call mineSend SMS For Temperature
. - You will then be redirected to the Flow Studio.
Add a Trigger Node
- In the Flow Studio, drag over an Event trigger node from the panel on the left.
- Select the node, enter
temperature
as the name of the Event in the panel on the right and clickUpdate
.
Add an Output Node
- Drag over an SMS output node from the Twilio section in the panel on the left.
- Select the node, then on the panel on the right, do the following:
- Choose your
From
phone number - Enter your
To
phone number (NOTE: enter the country code and have no spaces i.e. +14568893405). - Enter your
Body
message. I'm going to set mine asTemperature is ${event.data}
. This takes the temperature data from the Event. we are going to send. You can see more variables by clicking theShow variables panel
link. - Click
Update
to save your changes.
Connect the Nodes
- Click on the white diamond shape at the bottom of the Event node and drag the line to the input of the Output node.
Add Flow to Your Device
- Go to
Devices
and select the Device your would like to add the Flow to. - Click on
Flows
in the subnav then click onEnable
beside the Flow.
Run the Flow
Publish an Event from the Device and you will see the SMS message come through.
That's all folks!
P.S. If you need any help with getting setup, tweet us or email support@wia.io
References
Twilio is a developer platform for communications. Software teams use Twilio API to add capabilities like voice, video, and messaging to their applications. This enables businesses to provide the right communications experience for their customers.
Top comments (2)
Hey Conall, great quick tutorial here! I hadn't heard of Wia before, but that looks like a really easy way to set up IoT flows. I love how easy it is to connect with Twilio too!
Hey Phil! Thanks for the nice words!