Kickass Braindump & Musings

Everything I Want The World To Know (and some stuff I want to remember)

Octoblu Development on a Tablet

Getting Started With Octoblu Part 2 – Giving Your Flows A Voice

What Will I Do for $5?

Im excited to get started on this one, but if you haven’t gotten a chance to check out my description of the IoT… pause this, and go check out the Intro Here  and then come back, I promise its worth the wait.

Since we will be working with the Demo Flow again, it would be a good idea to check out this tutorial  before getting started here, but its not mandatory.

At the end of this tutorial, you will have sent yourself a text message with the stock price of Citrix, and sent yourself an email with the current temperature in Miami Florida. If you didn’t follow along with the Demo Flow tutorial, and you haven’t modified the Default Flow, you’ll be sending yourself an email with the temperature in Chandler, Arizona and you’ll be text messaging yourself the last Stock Price of Google’s public stock.

Lets Move some of these nodes out of the way, I won’t disconnect them, but Ill just drag each of the debug nodes a little bit further away (up or down) from the main flow.

The weather and stock services are available for you to use the instant you signed up, but they weren’t the only ones. If you click on the “Nodes” Section of the Design Console, you’ll be presented with a list of available actions filtered to “Operators”, but if we click on Configured, we get a different filtered list, and an even more comprehensive list when we click  “available”.

Available is a library of every pre configured action (question) or response that Octoblu currently supports. Most of them will need to be attached to your account in some way like your Twitter or Instagram account, but the configured, and operators are available to us without having to do anything more at this point.

Lets add an instruction to send ourselves a text message by dragging the “Send SMS” service on to the designer, so that we can tell the Stock Price and Weather services how to talk to my cell phone.

Once the icon appears on the designer, lets select it (if its not already selected) to bring it up in the Node Inspector. The name TextBox should be familiar to you by now (but if its not, just hang in there). Lets change the name to “Send CTXS Price to Cell”. We will not be forwarding the message so lets leave that toggle switched off, and we will not need to filter the endpoints (what is an endpoint you ask: watch this) since there is only 1 available.

Now we’ve reached the important part. Octoblu is asking us a few things that are new.

First – Its asking for a phone number. We’ve only put text in these boxes so far. Then, if you notice the “Destination Number(s)” field is telling us that we can give it more than one phone to notify at a time.

Second – Its asking for a Message. In the watermark text, you might notice an unfamiliar set of text that looks like this {{msg.values}}.

When the Stock Price Service sends the Price of Citrix Stock to my Phone. But, as I’m sure you can imagine… this Stock Price Service doesn’t speak a language called “Cell Phone” or “Text Message” and the cellphone doesn’t speak a language called “Yahoo Stock Price Answer”.

This is why the {{msg.value}} text is important. When Octoblu packages up the answer it gets in a way that its going to send some information along one of those squiggly lines to a new action, its does so in a way that we can translate the Stock Price answer into a Cell Phone Question.

Lets go back to the Node inspector and try this translation thing out…

IN the Destination numbers field – put your whole phone number without any dashes, spaces, or parentheses. Also, Make sure to include your country code. An Example for an American phone number might be  19546461111

Then in the message field, lets tell the Cell Phone Service how to translate the Yahoo Stock Price, and place it inside a text message.

To do that, Copy the following text into the Message Field:

The Last Stock Price of Citrix was: {{msg.price}}

To connect services together we have to create one of those squiggly lines, or data paths. So click and hold on the grey box that starts the connection between the StockPrice Service and its Debug Service and drag over to the input (left) side of the Cell Phone Service. When you’re over the gray box (your cursor will change to a +), let go of the mouse and a connection will be made between the two services. 

Now, since we’ve made some changes to the Flow, we want to make sure those changes get saved to the version that is running, so we have to Stop the flow by pressing the stop button, waiting for it to become a solid red, and then clicking the play button and waiting until its solid green.

Then, when you click the trigger, you should see the nodes pulse as they ask their questions and gather their answers. A few seconds later – you should get a text Message telling you what the last known price of Citrix Stock is.

As promised, we are going to give a voice to the answer the the Weather Service responds with.

Lets take the time to point out that this is a pattern, that should begin to feel repetitive.

Lets Head back over to the design console, Select the Nodes Option, and the Configured sub menu item. Lets drag a “Send Email Service” on to our design service and hook it up like we did with the Cell Phone Service. Make sure the Email service is selected and Head Up to the Node Inspector. For the name lets call it “Email Me the Temp in Miami”. We wont need to forward the message, or to filter the end points since there is only 1.

In the text box named “To” go ahead and type your own personal email address.

Then we’re gonna cheat a little bit again and just type:

The Temperature in Miami is: {{msg.temperature}}

Now drag a data path from the Weather Service to the Email Service the same way as we did from the Stock Price to the cell phone.

Stop the flow, and restart it to make sure the newest version is running.

Once the Green Play button is solid, hit the trigger and you should receive a Text Message with the last stock price of Citrix (which might be different than the last if the market is open) and you should receive an email that says something like

The Temperature in Miami is: 90.87

And just like that you’ve given your machines and web services a way to communicate with you!!!!

How does it feel to be an IoT Solutions Designer? Pretty Cool Huh!?!?

[ssm_form id=’53’]


Leave a Reply

Sign Up For my Udemy Course: 'Automating Your Social Life'