Weather Station

You can download the tutorial’s final sample project from this Github Page: https://github.com/myvobot/examples/tree/master/weather_station

Introduction

Let’s say you are going to use the SyncSign as a fridge magnet. It will let you know the weather condition before breakfast every morning.

Then you can write a Plug-in runs on Hub, which inquires the local weather at 8 am every day, then render the icon and text on the SyncSign.

The Plug-in consists of these components:

  • Periodic HTTP Request to the Web API of weather information

  • Usually, the response is a JSON format result

  • Parse the JSON and extract the data you need (temperature, humidity, etc.)

  • Create a layout and send it to the SyncSign

Setup

  • Sign-up a free account and obtain an API Key from [OpenWeatherMap](https://home.openweathermap.org/api_keys)

  • Replace the placeholder of OPENWEATHERMAP_APIKEY with your API key

  • Edit CITY_NAME & COUNTRY_CODE

Deploy and Run the Plug-in

Then you can deploy the code to the Hub and see what would happen.

Summary

In this tutorial, you have learned how to write a Hub App with web service integration. We hope you enjoyed this tutorial, and I look forward to seeing you again!