Skip to main content
All CollectionsUser Guides
Plugins: Connect OpenWeather with Ubidots
Plugins: Connect OpenWeather with Ubidots

Add weather data to your IoT application in just a few clicks.

Sergio M avatar
Written by Sergio M
Updated over a week ago

OpenWeather is one of the leading digital weather information providers, with more than 2,000,000 active users, and data from over 200,000 cities—making it a great option to enrich your IoT application with weather data.

We've seamlessly integrated with OpenWeather's API so you don't have to, enabling you to use Ubidots to log weather data in just a few clicks:

Requirements

1. Creating an OpenWeatherMap's Plugin

In your Ubidots account, click on the "plugins" option under the "devices" navbar menu, then click on the "+" icon in the upper right corner and select OpenWeather:

Configure your Plugin according to these input settings:

1.1. Inputs

  • Location: Click on the map to specify your location.

  • Units format: Choose between "Metric" or "Imperial" units. See "output" below to see which units are used in each variable.

  • Your Ubidots token: Every plugin requires an Ubidots token to make all the requests that provision and update your device.

  • OpenWeather key (optional): If you have a subscription to One Call 3.0, you'll be able to use your own OpenWeather API key to obtain additional variables (UV index and dew point) in your device. In case you don't have one, the plugin will use Ubidots' key to run the OpenWeather API.

  • Time interval: How often you'd like to retrieve current weather conditions for the specified location (in minutes). Please note that weather data is updated every 20 to 30 minutes, so choosing a lower update rate will result in repeated values.

1.2. Output

This plugin creates a new device with the following attributes:

  • Device name: Location name as returned on the field "name" in OpenWeatherMap's API response. For the new One Call 3.0 API, and cases where no "name" is received in the response, one is retrieved using the Geocoding API. In case the Geocoding API fails, the name "Live weather at..." will be assigned to the device.

  • Device label: Unique hash label built using the provided GPS coordinates. When the location setup in the plugin changes, a new device will be created.

  • Device type: Type created accordingly, with its name indicating the OpenWeather API and units used.

Note: If the OpenWeather Key used by the user is not valid, the Current Weather API will be used by default, with the Ubidots-owned API key, instead of the One Call 3.0 API

The created device will contain these variables, which will be updated at the specified time interval:

  • Temperature: Current temperature in degrees Celsius (Metric) or Fahrenheit (Imperial).

  • Feels like: Current "feels like" temperature (takes into account wind speed and humidity to assess how the human body actually feels temperature), in degrees Celsius (Metric) or Fahrenheit (Imperial).

  • Humidity: Current relative humidity in percentage unit for both Metric and Imperial systems.

  • Pressure: Current atmospheric pressure in millibars (mbar) for both Metric and Imperial systems.

  • Wind speed: Current wind speed in m/s (Metric) or mph (Imperial).

  • Wind direction: Current wind direction in degrees for both Metric and Imperial systems.

  • Wind gust (where available): Current wind gust in m/s (Metric) or mph (Imperial).

  • Average visibility: Current average visibility in meters.

  • Cloudiness: Current percent of cloudiness.

  • Rain (where available): Precipitation volume in mm.

  • Snow (where available): Snow volume in mm.

  • Weather code: Current Weather condition code or ID, determined by OpenWeather. Visit OpenWeather: Weather Conditions for more information on what each code means.

If a valid One Call 3.0 OpenWeather API Key is used, the device will contain these additional variables:

  • Dew point: Atmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form in Celsius (Metric) or Fahrenheit (Imperial).

  • UV index: Midday UV index.

Note: As previously mentioned, an Ubidots-owned OpenWeather API key is used by default, which is maintained and scaled by us.

After configuring the plugin, a new item will appear on the list. Please allow a few seconds for the plugin to finish its provisioning process, and then refresh your browser:

Once the status of the plugin is "running", you should see a new device in your Devices list:

2. Editing an OpenWeather Plugin

To edit the plugin, simply click on the menu button (three dots) or directly on the name in the plugins' table:

Then go to "configuration":

The same "input" fields that appeared during the creation process will appear here. Please note that every time the plugin is updated a provisioning script will run, overriding the current attributes of the target device:

  • Device name

  • Device label

  • Device icon

  • Device description

  • Device color

  • Variable names

  • Variable units

  • Variable colors

Did this answer your question?