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 AccountIf you haven’t already got one, click here to sign up.
Setup a SpaceOnce 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.
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.
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.
- 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.
- 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
.
- 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. Note: You can see more variables by clicking theShow variables panel
link.
- Click
Update
to save your changes.
- Click on the white diamond shape at the bottom of the Event node and drag the line to the input of the Output node.
Go to Devices
and select the Device your would like to add the Flow to.Click on Flows
in the subnav then click on Enable
beside 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.
Comments
Please log in or sign up to comment.