How To: WUnderground Plugin Control Page Icons

Posted on
Tue Aug 26, 2014 7:20 pm
DaveL17 offline
User avatar
Posts: 5451
Joined: Aug 20, 2013
Location: Chicago, IL, USA

How To: WUnderground Plugin Control Page Icons

The WUnderground plugin provides a facility to use weather-based icons on control pages. It provides several device states that are designed to help with displaying weather-based icons:

Current Conditions - Icon (Day/Night): These icons will vary based on the current weather condition, and whether the Indigo variable value "isDaylight" is true or false. In other words,

    isDaylight = true - daytime icons will be used
    isDaylight = false - nighttime icons will be used
(more on that later.)

Current Conditions - Icon (All Day): These icons will vary based on the current weather condition, but will not vary based on whether it's daytime or nighttime.

Icon (Today, Day 2, Day 3, Day 4): These icons are linked to the current forecast for today and for the next 3 days. These icons will vary based on the forecast, but will not vary based on daytime or nighttime.

Forecast Device Icons (Hour 1, Hour 2, Hour 3...): These icons are linked to the 24 individual 1-hour forecast states within the WUnderground Hourly Forecast Device. These icons do not presently vary based on whether it's daytime or nighttime.

You must provide the icons (the picture files) that will be displayed.

Icon Naming
It is important that you follow a very specific naming convention for the icons that will be displayed. If you don't follow the proper format, the images won't display as you expect. To begin, find an image that you want to use--a sun for example--and give it a name followed by "+.png". Obviously, it needs to be a PNG graphic file. Name it thusly:

    weather+.png
You don't have to use "weather", but you should use something appropriate that you will recognize. "WUnderground+.png" is an excellent choice. ("Bob+.png" will work, but seems odd...) This will be the default image that is displayed when no other image file matches the weather.

All other daytime (and All Day) icon names use the following format:

    weather+clear.png
    weather+cloudy.png
    weather+rain.png
    ...
Nighttime icon names have the following format:

    weather+nt_clear.png
    weather+nt_cloudy.png
    weather+nt_rain.png
    ...
The forecast condition values are slightly different, but the convention is the same. There are no nighttime forecast icons. The filenames are intentionally different so that one set of icons can be used for current conditions and another for forecasts (you might want smaller forecast icons, for example.)

    forecast+.png
    forecast+clear.png
    forecast+chancestorms.png
Images should be stored in the following directory:
/Library/Application Support/Perceptive Automation/Indigo 6/indigoWebServer/images/controls/devices

Weather Underground provides several sets of icons that you can use if you wish, located here:
http://www.wunderground.com/weather/api/d/docs?d=resources/icon-sets

and the complete list of condition and forecast phrases that Weather Underground could provide is located here:
http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary. [1]

You can find lots of icons online that are free to use (I use icons from http://www.iconarchive.com)

Control Page Use
To use the icons in a control page, insert a new control with the following settings:

    Display: [Device State]
    For: [Your Weather Device] [Current Conditions - Icon (Day/Night)]
    As Image: [weather+.png]
and set the remainder of the settings as you wish. Here's another example (for today's forecast icon):

    Display: [Device State]
    For: [Your Weather Device] / [Icon - Today]
    As Image: [forecast+.png]
and Indigo will take care of the rest. Once you get the hang of it, it's actually very straightforward and you can extend the functionality even further. You might use icons for the chance of precipitation (precip+.png, precip+10.png, precip+20.png, ...) or for wind direction (wind+.png, wind+North.png, wind+NNE.png, ...) Go nuts!

For more information on Indigo Image naming conventions, see the Wiki:
http://wiki.indigodomo.com/doku.php?id=cp_custom_images

[1] Note that the WUnderground plugin does not use all of these values. Presently, it uses Wind Direction, Current Condition and Forecast values

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest