Rainmeter Samurize utilities forum

Rainmeter
plugins
& mods

Plugins / mods for the Rainmeter desktop widget app

WeatherHub

Example skin

There are two problems with weather sites: 1) scraping info off their pages is futile, due to constant changes, 2) the weather feeds come and go every few years. The idea behind WeatherHub is to centralize multiple feeds and output the weather data as consistent, uniform tags in Rainmeter. This way, if a feed goes dead, it can be easily replaced with another, with no changes to the skin, except for the feed variable. For any feed, WeatherHub can use any TWC-compatible icon set. Supported feeds: Dark Sky, AccuWeather, Weatherbit, OpenWeather. Dark Sky no longer accepts new sign-ups, existing keys will work until the end of 2021.

Company logos

Settings

Settings dialog

"Global settings" apply to the entire plugin

Latitude

Latitude and longitude are in decimal degrees, S and W are negative. See here, here or Wikipedia on how to obtain them

Longitude

Language

code

Language code for descriptions (default en). Different sites support different sub-levels, try the closest one

Weekday
names

Short: use shorter versions (e.g. "Mon" instead of "Monday"). Translate: use names native to your OS.

Decimal

places

Decimal precision for reported numbers

WakeDelay

After PC wake-up, wait this many secs before connecting [8]

WakeRetry

After PC wake-up, try connecting this many times [3]

Precip.

threshold

Determines the Precipitation Boolean value
"Feed settings" apply to the selected feed

Feed

The feed you're adjusting the settings for

Locate
by IP

Some feeds will accept your external IP as location
Location Used when a feed needs you to specify your location in a particular way. See Feed info below
API key Your API key for the feed

Icon set

folder

Icons to use for this feed. If you include the variable [FEED] in the path, it will expand into the feed handle (*)
Interval To limit requests, WeatherHub retrieves data at this interval (minutes), then caches it. Your measure and meter UpdateDividers have no bearing on this, only on how often your meter is redrawn. Your UpdateDivider shouldn't be more frequent than twice this connection interval

TWC

compatible

Convert the feed's icon names to TWC-style names. See the TWC_icon_mapping.txt file in the demo skin folder

Img type

Icon image format

(*) The feed handle is a short version of the feed name: DarkSky (for Dark Sky) or Accu (for AccuWeather), used within WeatherHub. See Feed Info below.

Instructions

Note: before using WeatherHub , you'll need a (free) API key (links below)

In Rainmeter, create a WeatherHub plugin measure. In your weather meters, use the GetData(feed, tag) function in a section variable to get the desired info from the plugin. The info tags, listed below, correspond to values common to most feeds. WeatherHub will return a string with the tag replaced by the actual value. Here's an example (see also the included demo skins):

[msWeatherHub]
Measure=Plugin
Plugin=WeatherHub
UpdateDivider=900
DynamicVariables=1

; Current temperature (F)
[mCurrTempF]
Meter=String
UpdateDivider=900
Text=[&msWeatherHub:GetData("Accu","(c_tempF)")]
DynamicVariables=1

Use quotes around the GetData parameters. The tags are enclosed by round parentheses. WeatherHub uses a "Replace" function on the second argument: if you want to fetch multiple values in one go, you can include multiple tags. You can include other characters, but keep them outside the tag parentheses.

Tag matrix

Red means the feed doesn't provide this data.

Info type DarkSky Accu Bit Open Tag
API key sign-up Link Link Link Link  
Locate by IP          
Forecast days 5 5 5 7  

Usage limits for free accounts

Requests 1K/d 50/d 500/d 1K/d  

Tags to verify location

City         (city)
Country         (country)
Latitude         (lat)
Longitude         (lon)

Current conditions

Timestamp UTC time         (c_timeU)
Timestamp loc. time         (c_timeL)
Temp. (F)         (c_tempF)
Temp. (C)         (c_tempC)
Short description         (c_desc)
Icon (local)         (c_iconL)
Icon (server)         (c_iconS)
Wind (mph)         (c_windM)
Wind (km/h)         (c_windK)
Wind direction         (c_windD)
Wind gust (mph)         (c_gustM)
Wind gust (km/h)         (c_gustK)
Precip. (in/h)         (c_precI)
Precip. (mm/h)         (c_precM)
Precip. (in/d)         (c_precDI)
Precip. (mm/day)         (c_precDM)
Prec. chance (%)         (c_precC)
Precip type (word)         (c_precT)
Prec. Bool. (Y/N) (*)         (c_precB)
Humidity (%)         (c_hum)
Dew point (F)         (c_dewF)
Dew point (C)         (c_dewC)
Visibility (miles)         (c_visM)
Visibility (km)         (c_visK)
Pressure (inHg)         (c_pressI)
Pressure (mB)         (c_pressM)
Cloud cover (%)         (c_cloud)
Moon phase (%)         (c_moonP)
Sunrise         (c_sunR)
Sunset         (c_sunS)
UV index         (c_uv)

Forecast days
Each day has its own set of tags: f0_, f1_, f2_, etc.
Day "0" (zero) usually means the forecast for the current day.

Timestamp UTC         (f0_timeU)
Timestamp
(loc. time)
        (f0_timeL)
Date (local)         (f0_date)
Month day (local)         (f0_dayM)
Weekday (local)         (f0_dayW)
Month (local)         (f0_month)
Low temp. (F)         (f0_loF)
Low temp. (C)         (f0_loC)
High temp. (F)         (f0_hiF)
High temp. (C)         (f0_hiC)
Short description         (f0_desc)
Icon (local)         (f0_iconL)
Icon (server)         (f0_iconS)
Prec. chance (%)         (f0_precC)
Prec. Bool.
(Y/N) (*)
        (f0_precB)

(*) Precipitation Booleans, e.g. "(f0_precB)", return "Y" if the precipitation chance (in %) is higher than PrecipChanceThreshold set in your settings ("N" otherwise). This may help set up precipitation alerts in Rainmeter.

Sample skins (included)

To adapt the sample skins, replace the geographic coordinates and the API key with your values. For Dark Sky and WeatherBit you can just use coordinates. AccWeather requires a location (a numeric code), they don't accept coordinates.

Test skin
A simple test skin

5-day weather config
A small skin with 5-day forecast and TWC-style icons
The red square means there's a chance of precipitation

Icons

Different feeds use different icon naming conventions, they're not mutually interchangeable. The TWC naming convention uses numbers. It can act as a sort of a "standard". If you use the feed's native icon naming, it will match the weather condition exactly. Replacing them with TWC-style icons will be close, but not exactly the same, though you'll get a bigger selection of icon sets. The included TWC_icon_mapping.txt file maps the feed-specific names onto the TWC standard.

It's more efficient to keep icons locally. The WeatherHub download does not include any native icon sets, as it might not be OK with the feed providers. If you want them, download those icons manually. The (c_iconL) and (f#_iconL) tags represent the full path to the local icon file. The (c_iconS) and (f#_iconS) tags are the icon filenames on the feed's server (you shouldn't link to them directly).

Simple, well-designed icons: Shiny, Tick, Flat
Collections: Shutterstock

Feed info

Dark Sky

Short handle: DarkSky

Important: Dark Sky has been bought by Apple. They no longer provide new API keys. Existing API keys will work until the end of 2021.

Location input: latitude+longitude; auto IP available, but not implemented.

API key: Sign up here

Icons: They don't have a custom icon set, use the TWC_icon_mapping.txt file and turn on "TWS compatible icons"

Limits: 1000 req/day; each connection equals one request

AccuWeather

Short handle: Accu

Location input: AccuWeather requires their own numeric location code, they don't accept geo coordinates. Search here or here for your city, the AccuWeather location code is the number at the end of the URL.

API key: Sign up here

Icons: AccuWeather icons

Limits: AccuWeather has a very low request limit for the free tier: 50 req/day. Furthermore, each connection eats up 2 requests (current conditions + forecasts). In WeatherHub's settings, you'll need a connection interval of 60 min for AccuWeather (maybe less, if you don't use Rainmeter 24 hrs a day)

WeatherBit

Short handle: Bit

Location input: latitude+longitude, city+state, US postal code, station ID. In WeatherHub, just enter the raw data (e.g the zip code itself), WeatherHub will recognize its type. You can find Weatherbit's city and station codes here.

API key: Sign up here

Icons: Weatherbit icons

Limits: 500 req/day. Each connection eats up 2 requests (current conditions + forecasts).

OpenWeather

Short handle: Open

Location input: geo coordinates

API key: Sign up here

Icons: OpenWeather icons

Limits: 1000 req/day; each connection equals one request

Rainmeter.data

Your WeatherHub settings will be saved in the [WeatherHub] section in the .../AppData/Rainmeter/Rainmeter.data file. You don't need to edit it manually, but, for your reference, a non-functional sample is included in the skin folder. "Location", "Interval" etc, set the default values for all feeds. "Feed_Location", "Feed_Interval" etc, override the default value for a given feed.

; Coordinates are global (all feeds)
Latitude=33.3872
Longitude=-104.5280
; Sample default values for all feeds
Location=88201
Interval=30
; Set the API key for DarkSky
DarkSky_APIKey=SampleKey_123456789
; Connection interval for AccuWeather (overrides the default)
Accu_Interval=60

Notes

  • You can mix multiple feeds in one skin (each feed adds to connection time).

Download

Change log:

2.0.0.0

First release

2.0.5.0

Fixed: Right after PC woke up from sleep, with no active Internet yet,
WeatherHub would get a connection error

2.0.7.0

Forecast day timestamp in UTC and local time

2.20.5.7

Added OpenWeather and language support

2.20.6.21

Debug option

2.20.6.23

Fixed visibility, wind_gust, rain

2.20.7.8

Added wake connect retry

2.20.7.29

Wake connect debug

Download WeatherHub_plugin_demo_skins_2.20.7.29.rmskin (4.3 MB)