How to Temboo with your Yún
Temboo makes it easy for the Arduino Yún to connect to over 100 web-based resources and services (e.g. Facebook, Dropbox, US Census data) by standardizing how you interact with their Application Programming Interfaces (APIs). Don’t worry if you’re not familiar with APIs—with Temboo you don’t have to worry about the details.
Here we’ll show you how to use Temboo by creating a simple Arduino Yún sketch that retrieves weather information for a specific address from the Yahoo Weather API. What makes Temboo uniquely powerful and useful is that, once you know how to use one API, you know how to work with any API in our Library.
Before you start, you’ll need to download and install the Arduino IDE. Make sure you’ve downloaded the version compatible with the Yún.
You’ll also need to connect your Yún to the internet. If you need help with that, take a look at Arduino’s documentation.
FIND WHAT YOU NEED
1 Log in to Temboo.
2 Go to our Library and find the Yahoo > Weather > GetWeatherByAddress Choreo.
The Yahoo GetWeatherByAddress Choreo in our Library
3Enter any complete address in the Address input field.
4Now click Run. After a moment you’ll see the data that Yahoo Weather sends back shown in the Output section of the page (which is right below the Input section).
The output from the Yahoo Weather API (which is in XML format)
MAKE YOUR ARDUINO SKETCH
When you run a Choreo from the website, Temboo automatically generates code that can be used to make the same API call from an Arduino Yún sketch.
5Turn on IoT Mode, select Arduino Yún, and scroll down to the code section of the Library page.
The IoT Mode switch can be found on each Choreo page in the Temboo Library
6Scroll down to the CODE section of the Library page. Then Copy the code, and paste it into a new sketch in the Arduino editor.
REMEMBER TO CREATE YOUR HEADER FILE
In order to run this sketch on your Yún, it needs to be configured with an appropriate
TembooAccount.h header file that contains your Temboo account information.
To create the header file:
7Make a new tab in the Arduino editor, and name it
8Beneath the sketch code you previously copied from the Library, you’ll find a header file containing three
#definestatements. Copy the contents of the header into your
The TembooAccount.h header file
RUN THE SKETCH AND REJOICE
Save and upload your sketch to the Arduino Yún, and open the serial monitor. After running the sketch, you’ll see the response from the Yahoo Weather service printed to the monitor.
Congratulations! This same approach will work with your Yún for all of our 2000+ Choreos. Because these ready-to-run tasks take care of so many steps, we named them after choreographies. Now that you know how to make your Yún run any Choreo, you’re just a few steps away from making something extraordinary. With Temboo handling all the small stuff, you’re free to think big.
You can find lots of examples of how to use Temboo with your Yún here.
Finally, if you’d like to run this, or any other Temboo sketch, via wi-fi or ethernet (as opposed to the USB cable), then you should read this tutorial.
We’re always happy to help. Just email us at firstname.lastname@example.org, and we’ll answer your questions.
Control your FAN remotely
SuperHouseTV #12: Building an Arduino home automation controller
Yun based Electricity Monitor with Cloud Support / Temboo and Google Drive
Linkio: the $100 Smart Home Devices Solution