element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Enchanted Objects
  • Challenges & Projects
  • Design Challenges
  • Enchanted Objects
  • More
  • Cancel
Enchanted Objects
Blog Enchanted Wardrobe: Temboo Output Filters
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: iayanpahwa
  • Date Created: 9 Jun 2015 6:16 PM Date Created
  • Views 1163 views
  • Likes 2 likes
  • Comments 7 comments
  • enchanted_objects
  • enchanted_iot_devices
Related
Recommended

Enchanted Wardrobe: Temboo Output Filters

iayanpahwa
iayanpahwa
9 Jun 2015

In my last blog post I talk about fetching Weather Information of a desired location using Yahoo Weather API and TEMBOO services on Arduino Yun. The purpose of using Temboo like services in my Design challenge project is to make project as simple as possible and even simpler to replicate so we each can have our own Enchanted Wardrobe in homes image. Temboo makes it easy even for non-programmers to have a feel of IoT World and best part it comes pre-bundled with Arduino yun and other Arduino using Ethernet/Wifi/Gsm Shield and some more boards like TI-CC3200, Adafruit CC3000 wifi module and now even with Samsung Artik so you can probably make the same project with any one of them without actually modifying code, Temboo will handle that for you.

 

So progressing ahead, last time we were able to get Weather Information from Yahoo Weather API using Temboo's Choreo but as I mentioned the response from APIs are generally in some encoded form. Similarly Yahoo Weather API returns in  XML(eXtensible Markup Language) or JSON(Java Script Object Notation) which are definitely not human readable but the needed information can be extracted by Parseing this response. For ex to Parse JSON in python we use JSON library similarly we've an ArduinoJsonParser or XML parser library for Arduino which we can use, but Temboo provides more flexibility while handling parseing from APIs it uses in its choreos and similar operation can be performed easily by using what Temboo calls : "OUTPUT FILTERS". Output filters makes easy to parse XML or JSON response from APIs and extract the required information from the returned response container. Here we'll use XML based output filter and you'll see that it is as easy to append just two extra lines in our previous code. So Lets Get Started

 

Before moving Ahead, we should be aware about what different things we can parse from the Yahoo weather API. The WEATHER API by Yahoo provides the following information:

 

>Temperature

>Pressure

>HIGH MARK of Temperature in a day

>LOW MARK of Temperature in a day

>Humidity

>Visibility

>Condition Text(Like Cold/ThunderStorm/Haze etc)

>Condition Code which can be resolved from API's documentation on Yahoo's Website

 

Moving Ahead on Parseing:

 

Step 1>> Complete steps till last blog post image.

step2>> Login to Temboo Output Filter webpage, it can also be found on left hand side lowermost tabs on Temboo's homepage.

 

image

 

step 3>> Select XML or JSON if you've requested yahoo to return data in JSON.

step4>> Select Get Values from XML tab.

step5>> In node field you can type data to be extracted say 'temperature' and in XML field add the response(XML) you got from API(in previous blog program).

image

 

 

step6>> Alternatively you can add following lines of code before  GetWeatherByAddressChoreo.run(); function

 

   GetWeatherByAddressChoreo.addOutputFilter("temperature", "/rss/channel/item/yweather:condition/@temp", "Response");

   GetWeatherByAddressChoreo.addOutputFilter("code", "/rss/channel/item/yweather:condition/@code", "Response");

    GetWeatherByAddressChoreo.addOutputFilter("text", "/rss/channel/item/yweather:condition/@text", "Response");

 

This resolves Temperature, Code and Text from XML in similar fashion you can extract say Humidity.image

 

Will be adding a triggered sensor in the next one. Stay Tuned! image

  • Sign in to reply

Top Comments

  • iayanpahwa
    iayanpahwa over 10 years ago +1
    @Crejeder on IOT mode it supports Arduino Yun. arduino all boards with wifi and ethernet and gsm shields. texas Instruments CC3200 and all launchpds with CC3100 boosterpacks, read bear labs Bluetooth module…
  • iayanpahwa
    iayanpahwa over 10 years ago +1
    Yes Temboo stores the code on its server and you can access and change it anytime by login to you account, however for some special effects to take place u need to physically burn the new code foe ex changing…
  • iayanpahwa
    iayanpahwa over 10 years ago

    Yes Temboo stores the code on its server and you can access and change it anytime by login to you account, however for some special effects to take place u need to physically burn the new code foe ex changing ur phone number if using nexmo to give u phone call when an external event occurs can be changed on cloud but changing sensor threshold required to burn new code to the target it cannot be performed via cloud @Andy Clark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • crjeder
    crjeder over 10 years ago in reply to iayanpahwa

    thanks! I will give it a try (after the challenge) image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago

    There's Temboo and SpaceBrew pre-installed on the Yún. I've not looked into the differences between them but I know that they both use Python on the Linino side.

    I am a bit sceptical about these systems so it's good to see why and how they are used.

    Does the project get stored on the server in case you need to swap languages at some point and regenerate the code? How does the code generation work if you need to regenerate with different settings?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • iayanpahwa
    iayanpahwa over 10 years ago

    @Crejeder on IOT mode it supports Arduino Yun. arduino all boards with wifi and ethernet and gsm shields. texas Instruments CC3200 and all launchpds with CC3100 boosterpacks, read bear labs Bluetooth module with arduino, adafruit cc3000 wifi module with arduino and Samsung aetik. However you can use temboo to interact with API in different languages like Python and Node.js it can generate code without you needes to code api stuffs and then using temboo library for python n node you can port the code without any change to embedded linux devices like rpi or bbb and run it on them. Like i made a demo to post status on facebook when i press button n rpi i generated the fb code in pyhton using temboo and add button python script for rpi and using if else i tinker the code. You need to have temboo python library on root folder of your os. It also supports android n ios libraries and some other fancy languges like php. It can generate code in any of them image give it a try..

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • iayanpahwa
    iayanpahwa over 10 years ago

    @Dab Temboo is amazing! Do share your thoughs after uSing it image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube