https://wiki.webcore.co/api.php?action=feedcontributions&user=Ipaterson&feedformat=atomwebCoRE Wiki - Web-enabled Community's own Rule Engine - User contributions [en]2024-03-28T10:53:44ZUser contributionsMediaWiki 1.28.0https://wiki.webcore.co/index.php?title=TWC_Weather&diff=1934TWC Weather2022-11-17T14:41:13Z<p>Ipaterson: Fixed weather icons that are no longer hosted by SmartThings</p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. <code>$twcweather</code> was introduced in webCoRE v0.3.10a.20190223. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
Note: If you discover useful data that is not listed here, feel free to post in [https://community.webcore.co/t/twcweather-observations/12605?u=wcmore this thread] so we can update this page accordingly.<br />
<br />
If you are interested in data for bad weather alerts, try: [[$twcweather.alerts|$twcweather.alerts]].<br />
<br />
=Conditions=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null, 100, 2100, 8500</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear", "Partly Cloudy", "Mostly Cloudy", "Cloudy"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D", "N"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29<br />
29.95, 30.14</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>0, 1, 2<br />
(Representing "Steady", "Rising", "Falling" respectively)</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Steady", "Rising", "Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10, 72</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2, 9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2, 62</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9, 75</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10, 75</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12, 75</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10, 75</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3, 58</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9, 72</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Extreme", "Very High", "High", "Moderate", "Low", "No Report", "Not Available"<br />
(Extreme=11-16 Very High=8-10 High=6-7 Moderate=3-5 Low=0-2 No Report=-1 Not Available=-2)</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S", "SSE", "SE", "ESE", "E", "ENE", "NE", "NNE", "N", "NNW", "NW", "WNW", "W", "WSW", "SW", "SSW", "CALM", "VAR"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null, 22</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
(weather phrase up to 32 characters)<br />
| <code>"Clear", "Cloudy", "Cloudy/Wind", "Fair", "Fair/Wind", "Flurries", "Fog", "Frozen Rain Mix", "Heavy Rain", "Heavy Rain/Wind", "Light Rain", "Light Rain/Wind", "Light Rain with Thunder", "Light Snow", "Mostly Cloudy", "Mostly Cloudy/Wind", "Partly Cloudy", "Partly Cloudy/Wind", "Rain/Freezing Rain", "Rain Shower", "Rain Shower/Wind", "Rain Shower with Thunder", "Rain/Snow", "Rain/Wind", "Showers in the Vicinity", "Snow Shower", "Snow Shower/Wind", "Snow/Wind", "Sunny", "Sunny/Wind"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
(weather phrase up to 22? characters)<br />
| <code>"Clear", "Cloudy", "Cloudy/Wind", "Fair", "Fair/Wind", "Flurries", "Fog", "Heavy Rain", "Heavy Rain/Wind", "Ice/Snow", "Light Rain", "Light Rain and Thunder", "Light Rain/Wind", "Light Snow", "Mostly Cloudy", "Mostly Cloudy/Wind", "Partly Cloudy", "Partly Cloudy/Wind", "Rain/Freezing Rain", "Rain Shower", "Rain Shower and Thunder", "Rain Shower/Wind", "Rain/Snow", "Rain/Wind", "Showers in Vicinity", "Snow Shower", "Snow Shower/Wind", "Snow/Wind", "Sunny", "Sunny/Wind"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
(weather phrase up to 12 characters)<br />
| <code>"Clear", "Cloudy", "Cloudy/Wind", "Fair", "Fair/Wind", "Flurries", "Fog", "Frz Rain", "Heavy Rain", "Ice/Snow", "Light Rain", "Light Snow", "M Cldy/Wind", "M Cloudy", "P Cldy/Wind", "P Cloudy", "Rain Shower", "Rain/Snow", "Rain/Thunder", "Rain/Wind", "Showers Near", "Snow Shower", "Snow/Wind", "Shower/Wind", "Sunny", "Sun/Wind"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
15 day forecast; append the index to get an individual day. For example, <code>$twcweather.forecast.temperatureMin[0]</code> is today's low temperature.<br />
<br />
Normally, [0] is today's data, and [1] is tomorrow's data... but [[WCmore's_Graphs|initial observations]] indicate that the data shifts over to a new day at approximately 3:15am, not at midnight, as one would expect. So from midnight to about 3:15am, the [0] data will likely be displaying '''yesterday's''' data, and [1] will be the '''current''' day. Once the data shifts over, then [0] will go back to being today, and [1] being tomorrow. <br><br />
(IE: 20+ hours a day, [0] is today... 3+ hours a day, [1] is today... with events during the 3am hour potentially going in either direction)<br />
<br />
To add to this confusion, some [0] dataPoints (for today) vanish shortly after 3pm. <br><br />
(IE:$twcweather.forecast.temperatureMax[0] returns null all afternoon and into the early morning hours)<br />
<br />
⃰ clears throat ⃰ <br> A special "Thank you" to TWC for forcing us to add extra code to work around this convoluted logic.<br />
<br />
To see a real life example, we can look at <code>$twcweather.forecast.dayOfWeek[0]</code><br />
<br />
* Fri at 11:03pm returned Friday ✅<br />
* Sat at 12:03am returned Friday ❌<br />
* Sat at 01:03am returned Friday ❌<br />
* Sat at 02:03am returned Friday ❌<br />
* Sat at 03:03am returned Friday ❌<br />
* Sat at 04:03am returned Saturday ✅ (Finally!)<br />
<br />
2022 Edit: I have created a [https://community.webcore.co/t/twcweather-forecast-preserve-data-lost-at-3-oclock/20396?u=wcmore piston] to out-smart this craziness.<br />
<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhase</code><br />
| <br />
[<br />
"First Quarter",<br />
"Full Moon",<br />
"Last Quarter",<br />
"New Moon",<br />
"Waning Crescent",<br />
"Waning Gibbous",<br />
"Waxing Crescent",<br />
"Waxing Gibbous"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"F",<br />
"FQ",<br />
"LQ",<br />
"N",<br />
"WNC",<br />
"WNG",<br />
"WXC",<br />
"WXG"<br />
]<br />
|-<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcweather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Chance of afternoon showers. Highs in the mid 60s and lows in the mid 50s.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Cloudy. Highs in the low 50s and lows in the low 40s.",<br />
"Mix of sun and clouds. Highs in the mid 60s and lows in the low 50s.",<br />
"More sun than clouds. Highs in the low 70s and lows in the upper 50s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
"Partly cloudy. Highs in the mid 60s and lows in the low 50s.",<br />
"Plenty of sun. Highs in the upper 60s and lows in the upper 50s.",<br />
"Rain and wind. Highs in the low 50s and lows in the low 40s.",<br />
"Scattered thunderstorms possible. Highs in the mid 60s and lows in the mid 50s.",<br />
"Showers possible in the afternoon. Highs in the upper 60s and lows in the upper 50s.",<br />
"Showers possible. Highs in the upper 60s and lows in the upper 50s.",<br />
"Times of sun and clouds. Highs in the mid 60s and lows in the mid 50s."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeLocal</code><br />
(This prediction bounces around, as seen [https://community.webcore.co/t/twc-sunrise-set-forecast-conditions-slightly-different/17578/30?u=wcmore here])<br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeLocal</code><br />
(This prediction bounces around, as seen [https://community.webcore.co/t/twc-sunrise-set-forecast-conditions-slightly-different/17578/30?u=wcmore here])<br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|}<br />
<br />
==Partial day forecast==<br />
<br />
The forecast includes morning and evening data for various attributes. The indexes begin at 0 for "this morning" so 2 is tomorrow morning and 3 is tomorrow evening (see the <code>daypartName</code> value). To show an icon for tonight's weather you would get the icon code with the expression <code>$twcweather.forecast.daypart[0].iconCode[1]</code><br />
<br />
Note that the first value for some attributes may be blank in the evening. For example, running a piston in the morning you may get <code>$twcweather.forecast.daypart[0].cloudCover => [ 25, 79, 100, ...]</code> but that same evening <code>$twcweather.forecast.daypart[0].cloudCover => [ null, 79, 100, ...]</code>.<br />
<br />
[[WCmore's_Graphs#twcweather.forecast.daypart|Preliminary testing]] shows that today's morning/daytime data [0] turns null shortly after 3PM each day, and the next day's data shifts to [0] and [1] shortly after 3AM. This means from approximately 3PM to 3AM, you will find [0] to be null, and [1] will show data from the evening/night in progress. This also means that at about 3AM, the data for the night in progress vanishes, and is replaced with data for the following day/night.<br />
<br />
2022 Edit: I have created a [https://community.webcore.co/t/twcweather-forecast-preserve-data-lost-at-3-oclock/20396?u=wcmore piston] to out-smart this craziness.<br />
<br />
{| class="wikitable" style="margin: auto;"<br />
| Here's my findings over 20 days/40 events: … ([[WCmore's_Graphs#twcweather.forecast.daypart|Graph shown here]])<br />
* 22 changed between 2:58 and 3:10 (55% of the time)<br />
* 10 changed between 3:10 and 3:20 (25% of the time)<br />
* 8 changed between 3:20 and 3:36 (20% of the time)<br />
|}<br />
<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].cloudCover</code><br />
|<br />
[<br />
14,<br />
79,<br />
100<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
26,<br />
33<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
2600,<br />
3300<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipType</code><br />
|<br />
[<br />
null,<br />
"precip",<br />
"rain",<br />
"snow"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpf</code><br />
|<br />
[<br />
0,<br />
0.93,<br />
0.51,<br />
0.48<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierCode</code><br />
|<br />
[<br />
null,<br />
"Q1021", (Winds could occasionally gust over 40 mph)<br />
"Q5015", (Slight chance of a rain shower.)<br />
"Q5053", (Locally heavier rainfall possible)<br />
"Q8001", (A stray shower or thunderstorm is possible.)<br />
"Q8003", (Thunder possible.)<br />
"Q8005", (A stray shower or thunderstorm is possible early.)<br />
"Q8035", (Gusty winds and small hail are possible.)<br />
"Q902", (Areas of patchy fog.)<br />
"Q904" (Areas of patchy fog early.)<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierPhrase</code><br />
(null is the most common result here)<br />
|<br />
[<br />
null,<br />
"A few storms may be severe.", <br />
"A shower is possible early.", <br />
"A stray afternoon thunderstorm is possible.", <br />
"A stray severe thunderstorm is possible.", <br />
"A stray thunderstorm is possible throughout the evening.", <br />
"A stray shower or thunderstorm is possible.", <br />
"A stray shower or thunderstorm is possible early.", <br />
"Areas of patchy fog.", <br />
"Areas of patchy fog developing.", <br />
"Areas of patchy fog early.", <br />
"Continued very hot.", <br />
"Damaging winds, large hail and possibly a tornado with some storms.", <br />
"Gusty winds and small hail are possible.", <br />
"Higher wind gusts possible.", <br />
"Localized flooding is possible.", <br />
"Locally heavier rainfall possible", <br />
"Locally heavy rainfall possible.", <br />
"Potential for flooding rains.", <br />
"Potential for heavy rainfall.", <br />
"Potential for severe thunderstorms.", <br />
"Slight chance of a rain shower.", <br />
"Thunder possible.", <br />
"Very hot.", <br />
"Watching the tropics.", <br />
"Winds could occasionally gust over 40 mph"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
96,<br />
76,<br />
55<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].snowRange</code><br />
|<br />
[<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderCategory</code><br />
|<br />
[<br />
null,<br />
"No thunder", <br />
"Thunder possible", <br />
"Thunder expected", <br />
"Severe thunderstorms possible", <br />
"Severe thunderstorms likely", <br />
"High risk of severe thunderstorms"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderIndex</code><br />
|<br />
[<br />
null,<br />
0, ("No thunder")<br />
1, ("Thunder possible")<br />
2, ("Thunder expected")<br />
3, ("Severe thunderstorms possible")<br />
4, ("Severe thunderstorms likely")<br />
5 ("High risk of severe thunderstorms")<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvDescription</code><br />
|<br />
[<br />
null,<br />
"Low",<br />
"Moderate",<br />
"High",<br />
"Very High",<br />
"Extreme"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseLong<br />
(weather phrase up to 32 characters)</code><br />
|<br />
[<br />
null,<br />
"AM Clouds/PM Sun",<br />
"AM Showers",<br />
"AM Thunderstorms",<br />
"Clouds Early/Clearing Late",<br />
"Cloudy",<br />
"Few Showers",<br />
"Fog Late",<br />
"Foggy",<br />
"Isolated Thunderstorms",<br />
"Mostly Clear",<br />
"Mostly Clear/Wind",<br />
"Mostly Cloudy",<br />
"Mostly Sunny",<br />
"Partly Cloudy",<br />
"PM Showers",<br />
"PM Thunderstorms",<br />
"Rain",<br />
"Rain Late",<br />
"Rain/Wind",<br />
"Rain/Wind Early",<br />
"Scattered Thunderstorms",<br />
"Showers",<br />
"Showers Early",<br />
"Showers Late",<br />
"Sunny",<br />
"Thunderstorms",<br />
"Thunderstorms Early", <br />
"Thunderstorms Late"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseShort<br />
(weather phrase up to 12 characters)</code><br />
|<br />
[<br />
"AM Showers",<br />
"Clear",<br />
"Cloudy",<br />
"Few Showers",<br />
"M Clear", <br />
"M Clr/Wind", <br />
"M Cloudy",<br />
"M Sunny",<br />
"P Cloudy",<br />
"PM Showers",<br />
"Rain",<br />
"Rain Late",<br />
"Rain/Wind",<br />
"Sct T-Storms",<br />
"Showers",<br />
"Shwrs Early",<br />
"Shwrs Late",<br />
"T-Storms"<br />
]<br />
|}<br />
<br />
=Weather Icons=<br />
<br />
==Usage==<br />
Choose an icon set below and use it with the iconCode values from <code>$twcweather</code>. The following examples can be used in the Value field.<br />
<br />
Current Weather using the "TWC" icon set: <code>:twc-{$twcweather.conditions.iconCode}:</code><br />
<br />
Forecast Day using the "WU v4" icon set: <code>:wu-v4-{$twcweather.forecast.daypart[0].iconCode[INDEX]}</code> note: You will need to change [INDEX] to a value from 0-7 (0 being the next forecasted half day/night and 7 being the 3rd day/night)<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Code<br />
! Description<br />
! TWC Icon<br />
! WU v4 Icon<br />
|-<br />
| 0<br />
| Tornado<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/00.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/0.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 1<br />
| Tropical Storm<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/01.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/1.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 2<br />
| Hurricane<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/02.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/2.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 3<br />
| Strong Storms<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/03.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/3.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 4<br />
| Thunder and Hail<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/04.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/4.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 5<br />
| Rain to Snow Showers<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/05.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/5.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 6<br />
| Rain / Sleet<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/06.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/6.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 7<br />
| Wintry Mix Snow / Sleet<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/07.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/7.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 8<br />
| Freezing Drizzle<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/08.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/8.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 9<br />
| Drizzle<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/09.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/9.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 10<br />
| Freezing Rain<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/10.png" height="50"/><br />
<code>:twc-10:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/10.svg" height="50"/><br />
<code>:wu-v4-10:</code><br />
|-<br />
| 11<br />
| Light Rain<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/11.png" height="50"/><br />
<code>:twc-11:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/11.svg" height="50"/><br />
<code>:wu-v4-11:</code><br />
|-<br />
| 12<br />
| Rain<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/12.png" height="50"/><br />
<code>:twc-12:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/12.svg" height="50"/><br />
<code>:wu-v4-12:</code><br />
|-<br />
| 13<br />
| Scattered Flurries<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/13.png" height="50"/><br />
<code>:twc-13:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/13.svg" height="50"/><br />
<code>:wu-v4-13:</code><br />
|-<br />
| 14<br />
| Light Snow<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/14.png" height="50"/><br />
<code>:twc-14:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/14.svg" height="50"/><br />
<code>:wu-v4-14:</code><br />
|-<br />
| 15<br />
| Blowing / Drifting Snow<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/15.png" height="50"/><br />
<code>:twc-15:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/15.svg" height="50"/><br />
<code>:wu-v4-15:</code><br />
|-<br />
| 16<br />
| Snow<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/16.png" height="50"/><br />
<code>:twc-16:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/16.svg" height="50"/><br />
<code>:wu-v4-16:</code><br />
|-<br />
| 17<br />
| Hail<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/17.png" height="50"/><br />
<code>:twc-17:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/17.svg" height="50"/><br />
<code>:wu-v4-17:</code><br />
|-<br />
| 18<br />
| Sleet<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/18.png" height="50"/><br />
<code>:twc-18:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/18.svg" height="50"/><br />
<code>:wu-v4-18:</code><br />
|-<br />
| 19<br />
| Blowing Dust / Sandstorm<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/19.png" height="50"/><br />
<code>:twc-19:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/19.svg" height="50"/><br />
<code>:wu-v4-19:</code><br />
|-<br />
| 20<br />
| Foggy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/20.png" height="50"/><br />
<code>:twc-20:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/20.svg" height="50"/><br />
<code>:wu-v4-20:</code><br />
|-<br />
| 21<br />
| Haze / Windy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/21.png" height="50"/><br />
<code>:twc-21:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/21.svg" height="50"/><br />
<code>:wu-v4-21:</code><br />
|-<br />
| 22<br />
| Smoke / Windy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/22.png" height="50"/><br />
<code>:twc-22:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/22.svg" height="50"/><br />
<code>:wu-v4-22:</code><br />
|-<br />
| 23<br />
| Breezy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/23.png" height="50"/><br />
<code>:twc-23:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/23.svg" height="50"/><br />
<code>:wu-v4-23:</code><br />
|-<br />
| 24<br />
| Blowing Spray / Windy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/24.png" height="50"/><br />
<code>:twc-24:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/24.svg" height="50"/><br />
<code>:wu-v4-24:</code><br />
|-<br />
| 25<br />
| Frigid / Ice Crystals<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/25.png" height="50"/><br />
<code>:twc-25:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/25.svg" height="50"/><br />
<code>:wu-v4-25:</code><br />
|-<br />
| 26<br />
| Cloudy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/26.png" height="50"/><br />
<code>:twc-26:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/26.svg" height="50"/><br />
<code>:wu-v4-26:</code><br />
|-<br />
| 27<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/27.png" height="50"/><br />
<code>:twc-27:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/27.svg" height="50"/><br />
<code>:wu-v4-27:</code><br />
|-<br />
| 28<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/28.png" height="50"/><br />
<code>:twc-28:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/28.svg" height="50"/><br />
<code>:wu-v4-28:</code><br />
|-<br />
| 29<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/29.png" height="50"/><br />
<code>:twc-29:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/29.svg" height="50"/><br />
<code>:wu-v4-29:</code><br />
|-<br />
| 30<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/30.png" height="50"/><br />
<code>:twc-30:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/30.svg" height="50"/><br />
<code>:wu-v4-30:</code><br />
|-<br />
| 31<br />
| Clear<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/31.png" height="50"/><br />
<code>:twc-31:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/31.svg" height="50"/><br />
<code>:wu-v4-31:</code><br />
|-<br />
| 32<br />
| Sunny<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/32.png" height="50"/><br />
<code>:twc-32:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/32.svg" height="50"/><br />
<code>:wu-v4-32:</code><br />
|-<br />
| 33<br />
| Fair / Mostly Clear<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/33.png" height="50"/><br />
<code>:twc-33:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/33.svg" height="50"/><br />
<code>:wu-v4-33:</code><br />
|-<br />
| 34<br />
| Fair / Mostly Sunny<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/34.png" height="50"/><br />
<code>:twc-34:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/34.svg" height="50"/><br />
<code>:wu-v4-34:</code><br />
|-<br />
| 35<br />
| Mixed Rain & Hail<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/35.png" height="50"/><br />
<code>:twc-35:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/35.svg" height="50"/><br />
<code>:wu-v4-35:</code><br />
|-<br />
| 36<br />
| Hot<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/36.png" height="50"/><br />
<code>:twc-36:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/36.svg" height="50"/><br />
<code>:wu-v4-36:</code><br />
|-<br />
| 37<br />
| Isolated Thunderstorms<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/37.png" height="50"/><br />
<code>:twc-37:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/37.svg" height="50"/><br />
<code>:wu-v4-37:</code><br />
|-<br />
| 38<br />
| Thunderstorms<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/38.png" height="50"/><br />
<code>:twc-38:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/38.svg" height="50"/><br />
<code>:wu-v4-38:</code><br />
|-<br />
| 39<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/39.png" height="50"/><br />
<code>:twc-39:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/39.svg" height="50"/><br />
<code>:wu-v4-39:</code><br />
|-<br />
| 40<br />
| Heavy Rain<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/40.png" height="50"/><br />
<code>:twc-40:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/40.svg" height="50"/><br />
<code>:wu-v4-40:</code><br />
|-<br />
| 41<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/41.png" height="50"/><br />
<code>:twc-41:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/41.svg" height="50"/><br />
<code>:wu-v4-41:</code><br />
|-<br />
| 42<br />
| Heavy Snow<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/42.png" height="50"/><br />
<code>:twc-42:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/42.svg" height="50"/><br />
<code>:wu-v4-42:</code><br />
|-<br />
| 43<br />
| Blizzard<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/43.png" height="50"/><br />
<code>:twc-43:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/43.svg" height="50"/><br />
<code>:wu-v4-43:</code><br />
|-<br />
| 44<br />
| Not Available (N/A)<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/44.png" height="50"/><br />
<code>:twc-44:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/44.svg" height="50"/><br />
<code>:wu-v4-44:</code><br />
|-<br />
| 45<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/45.png" height="50"/><br />
<code>:twc-45:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/45.svg" height="50"/><br />
<code>:wu-v4-45:</code><br />
|-<br />
| 46<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/46.png" height="50"/><br />
<code>:twc-46:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/46.svg" height="50"/><br />
<code>:wu-v4-46:</code><br />
|-<br />
| 47<br />
| Scattered Thunderstorms<br />
| style="text-align: center" | <img src="https://cdn.jsdelivr.net/gh/imnotbob/webCoRE@hubitat-patches/resources/icons/47.png" height="50"/><br />
<code>:twc-47:</code><br />
| style="text-align: center" | <img src="https://www.wunderground.com/static/i/c/v4/47.svg" height="50"/><br />
<code>:wu-v4-47:</code><br />
|}<br />
<br />
==Old icon sets==<br />
<br />
Several additional icon sets are available but all have a much more limited set of icons. We have ensured that the <code>$twcWeather</code> icon code numbers map to an approximately accurate representation in the old icon sets. While the old sets work we encourage use of the more expressive TWC and WU v4 icon sets.<br />
<br />
All of the icon sets described on the original [[Weather#Weather_Icons | Weather Icons]] page work with the new codes, for example <code>:wu-b-36:</code> maps to the "sunny" icon in the "B" icon set.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Functions&diff=834Functions2019-02-23T19:17:26Z<p>Ipaterson: /* Weather related functions */ Added convertTemperatureIfNeeded()</p>
<hr />
<div><div style="float: left; clear: both; margin-right: 1em; margin-bottom: 1em;">__TOC__</div><br />
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions<br />
<br />
<br />
=[[Variable_data_types#String|String]] functions=<br />
<br />
==concat==<br />
:Syntax<br />
::<code>''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.<br />
<br />
==contains==<br />
:Syntax<br />
::<code>''boolean'' contains(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if the <code>needle</code> is found anywhere in the <code>haystack</code><br />
<br />
==endsWith==<br />
:Syntax<br />
::<code>''boolean'' endsWith(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if <code>haystack</code> ends with the <code>needle</code><br />
<br />
==format==<br />
[[File:Format.pdf|page=1|thumb|256px|A very nice article written by Professor Don Colton, at the Brigham Young University of Hawaii]]<br />
:Syntax<br />
::<code>''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])</code><br />
:Returns<br />
::Returns a string that is built based on the <code>formatString</code> with arguments replaced by their corresponding values. Follows the java syntax for <code>printf()</code>. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].<br />
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. <br />
:Example<br />
::<code>format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])</code> outputs <code>The temperature outside is 71.26 degrees Fahrenheit</code><br />
::The <code>%.2f</code> translates to "format as <code>f</code>loat and use <code>.2</code> decimal places.<br />
<br />
==indexOf==<br />
:Syntax<br />
::<code>''integer'' indexOf(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns the character index of the first occurrence of <code>needle</code> inside <code>haystack</code><br />
:Examples<br />
::<code>indexOf("hello world", 'l')</code> outputs <code>2</code><br />
<br />
==json==<br />
:Syntax<br />
::<code>''string'' json(''dynamic'' value[, "boolean" pretty])</code><br />
:Returns<br />
::Returns the JSON representation of the provided value. If the pretty parameter is true, indentation is added to improve human readability <br />
:Examples<br />
::<code>json(true)</code> outputs <code>"true"</code><br />
::<code>json(123)</code> outputs <code>"123"</code><br />
::<code>json('Nicole "Nikki" Sawyer')</code> outputs <code>""Nicole \"Nikki\" Sawyer""</code><br />
::<code>json(myStringList, true)</code> outputs with pretty formatting<br />
:::<code>"{<br/>&nbsp; "name": "Jaime",<br/>&nbsp; "present": true<br/>}"</code><br />
::<code>json(myDeviceList)</code> outputs <code>"[":97e051eb6fea489fa7cf1aaa4cb7c171:",":73d68350942e4555a8c47c36f558681e:"]"</code> since device variables are internally a list of device IDs<br />
::<code><nowiki>"\{"device": {json($currentEventDevice)}, "rooms": \[ {json(activeRoom)}, "Basement" \] \}"</nowiki></code> building JSON by hand in a webCoRE expression requires any <code>{}[]</code> characters in the JSON to be escaped with a backslash and all dynamic values must use the <code>json()</code> function to safely represent the value<br />
<br />
==lastIndexOf==<br />
:Syntax<br />
::<code>''integer'' lastIndexOf(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns the character index of the last occurrence of <code>needle</code> inside <code>haystack</code><br />
:Examples<br />
::<code>lastIndexOf("hello world", 'l')</code> outputs <code>9</code><br />
<br />
==left==<br />
:Syntax<br />
::<code>''string'' left(''string'' value, ''integer'' length)</code><br />
:Returns<br />
::Returns the first <code>length</code> characters in <code>value</code><br />
:Examples<br />
::<code>left("hello world", 2)</code> outputs <code>he</code><br />
<br />
==lower==<br />
:Syntax<br />
::<code>''string'' lower(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but with all lower case letters.<br />
:Examples<br />
::<code>lower("Hello World")</code> outputs <code>hello world</code><br />
<br />
==mid==<br />
:Syntax<br />
::<code>''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])</code><br />
:Arguments<br />
::<code>start</code> - provides the 0-based index of the first character to copy. If <code>start</code> is negative, the counting starts from the end of <code>value</code>.<br />
::<code>count</code> - provides the number of characters to copy from <code>value</code>. If not provided, all of the remaining characters from <code>value</code> are returned, starting with character number <code>start</code>. If <code>count</code> is negative, prior characters are returned.<br />
:Returns<br />
::Returns a substring of <code>value</code>, <code>count</code> characters long, starting at character number <code>start</code>. Note that the first character in any string has index 0.<br />
:Examples<br />
::<code>mid("Hello World", 2, 3)</code> outputs <code>llo</code><br />
::<code>mid("Hello World", 2)</code> outputs <code>llo World</code><br />
::<code>mid("Hello World", -5, 2)</code> outputs <code>Wo</code><br />
::<code>mid("Hello World", -1, -3)</code> outputs <code>orl</code><br />
<br />
==random==<br />
:Syntax<br />
::<code>''dynamic'' random([''integer'' range | ''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN]])</code><br />
:Arguments<br />
::<code>range</code> - an integer number representing a range<br />
::<code>value1</code>..<code>valueN</code> - any kind of arguments, one will be randomly returned<br />
:Returns<br />
::Returns a random decimal number between <code>0</code> and <code>1</code> if no arguments are provided, or a number between <code>0</code> and <code>range</code> (inclusive) if a single argument is provided, or a randomly selected argument if two or more arguments are provided.<br />
:Examples<br />
::<code>random()</code> outputs <code>0.483</code> (random decimal)<br />
::<code>random(20)</code> outputs <code>6</code> (random integer)<br />
::<code>random("Hello World", "Good morning", "Hello", "Hi")</code> outputs <code>Hello</code> (randomly selected value)<br />
:Tips<br />
::To output a random integer between 5 and 20 use <code>(5 + random(15))</code><br />
::To output a random integer between -5 and 20 use <code>(-5 + random(25))</code><br />
<br />
==replace==<br />
:Syntax<br />
::<code>''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])</code><br />
:Returns<br />
::Replaces all the occurrences of <code>needle</code> inside <code>haystack</code> with its respective <code>replacement</code>. Multiple pairs of <code>needle</code>/<code>replacement</code> can be provided in one function call.<br />
:Regular expressions<br />
::Needles support regular expressions when their value starts and ends with a <code>/</code>. For example, <code>'/(\s)/'</code> will match all spaces.<br />
:Examples<br />
::<code>replace("Hello World", 'World', 'Earth')</code> outputs <code>Hello Earth</code><br />
::<code>replace("Hello World", 'World', 'Earth', 'Hello', 'Hi')</code> outputs <code>Hi Earth</code><br />
::<code>replace("Hello World", 'World', 'Earth', 'Earth', 'Planet')</code> outputs <code>Hello Planet</code><br />
<br />
==right==<br />
:Syntax<br />
::<code>''string'' right(''string'' value, ''integer'' length)</code><br />
:Returns<br />
::Returns the last <code>length</code> characters in <code>value</code><br />
:Examples<br />
::<code>right("hello world", 4)</code> outputs <code>orld</code><br />
<br />
==startsWith==<br />
:Syntax<br />
::<code>''boolean'' startsWith(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if <code>haystack</code> starts with the <code>needle</code><br />
<br />
==string==<br />
:Syntax<br />
::<code>''string'' string(''dynamic'' value)</code><br />
:Returns<br />
::Returns <code>value</code> as a string.<br />
<br />
==substr==<br />
:Alias of <code>mid()</code><br />
<br />
==substring==<br />
:Alias of <code>mid()</code><br />
<br />
==title==<br />
:Syntax<br />
::<code>''string'' title(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but in its title case format (each word starts with a capitalized letter).<br />
:Examples<br />
::<code>lower("Hello there world")</code> outputs <code>Hello There World</code><br />
<br />
==upper==<br />
:Syntax<br />
::<code>''string'' upper(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but with all upper case letters.<br />
:Examples<br />
::<code>upper("Hello World")</code> outputs <code>HELLO WORLD</code><br />
<br />
==text==<br />
:Alias of <code>string()</code><br />
<br />
==trim==<br />
:Syntax<br />
::<code>"string" trim("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with leading and trailing spaces removed<br />
:Examples<br />
::<code>trim(" Hello World ")</code> outputs <code>Hello World</code><br />
<br />
==trimLeft==<br />
:Syntax<br />
::<code>"string" trimLeft("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with leading spaces removed<br />
:Examples<br />
::<code>trimLeft(" Hello World ")</code> outputs <code>"Hello World "</code><br />
<br />
==ltrim==<br />
:Alias of <code>trimLeft()</code><br />
<br />
==trimRight==<br />
:Syntax<br />
::<code>"string" trimRight("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with trailing spaces removed<br />
:Examples<br />
::<code>trimRight(" Hello World ")</code> outputs <code>" Hello World"</code><br />
<br />
==rtrim==<br />
:Alias of <code>trimRight()</code><br />
<br />
==urlEncode==<br />
:Syntax<br />
::<code>''string'' urlEncode(''dynamic'' value)</code><br />
:Returns<br />
::Returns a string with all characters other than <code>a-z A-Z 0-9 . - * _ +</code> converted to percent encoding for use in a URL<br />
:Examples<br />
::<code>urlEncode("John's iPhone 8+")</code> outputs <code>"John%27s%20iPhone%208+"</code><br />
::<code><nowiki>"http://webcore.co/sample?device={urlEncode($currentEventDevice)}&attribute={urlEncode($currentEventAttribute)}&value={urlEncode($currentEventValue)}"</nowiki></code> ensures that the generated URL is valid even if the event information includes spaces, & signs, or other problematic characters.<br />
<br />
==encodeURIComponent==<br />
:Alias of <code>urlEncode()</code><br />
<br />
=Numeric functions=<br />
<br />
==avg==<br />
:Syntax<br />
::<code>''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the mean average of all the values provided.<br />
<br />
==abs==<br />
:Syntax<br />
::<code>''decimal'' abs(''decimal'' value)</code><br />
:Returns<br />
::Returns the absolute value of the argument (e.g., remove negative sign for negative values).<br />
<br />
==ceil==<br />
:Syntax<br />
::<code>''integer'' ceil(''decimal'' value)</code><br />
:Returns<br />
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.<br />
:Examples<br />
::<code>ceil(5.6)</code> outputs <code>6</code><br />
::<code>ceil(-5.6)</code> outputs <code>-6</code><br />
<br />
==ceiling==<br />
:Alias of <code>ceil</code><br />
<br />
==decimal==<br />
:Syntax<br />
::<code>''decimal'' decimal(''dynamic'' value)</code><br />
:Returns<br />
::Converts <code>value</code> into a decimal. Returns <code>0</code> if <code>value</code> is not numeric.<br />
<br />
==float==<br />
:Alias of <code>decimal</code><br />
<br />
==floor==<br />
:Syntax<br />
::<code>''integer'' ceil(''decimal'' value)</code><br />
:Returns<br />
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.<br />
:Examples<br />
::<code>floor(5.6)</code> outputs <code>5</code><br />
::<code>floor(-5.6)</code> outputs <code>-5</code><br />
<br />
==max==<br />
:Syntax<br />
::<code>''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==median==<br />
:Syntax<br />
::<code>''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==min==<br />
:Syntax<br />
::<code>''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==number==<br />
:Alias of <code>decimal</code><br />
<br />
==power==<br />
:Syntax<br />
::<code>''decimal'' power(''decimal'' value, ''decimal'' exponent)</code><br />
:Returns<br />
::Returns the <code>value</code> at the power of <code>exponent</code><br />
<br />
==round==<br />
:Syntax<br />
::<code>''decimal'' round(''decimal'' value[, ''integer'' precision = 0])</code><br />
:Arguments<br />
::<code>precision</code> - the number of decimal places to be retained. If not provided, defaults to <code>0</code><br />
:Returns<br />
::Returns the rounded <code>value</code> with <code>precision</code> decimal places.<br />
<br />
==sqr==<br />
:Syntax<br />
::<code>''decimal'' sqr(''decimal'' value)</code><br />
:Returns<br />
::Returns the squared <code>value</code>, equivalent to <code>value</code> multiplied by itself.<br />
<br />
==sqrt==<br />
:Syntax<br />
::<code>''decimal'' sqrt(''decimal'' value)</code><br />
:Returns<br />
::Returns the square root of <code>value</code>.<br />
<br />
==stdev==<br />
:Syntax<br />
::<code>''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the standard deviation of all the values provided.<br />
<br />
==sum==<br />
:Syntax<br />
::<code>''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the sum of sum of all the values provided.<br />
<br />
==variance==<br />
:Syntax<br />
::<code>''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the variance of all the values provided.<br />
<br />
=[[Variable_data_types#Boolean|Boolean]] functions=<br />
<br />
==bool==<br />
:Syntax<br />
::<code>bool(''dynamic'' value)</code><br />
:Returns<br />
::Returns the truth value of the input. Accepts anything as input and will return true if <code>value</code> is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime<br />
<br />
==boolean==<br />
:This is an alias of [[Functions#bool|bool]]<br />
<br />
==eq==<br />
:Syntax<br />
::<code>eq(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is equivalent to <code>value2</code><br />
<br />
==ge==<br />
:Syntax<br />
::<code>ge(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is greater than or equal to <code>value2</code><br />
<br />
==gt==<br />
:Syntax<br />
::<code>gt(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is greater than <code>value2</code><br />
<br />
==isBetween==<br />
:Syntax<br />
::<code>isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)</code><br />
:Returns<br />
::Returns true if <code>value</code> is greater then or equal to <code>startValue</code> and less than or equal to <code>endValue</code><br />
<br />
==isEmpty==<br />
:Syntax<br />
::<code>isEmpty(''dynamic'' value)</code><br />
:Returns<br />
::Returns true if <code>value</code> is not set, an empty string, or zero<br />
<br />
==le==<br />
:Syntax<br />
::<code>le(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is less than or equal to <code>value2</code><br />
<br />
==lt==<br />
:Syntax<br />
::<code>lt(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is less than <code>value2</code><br />
<br />
==not==<br />
:Syntax<br />
::<code>not(''dynamic'' value)</code><br />
:Returns<br />
::Returns the negated truth state of <code>value</code>. This is the logical negation of <code>[[Functions#bool|bool]](''dynamic'' value)</code>.<br />
<br />
=[[Variable_data_types#Date_and_Time|Date and time]] functions=<br />
<br />
==addDays==<br />
:Syntax<br />
::<code>addDays(''datetime'' value, ''integer'' days)</code><br />
:Returns<br />
::Returns a datetime that is <code>days</code> days after the <code>value</code>. For negative values of <code>days</code>, it returns a datetime that is <code>days</code> days before <code>value</code>.<br />
<br />
==addHours==<br />
:Syntax<br />
::<code>addHours(''datetime'' value, ''integer'' hours)</code><br />
:Returns<br />
::Returns a datetime that is <code>hours</code> hours after the <code>value</code>. For negative values of <code>hours</code>, it returns a datetime that is <code>hours</code> hours before <code>value</code>.<br />
<br />
==addMinutes==<br />
:Syntax<br />
::<code>addMinutes(''datetime'' value, ''integer'' minutes)</code><br />
:Returns<br />
::Returns a datetime that is <code>minutes</code> minutes after the <code>value</code>. For negative values of <code>minutes</code>, it returns a datetime that is <code>minutes</code> minutes before <code>value</code>.<br />
<br />
==addSeconds==<br />
:Syntax<br />
::<code>addSeconds(''datetime'' value, ''integer'' seconds)</code><br />
:Returns<br />
::Returns a datetime that is <code>seconds</code> seconds after the <code>value</code>. For negative values of <code>seconds</code>, it returns a datetime that is <code>seconds</code> seconds before <code>value</code>.<br />
<br />
==addWeeks==<br />
:Syntax<br />
::<code>addWeeks(''datetime'' value, ''integer'' weeks)</code><br />
:Returns<br />
::Returns a datetime that is <code>weeks</code> weeks after the <code>value</code>. For negative values of <code>weeks</code>, it returns a datetime that is <code>weeks</code> weeks before <code>value</code>.<br />
<br />
==date==<br />
:Syntax<br />
::<code>date(''datetime'' value)</code><br />
:Returns<br />
::Returns the date portion of <code>value</code> by stripping off time information.<br />
<br />
==datetime==<br />
:Syntax<br />
::<code>''datetime'' datetime(''dynamic'' value)</code><br />
:Returns<br />
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.<br />
<br />
<br />
==formatDuration==<br />
:Syntax<br />
::<code>''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])</code><br />
:Arguments<br />
::<code>friendly</code> - <code>false</code> makes the output compact, in the form of <code>0d 00:00:00.000</code>, while <code>true</code> makes the output more human friendly, in the form of <code> 0 days, 0 hours, 0 minutes, and 0 seconds</code>. Defaults to <code>false</code>.<br />
::<code>granularity</code> - represents the smallest time unit to be output. One of <code>d</code> for days, <code>h</code> for hours, <code>m</code> for minutes, <code>s</code> for seconds, or <code>ms</code> for milliseconds. Any time unit below the selected granularity will not be output. Defaults to <code>s</code><br />
::<code>showAdverbs</code> - only affects the friendly output, when <code>true</code> the words <code>in</code> (for future durations - positive input) or <code>ago</code> (for past durations - negative input) are prepended or appended respectively to the output<br />
:Returns<br />
::Returns a string that represents the duration in a human readable format<br />
:Examples<br />
::<code>formatDuration(12029)</code> will output <code>00:00:12</code><br />
::<code>formatDuration(68493, true)</code> will output <code>1 minute and 8 seconds</code><br />
::<code>formatDuration(68493, false, 'ms')</code> will output <code>00:01:08</code><br />
::<code>formatDuration(68493, true, 'm', true)</code> will output <code>in 1 minute</code><br />
<br />
==formatDateTime==<br />
:Syntax<br />
:Arguments<br />
:Examples<br />
:Reference - https://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html<br />
<br />
==time==<br />
:Syntax<br />
::<code>''time'' time(''datetime'' value)</code><br />
:Returns<br />
::Returns the time portion of <code>value</code> by stripping off date information.<br />
<br />
=Weather related functions=<br />
<br />
==celsius==<br />
:Syntax<br />
::<code>''decimal'' celsius(''decimal'' value)</code><br />
:Returns<br />
::Converts a temperature value from Fahrenheit to Celsius.<br />
<br />
==dewPoint==<br />
:Syntax<br />
::<code>''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])</code><br />
:Parameters<br />
::<code>scale</code> - optional, one of <code>"C"</code> or <code>"F"</code>, corresponding to the temperature range used for <code>temperature</code>. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.<br />
:Returns<br />
::Returns the due temperature for a given temperature and relative humidity<br />
<br />
==fahrenheit==<br />
:Syntax<br />
::<code>''decimal'' fahrenheit(''decimal'' value)</code><br />
:Returns<br />
::Converts a temperature value from Celsius to Fahrenheit.<br />
<br />
==convertTemperatureIfNeeded==<br />
:Syntax<br />
::<code>''decimal'' convertTemperatureIfNeeded(''decimal'' value, ''string'' scaleOfValue)</code><br />
:Parameters<br />
::<code>value</code> - the numeric temperature value in units specified by the <code>scaleOfValue</code> parameter<br />
::<code>scaleOfValue</code> - one of <code>"C"</code> or <code>"F"</code>, corresponding to the known unit of the value parameter<br />
:Returns<br />
::Converts the temperature value from Celsius to Fahrenheit or vice versa if the scale does not match the location's temperature scale (see <code>$temperatureScale</code>). If the provided unit matches the location's temperature scale the value is returned as-is.<br />
<br />
= [[Variable_data_types#Dynamic|Dynamic]] =<br />
;if(condition, valueIfTrue, valueIfFalse)<br />
:evaluates a boolean and returns value1 if true, or value2 otherwise<br />
;least(values)<br />
:returns the value that is least found a series of numeric values<br />
;most(values)<br />
:returns the value that is most found a series of numeric values<br />
;previousValue([device;attribute])<br />
:returns the previous value of the attribute<br />
<br />
= [[Variable_data_types#Number_.28Integer.29|Integers]] =<br />
;age([device﹕attribute])<br />
:returns the number of milliseconds an attribute had the current value<br />
;count(values)<br />
:calculates the number of true/non-zero/non-empty items in a series of numeric values<br />
;int()<br />
://todo<br />
;integer(decimal or string)<br />
:converts a decimal value to it's integer value<br />
;newer([device﹕attribute],[...], [device﹕attribute], threshold)<br />
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds<br />
;older([device﹕attribute],[...], [device﹕attribute], threshold)<br />
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds<br />
;previousAge([device﹕attribute])<br />
:returns the number of milliseconds that have elapsed since an attribute changed to the previous value. If there is no previous value recorded returns <code>604800000</code>, which corresponds to 7 days.<br />
:Use <code>previousAge([device﹕attribute]) - age([device﹕attribute])</code> to determine the length of time that the device attribute had the previous value.<br />
<br />
= [[Variable_data_types#Time|Time]] =<br />
;time(value)<br />
:returns the value as a time type<br />
;addSeconds(dateTime, seconds)<br />
:adds seconds to time, returns the value as a time type<br />
;addMinutes(dateTime, minutes)<br />
:adds minutes to time, returns the value as a time type<br />
;addHours(dateTime, hours)<br />
:adds hours to time, returns the value as a time type<br />
;addDays(dateTime, days)<br />
:adds days to time, returns the value as a time type<br />
;addWeeks(dateTime, weeks)<br />
:adds weeks to time, returns the value as a time type</div>Ipatersonhttps://wiki.webcore.co/index.php?title=TWC_Weather&diff=833TWC Weather2019-02-23T18:17:33Z<p>Ipaterson: /* Forecast */</p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. <code>$twcweather</code> was introduced in webCoRE v0.3.10a.20190223. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
=Conditions=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Low"</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
| <code>"Sunny"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
14 day forecast; append the index to get an individual day. For example, <code>$twcweather.forecast.temperatureMin[0]</code> is today's low temperature.<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhase</code><br />
| <br />
[<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Full Moon"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"WXG",<br />
"WXG",<br />
"WXG",<br />
"F"<br />
]<br />
|-<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcweather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Cloudy, periods of rain. Highs in the upper 40s with temperatures nearly steady overnight.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|}<br />
<br />
==Partial day forecast==<br />
<br />
The forecast includes morning and evening data for various attributes. The indexes begin at 0 for "this morning" so 2 is tomorrow morning and 3 is tomorrow evening (see the <code>daypartName</code> value). To show an icon for tonight's weather you would get the icon code with the expression <code>$twcweather.forecast.daypart[0].iconCode[1]</code><br />
<br />
Note that the first value for some attributes may be blank in the evening. For example, running a piston in the morning you may get <code>$twcweather.forecast.daypart[0].cloudCover => [ 25, 79, 100, ...]</code> but that same evening <code>$twcweather.forecast.daypart[0].cloudCover => [ null, 79, 100, ...]</code>.<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].cloudCover</code><br />
|<br />
[<br />
16,<br />
79,<br />
100,<br />
100,<br />
99,<br />
85,<br />
32,<br />
14<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
12,<br />
12,<br />
26,<br />
34,<br />
33<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
1200,<br />
1200,<br />
2600,<br />
3400,<br />
3300<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90,<br />
100,<br />
20,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipType</code><br />
|<br />
[<br />
"rain",<br />
"precip",<br />
"rain",<br />
"rain",<br />
"rain",<br />
"precip",<br />
"rain",<br />
"precip"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpf</code><br />
|<br />
[<br />
0,<br />
0,<br />
0.93,<br />
0.51,<br />
0.48,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierCode</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Q8003",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierPhrase</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Thunder possible.",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
93,<br />
96,<br />
92,<br />
76,<br />
55,<br />
72<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].snowRange</code><br />
|<br />
[<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderCategory</code><br />
|<br />
[<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"Thunder possible",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderIndex</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
1,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvDescription</code><br />
|<br />
[<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds light and variable.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseLong</code><br />
|<br />
[<br />
"Mostly Sunny",<br />
"Mostly Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"Mostly Sunny",<br />
"Mostly Clear"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseShort</code><br />
|<br />
[<br />
"M Sunny",<br />
"M Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"M Sunny",<br />
"M Clear"<br />
]<br />
|}<br />
<br />
=Weather Icons=<br />
<br />
==Usage==<br />
Choose an icon set below and use it with the iconCode values from <code>$twcweather</code>. The following examples can be used in the Value field.<br />
<br />
Current Weather using the "TWC" icon set: <code>:twc-{$twcweather.conditions.iconCode}:</code><br />
<br />
Forecast Day using the "WU v4" icon set: <code>:wu-v4-{$twcweather.forecast.daypart[0].iconCode[INDEX]}</code> note: You will need to change [INDEX] to a value from 0-7 (0 being the next forecasted half day/night and 7 being the 3rd day/night)<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Code<br />
! Description<br />
! TWC Icon<br />
! WU v4 Icon<br />
|-<br />
| 0<br />
| Tornado<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/00.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/0.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 1<br />
| Tropical Storm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/01.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/1.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 2<br />
| Hurricane<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/02.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/2.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 3<br />
| Strong Storms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/03.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/3.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 4<br />
| Thunder and Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/04.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/4.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 5<br />
| Rain to Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/05.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/5.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 6<br />
| Rain / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/06.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/6.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 7<br />
| Wintry Mix Snow / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/07.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/7.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 8<br />
| Freezing Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/08.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/8.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 9<br />
| Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/09.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/9.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 10<br />
| Freezing Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/10.png" height="50"/><br />
<code>:twc-10:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/10.svg" height="50"/><br />
<code>:wu-v4-10:</code><br />
|-<br />
| 11<br />
| Light Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/11.png" height="50"/><br />
<code>:twc-11:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/11.svg" height="50"/><br />
<code>:wu-v4-11:</code><br />
|-<br />
| 12<br />
| Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/12.png" height="50"/><br />
<code>:twc-12:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/12.svg" height="50"/><br />
<code>:wu-v4-12:</code><br />
|-<br />
| 13<br />
| Scattered Flurries<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/13.png" height="50"/><br />
<code>:twc-13:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/13.svg" height="50"/><br />
<code>:wu-v4-13:</code><br />
|-<br />
| 14<br />
| Light Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/14.png" height="50"/><br />
<code>:twc-14:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/14.svg" height="50"/><br />
<code>:wu-v4-14:</code><br />
|-<br />
| 15<br />
| Blowing / Drifting Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/15.png" height="50"/><br />
<code>:twc-15:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/15.svg" height="50"/><br />
<code>:wu-v4-15:</code><br />
|-<br />
| 16<br />
| Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/16.png" height="50"/><br />
<code>:twc-16:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/16.svg" height="50"/><br />
<code>:wu-v4-16:</code><br />
|-<br />
| 17<br />
| Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/17.png" height="50"/><br />
<code>:twc-17:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/17.svg" height="50"/><br />
<code>:wu-v4-17:</code><br />
|-<br />
| 18<br />
| Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/18.png" height="50"/><br />
<code>:twc-18:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/18.svg" height="50"/><br />
<code>:wu-v4-18:</code><br />
|-<br />
| 19<br />
| Blowing Dust / Sandstorm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/19.png" height="50"/><br />
<code>:twc-19:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/19.svg" height="50"/><br />
<code>:wu-v4-19:</code><br />
|-<br />
| 20<br />
| Foggy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/20.png" height="50"/><br />
<code>:twc-20:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/20.svg" height="50"/><br />
<code>:wu-v4-20:</code><br />
|-<br />
| 21<br />
| Haze / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/21.png" height="50"/><br />
<code>:twc-21:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/21.svg" height="50"/><br />
<code>:wu-v4-21:</code><br />
|-<br />
| 22<br />
| Smoke / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/22.png" height="50"/><br />
<code>:twc-22:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/22.svg" height="50"/><br />
<code>:wu-v4-22:</code><br />
|-<br />
| 23<br />
| Breezy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/23.png" height="50"/><br />
<code>:twc-23:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/23.svg" height="50"/><br />
<code>:wu-v4-23:</code><br />
|-<br />
| 24<br />
| Blowing Spray / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/24.png" height="50"/><br />
<code>:twc-24:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/24.svg" height="50"/><br />
<code>:wu-v4-24:</code><br />
|-<br />
| 25<br />
| Frigid / Ice Crystals<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/25.png" height="50"/><br />
<code>:twc-25:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/25.svg" height="50"/><br />
<code>:wu-v4-25:</code><br />
|-<br />
| 26<br />
| Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/26.png" height="50"/><br />
<code>:twc-26:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/26.svg" height="50"/><br />
<code>:wu-v4-26:</code><br />
|-<br />
| 27<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/27.png" height="50"/><br />
<code>:twc-27:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/27.svg" height="50"/><br />
<code>:wu-v4-27:</code><br />
|-<br />
| 28<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/28.png" height="50"/><br />
<code>:twc-28:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/28.svg" height="50"/><br />
<code>:wu-v4-28:</code><br />
|-<br />
| 29<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/29.png" height="50"/><br />
<code>:twc-29:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/29.svg" height="50"/><br />
<code>:wu-v4-29:</code><br />
|-<br />
| 30<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/30.png" height="50"/><br />
<code>:twc-30:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/30.svg" height="50"/><br />
<code>:wu-v4-30:</code><br />
|-<br />
| 31<br />
| Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/31.png" height="50"/><br />
<code>:twc-31:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/31.svg" height="50"/><br />
<code>:wu-v4-31:</code><br />
|-<br />
| 32<br />
| Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/32.png" height="50"/><br />
<code>:twc-32:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/32.svg" height="50"/><br />
<code>:wu-v4-32:</code><br />
|-<br />
| 33<br />
| Fair / Mostly Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/33.png" height="50"/><br />
<code>:twc-33:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/33.svg" height="50"/><br />
<code>:wu-v4-33:</code><br />
|-<br />
| 34<br />
| Fair / Mostly Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/34.png" height="50"/><br />
<code>:twc-34:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/34.svg" height="50"/><br />
<code>:wu-v4-34:</code><br />
|-<br />
| 35<br />
| Mixed Rain & Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/35.png" height="50"/><br />
<code>:twc-35:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/35.svg" height="50"/><br />
<code>:wu-v4-35:</code><br />
|-<br />
| 36<br />
| Hot<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/36.png" height="50"/><br />
<code>:twc-36:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/36.svg" height="50"/><br />
<code>:wu-v4-36:</code><br />
|-<br />
| 37<br />
| Isolated Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/37.png" height="50"/><br />
<code>:twc-37:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/37.svg" height="50"/><br />
<code>:wu-v4-37:</code><br />
|-<br />
| 38<br />
| Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/38.png" height="50"/><br />
<code>:twc-38:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/38.svg" height="50"/><br />
<code>:wu-v4-38:</code><br />
|-<br />
| 39<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/39.png" height="50"/><br />
<code>:twc-39:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/39.svg" height="50"/><br />
<code>:wu-v4-39:</code><br />
|-<br />
| 40<br />
| Heavy Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/40.png" height="50"/><br />
<code>:twc-40:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/40.svg" height="50"/><br />
<code>:wu-v4-40:</code><br />
|-<br />
| 41<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/41.png" height="50"/><br />
<code>:twc-41:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/41.svg" height="50"/><br />
<code>:wu-v4-41:</code><br />
|-<br />
| 42<br />
| Heavy Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/42.png" height="50"/><br />
<code>:twc-42:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/42.svg" height="50"/><br />
<code>:wu-v4-42:</code><br />
|-<br />
| 43<br />
| Blizzard<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/43.png" height="50"/><br />
<code>:twc-43:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/43.svg" height="50"/><br />
<code>:wu-v4-43:</code><br />
|-<br />
| 44<br />
| Not Available (N/A)<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/44.png" height="50"/><br />
<code>:twc-44:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/44.svg" height="50"/><br />
<code>:wu-v4-44:</code><br />
|-<br />
| 45<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/45.png" height="50"/><br />
<code>:twc-45:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/45.svg" height="50"/><br />
<code>:wu-v4-45:</code><br />
|-<br />
| 46<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/46.png" height="50"/><br />
<code>:twc-46:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/46.svg" height="50"/><br />
<code>:wu-v4-46:</code><br />
|-<br />
| 47<br />
| Scattered Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/47.png" height="50"/><br />
<code>:twc-47:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/47.svg" height="50"/><br />
<code>:wu-v4-47:</code><br />
|}<br />
<br />
==Old icon sets==<br />
<br />
Several additional icon sets are available but all have a much more limited set of icons. We have ensured that the <code>$twcWeather</code> icon code numbers map to an approximately accurate representation in the old icon sets. While the old sets work we encourage use of the more expressive TWC and WU v4 icon sets.<br />
<br />
All of the icon sets described on the original [[Weather#Weather_Icons | Weather Icons]] page work with the new codes, for example <code>:wu-b-36:</code> maps to the "sunny" icon in the "B" icon set.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Font_Awesome&diff=832Font Awesome2019-02-23T13:34:35Z<p>Ipaterson: /* Custom text over icons */ Gave up on Font Awesome bug fix and added a note about text transforms</p>
<hr />
<div><div style="float: left; clear: both; margin-right: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
== Thousands of icons ==<br />
<br />
Use this [https://fontawesome.com/icons searchable list] to find over 3000 icons supported by webCoRE. All of the icons, Free and Pro, can be used in your pistons.<br />
<br />
== Try it out ==<br />
<br />
The instructions and examples below can all be used in the Evaluation Console on any of your pistons. Just type in the icon markup as a Value and press enter to see the rendered icon. It's a quick way to experiment with icons before adding them to a piston.<br />
<br />
== Usage ==<br />
<br />
Font Awesome icons can be added to values and expressions throughout your piston, particularly useful for enriching your [[Device Tiles]] and [[Piston State]]. Font Awesome icons will not work in text displayed outside of the dashboard such as in emails, push notifications, and SMS messages.<br />
<br />
The following simple markup will be displayed as an icon:<br />
<br />
<blockquote><i class="fas fa-battery-half"></i> <code>:fas fa-battery-half:</code><br />
</blockquote><br />
Simply find the name of an icon you want to use and choose the best style<br />
<br />
* <code>fas</code> Bold, solid icons<br />
** <i class="fas fa-lock fa-lg fa-fw"></i> <i class="fas fa-bolt fa-lg fa-fw"></i> <i class="fas fa-car fa-lg fa-fw"></i><br />
* <code>far</code> Medium weight solid or outlined icons<br />
** <i class="far fa-lock fa-lg fa-fw"></i> <i class="far fa-bolt fa-lg fa-fw"></i> <i class="far fa-car fa-lg fa-fw"></i><br />
* <code>fal</code> Light, outlined icons<br />
** <i class="fal fa-lock fa-lg fa-fw"></i> <i class="fal fa-bolt fa-lg fa-fw"></i> <i class="fal fa-car fa-lg fa-fw"></i><br />
* <code>fab</code> Brand logos<br />
** <i class="fab fa-apple fa-lg fa-fw"></i> <i class="fab fa-android fa-lg fa-fw"></i> <i class="fab fa-windows fa-lg fa-fw"></i><br />
<br />
Icons can be used alongside other text in expressions and values.<br />
<br />
<blockquote><code>Welcome home :far fa-grin-hearts:!</code> Welcome home <i class="far fa-grin-hearts fa-lg"></i>!<br />
</blockquote><br />
=== Icon modifiers ===<br />
<br />
You may notice that the icon markup looks very similar to the way icons are used in the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation], <code>class=&quot;fas fa-battery-half&quot;</code>. In fact, this webCoRE markup maps to the <code>class</code> attribute so any modifiers in the Font Awesome documentation can be replicated.<br />
<br />
==== Sizing icons ====<br />
<br />
The size of Font Awesome icons can be adjusted, [https://fontawesome.com/how-to-use/on-the-web/styling/sizing-icons see all sizes here]. All sizes are relative to the surrounding text so the size of a <code>fa-3x</code> icon in the evaluation console may not exactly match the size of a <code>fa-3x</code> icon in a tile.<br />
<br />
<blockquote><i class="fas fa-clock"></i> <code>:fas fa-clock:</code><br />
<br />
<i class="fas fa-clock fa-xs"></i> <code>:fas fa-clock fa-xs:</code><br />
<br />
<i class="fas fa-clock fa-2x"></i> <code>:fas fa-clock fa-2x:</code><br />
<br />
<i class="fas fa-clock fa-4x"></i> <code>:fas fa-clock fa-4x:</code><br />
</blockquote><br />
==== Rotating icons ====<br />
<br />
If you need an icon to face a different direction, use [https://fontawesome.com/how-to-use/on-the-web/styling/rotating-icons a rotation].<br />
<br />
<blockquote><i class="fal fa-bicycle fa-lg fa-fw"></i> <code>:fal fa-bicycle:</code><br />
<br />
<i class="fal fa-bicycle fa-rotate-180 fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-rotate-180:</code><br />
<br />
<i class="fal fa-bicycle fa-flip-vertical fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-flip-vertical:</code><br />
</blockquote><br />
==== Animating icons ====<br />
<br />
Icons can spin, [https://fontawesome.com/how-to-use/on-the-web/styling/animating-icons learn more here].<br />
<br />
<blockquote><i class="fas fa-circle-notch fa-spin fa-lg fa-fw"></i> <code>:fas fa-circle-notch fa-spin:</code><br />
</blockquote><br />
==== Power transforms ====<br />
<br />
While Font Awesome provides a handful of sizing options from <code>fa-xs</code> to <code>fa-10x</code> and rotations like <code>fa-rotate-90</code>, in some cases it is useful to have more granular control over icon size and position.<br />
<br />
Note that unlike the sizing options, power transforms like this one <i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10" style="opacity: .5"></i> do not affect the flow of text around icons. The transform is a sort of &quot;after effect&quot; that changes how the icon is displayed. To use power transforms in webCoRE, simply add the transform markup to the icon.<br />
<br />
<blockquote><i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10"></i> <code>:fas fa-exclamation data-fa-transform=&quot;grow-20 rotate-10&quot;:</code><br />
</blockquote><br />
See the [https://fontawesome.com/how-to-use/on-the-web/styling/power-transforms documentation and examples] to learn more about scaling, positioning, rotating, and flipping with power transforms. Power transforms are also used extensively in the Combining Icons section.<br />
<br />
=== Combining icons ===<br />
<br />
Font Awesome provides very powerful tools for mixing icons together, in webCoRE we use a different type of markup for these icon containers. <code>[modifiers|content]</code> format allows you to create a container element around the content with the specified modifiers on that container.<br />
<br />
Follow the features described below to build complex and dynamic icons like this calendar that could show the day of the month and number of alerts today:<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">27</span><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
27<br />
]<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Stacked icons ====<br />
<br />
Combine two icons stacked with center alignment. The order of the icons matters; the first icon specified will be layered behind the second. [https://fontawesome.com/how-to-use/on-the-web/styling/stacking-icons Learn more here]<br />
<br />
<blockquote><i class="fab fa-reddit-alien fa-lg"></i> <code>:fab fa-reddit-alien:</code><br />
<br />
<i class="fas fa-certificate fa-lg"></i> <code>:fas fa-certificate:</code><br />
<br />
<span class="fa-stack fa-lg"><i class="fas fa-certificate fa-stack-2x"></i><i class="fab fa-reddit-alien fa-inverse fa-stack-1x"></i></span><br />
<pre>[fa-stack fa-lg|<br />
:fas fa-certificate fa-stack-2x:<br />
:fab fa-reddit-alien fa-inverse fa-stack-1x:<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE markup for colors for more distinct icons:<br />
<br />
<blockquote><i class="fas fa-swimmer fa-lg"></i> <code>:fas fa-swimmer:</code><br />
<br />
<i class="far fa-ban fa-lg"></i> <code>:far fa-ban:</code><br />
<br />
<span class="fa-stack fa-2x"><i class="fas fa-swimmer fa-stack-1x"></i><i class="far fa-ban fa-stack-2x" style="color: red"></i></span><br />
<pre>[fa-stack fa-2x|<br />
:fas fa-swimmer fa-stack-1x:<br />
[color-red|:far fa-ban fa-stack-2x:]<br />
]<br />
</pre><br />
</blockquote><br />
==== Layered icons ====<br />
<br />
Layering is similar to stacking but with full control over the positioning and number of icons. Font Awesome provides [https://fontawesome.com/how-to-use/on-the-web/styling/layering many good examples].<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-play" data-fa-transform="rotate--90 grow-2"></i><i class="fas fa-sun fa-inverse" data-fa-transform="shrink-10 up-2"></i><i class="fas fa-moon fa-inverse" data-fa-transform="shrink-11 down-4.2 left-4"></i><i class="fas fa-star fa-inverse" data-fa-transform="shrink-11 down-4.2 right-3"></i></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-play data-fa-transform=&quot;rotate--90 grow-2&quot;:<br />
:fas fa-sun fa-inverse data-fa-transform=&quot;shrink-10 up-2&quot;:<br />
:fas fa-moon fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 left-4&quot;:<br />
:fas fa-star fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 right-3&quot;:<br />
]<br />
</pre><br />
</blockquote><br />
==== Badges over icons ====<br />
<br />
Layered icons also provide a convenient mechanism for showing a counter or badge in the upper right corner of an icon.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-exclamation-triangle"></i><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-exclamation-triangle:<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE background color to change the badge color.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="far fa-comment"></i><span class="fa-layers-counter" style="background-color: royalblue">15</span></span><br />
<pre>[fa-layers fa-3x|<br />
:far fa-comment:<br />
[fa-layers-counter bg-royalblue|<br />
15<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Custom text over icons ====<br />
<br />
Apply transforms to custom text. <br />
<br />
Sorry, folks this one does not actually work in webCoRE yet. We're still waiting on a fix for the [https://github.com/FortAwesome/Font-Awesome/issues/13497 bug reported on GitHub] when we first updated to Font Awesome 5. The <code>fa-layers-text</code> does not work with transforms so the text in these sample icons appears far too large in webCoRE. If this affects you, please consider replying to the bug report on GitHub.<br />
<br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-certificate"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-11.5 rotate--30" style="font-weight:bold">NEW</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-certificate:<br />
[fa-layers-text fa-inverse b data-fa-transform=&quot;shrink-11.5 rotate--30&quot;|<br />
NEW<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">12</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
12<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
<br />
=== Other supported features ===<br />
<br />
Please refer to the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation] for additional features and examples. Use masking to &quot;cut out&quot; one icon from another, add borders, and use a fixed width for consistent alignment.<br />
<br />
=== Unsupported features ===<br />
<br />
webCoRE expressions do not support [https://fontawesome.com/how-to-use/on-the-web/styling/icons-in-a-list Icons in a list] since it requires the <code>ul</code> and <code>li</code> elements, but you can achieve the same visual effect with fixed-width icons on multiple lines.<br />
<br />
== Font Awesome 4 Deprecated ==<br />
<br />
Pistons that used icons from the previous version of Font Awesome will continue to work, though the icons may appear slightly different in Font Awesome 5. Please discontinue use of the <code>:fa fa-lock:</code> and shorthand <code>:fa-lock:</code> markup in favor of the Font Awesome 5 styles and icon names.<br />
<br />
The dashboard uses a shim published by the Font Awesome team that maps v4 icons to v5.<br />
<br />
== Font Awesome Pro license ==<br />
<br />
The dashboard and other official webcore.co sites are authorized to use our Font Awesome 5 Pro license. If you choose to run an independent copy of the webCoRE dashboard, only a limited set of Font Awesome icons will be available. Missing icons will be indicated by a placeholder:<br />
<br />
<i class="far fa-missing-icon fa-lg"></i><br />
<br />
When Font Awesome Pro cannot be loaded the dashboard will modify all icons embedded in the UI to work with the free version of Font Awesome 5. Icons specified in pistons are not modified so Font Awesome 5 Pro will not work without a Pro license. If you have purchased a Font Awesome Pro license, simply add your dashboard domain to the whitelist on your license to enable Pro icons – no code changes are required.<br />
<br />
Font Awesome Pro icons will load when the dashboard is run from localhost.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=TWC_Weather&diff=831TWC Weather2019-02-23T12:42:56Z<p>Ipaterson: /* Old icon sets */</p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. <code>$twcweather</code> was introduced in webCoRE v0.3.10a.20190223. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
=Conditions=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Low"</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
| <code>"Sunny"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhase</code><br />
| <br />
[<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Full Moon"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"WXG",<br />
"WXG",<br />
"WXG",<br />
"F"<br />
]<br />
|-<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcweather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Cloudy, periods of rain. Highs in the upper 40s with temperatures nearly steady overnight.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].cloudCover</code><br />
|<br />
[<br />
16,<br />
79,<br />
100,<br />
100,<br />
99,<br />
85,<br />
32,<br />
14<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
12,<br />
12,<br />
26,<br />
34,<br />
33<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
1200,<br />
1200,<br />
2600,<br />
3400,<br />
3300<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90,<br />
100,<br />
20,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipType</code><br />
|<br />
[<br />
"rain",<br />
"precip",<br />
"rain",<br />
"rain",<br />
"rain",<br />
"precip",<br />
"rain",<br />
"precip"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpf</code><br />
|<br />
[<br />
0,<br />
0,<br />
0.93,<br />
0.51,<br />
0.48,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierCode</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Q8003",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierPhrase</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Thunder possible.",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
93,<br />
96,<br />
92,<br />
76,<br />
55,<br />
72<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].snowRange</code><br />
|<br />
[<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderCategory</code><br />
|<br />
[<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"Thunder possible",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderIndex</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
1,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvDescription</code><br />
|<br />
[<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds light and variable.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseLong</code><br />
|<br />
[<br />
"Mostly Sunny",<br />
"Mostly Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"Mostly Sunny",<br />
"Mostly Clear"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseShort</code><br />
|<br />
[<br />
"M Sunny",<br />
"M Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"M Sunny",<br />
"M Clear"<br />
]<br />
|}<br />
<br />
=Weather Icons=<br />
<br />
==Usage==<br />
Choose an icon set below and use it with the iconCode values from <code>$twcweather</code>. The following examples can be used in the Value field.<br />
<br />
Current Weather using the "TWC" icon set: <code>:twc-{$twcweather.conditions.iconCode}:</code><br />
<br />
Forecast Day using the "WU v4" icon set: <code>:wu-v4-{$twcweather.forecast.daypart[0].iconCode[INDEX]}</code> note: You will need to change [INDEX] to a value from 0-7 (0 being the next forecasted half day/night and 7 being the 3rd day/night)<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Code<br />
! Description<br />
! TWC Icon<br />
! WU v4 Icon<br />
|-<br />
| 0<br />
| Tornado<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/00.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/0.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 1<br />
| Tropical Storm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/01.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/1.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 2<br />
| Hurricane<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/02.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/2.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 3<br />
| Strong Storms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/03.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/3.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 4<br />
| Thunder and Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/04.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/4.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 5<br />
| Rain to Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/05.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/5.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 6<br />
| Rain / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/06.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/6.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 7<br />
| Wintry Mix Snow / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/07.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/7.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 8<br />
| Freezing Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/08.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/8.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 9<br />
| Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/09.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/9.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 10<br />
| Freezing Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/10.png" height="50"/><br />
<code>:twc-10:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/10.svg" height="50"/><br />
<code>:wu-v4-10:</code><br />
|-<br />
| 11<br />
| Light Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/11.png" height="50"/><br />
<code>:twc-11:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/11.svg" height="50"/><br />
<code>:wu-v4-11:</code><br />
|-<br />
| 12<br />
| Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/12.png" height="50"/><br />
<code>:twc-12:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/12.svg" height="50"/><br />
<code>:wu-v4-12:</code><br />
|-<br />
| 13<br />
| Scattered Flurries<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/13.png" height="50"/><br />
<code>:twc-13:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/13.svg" height="50"/><br />
<code>:wu-v4-13:</code><br />
|-<br />
| 14<br />
| Light Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/14.png" height="50"/><br />
<code>:twc-14:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/14.svg" height="50"/><br />
<code>:wu-v4-14:</code><br />
|-<br />
| 15<br />
| Blowing / Drifting Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/15.png" height="50"/><br />
<code>:twc-15:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/15.svg" height="50"/><br />
<code>:wu-v4-15:</code><br />
|-<br />
| 16<br />
| Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/16.png" height="50"/><br />
<code>:twc-16:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/16.svg" height="50"/><br />
<code>:wu-v4-16:</code><br />
|-<br />
| 17<br />
| Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/17.png" height="50"/><br />
<code>:twc-17:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/17.svg" height="50"/><br />
<code>:wu-v4-17:</code><br />
|-<br />
| 18<br />
| Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/18.png" height="50"/><br />
<code>:twc-18:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/18.svg" height="50"/><br />
<code>:wu-v4-18:</code><br />
|-<br />
| 19<br />
| Blowing Dust / Sandstorm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/19.png" height="50"/><br />
<code>:twc-19:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/19.svg" height="50"/><br />
<code>:wu-v4-19:</code><br />
|-<br />
| 20<br />
| Foggy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/20.png" height="50"/><br />
<code>:twc-20:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/20.svg" height="50"/><br />
<code>:wu-v4-20:</code><br />
|-<br />
| 21<br />
| Haze / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/21.png" height="50"/><br />
<code>:twc-21:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/21.svg" height="50"/><br />
<code>:wu-v4-21:</code><br />
|-<br />
| 22<br />
| Smoke / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/22.png" height="50"/><br />
<code>:twc-22:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/22.svg" height="50"/><br />
<code>:wu-v4-22:</code><br />
|-<br />
| 23<br />
| Breezy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/23.png" height="50"/><br />
<code>:twc-23:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/23.svg" height="50"/><br />
<code>:wu-v4-23:</code><br />
|-<br />
| 24<br />
| Blowing Spray / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/24.png" height="50"/><br />
<code>:twc-24:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/24.svg" height="50"/><br />
<code>:wu-v4-24:</code><br />
|-<br />
| 25<br />
| Frigid / Ice Crystals<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/25.png" height="50"/><br />
<code>:twc-25:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/25.svg" height="50"/><br />
<code>:wu-v4-25:</code><br />
|-<br />
| 26<br />
| Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/26.png" height="50"/><br />
<code>:twc-26:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/26.svg" height="50"/><br />
<code>:wu-v4-26:</code><br />
|-<br />
| 27<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/27.png" height="50"/><br />
<code>:twc-27:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/27.svg" height="50"/><br />
<code>:wu-v4-27:</code><br />
|-<br />
| 28<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/28.png" height="50"/><br />
<code>:twc-28:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/28.svg" height="50"/><br />
<code>:wu-v4-28:</code><br />
|-<br />
| 29<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/29.png" height="50"/><br />
<code>:twc-29:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/29.svg" height="50"/><br />
<code>:wu-v4-29:</code><br />
|-<br />
| 30<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/30.png" height="50"/><br />
<code>:twc-30:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/30.svg" height="50"/><br />
<code>:wu-v4-30:</code><br />
|-<br />
| 31<br />
| Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/31.png" height="50"/><br />
<code>:twc-31:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/31.svg" height="50"/><br />
<code>:wu-v4-31:</code><br />
|-<br />
| 32<br />
| Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/32.png" height="50"/><br />
<code>:twc-32:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/32.svg" height="50"/><br />
<code>:wu-v4-32:</code><br />
|-<br />
| 33<br />
| Fair / Mostly Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/33.png" height="50"/><br />
<code>:twc-33:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/33.svg" height="50"/><br />
<code>:wu-v4-33:</code><br />
|-<br />
| 34<br />
| Fair / Mostly Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/34.png" height="50"/><br />
<code>:twc-34:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/34.svg" height="50"/><br />
<code>:wu-v4-34:</code><br />
|-<br />
| 35<br />
| Mixed Rain & Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/35.png" height="50"/><br />
<code>:twc-35:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/35.svg" height="50"/><br />
<code>:wu-v4-35:</code><br />
|-<br />
| 36<br />
| Hot<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/36.png" height="50"/><br />
<code>:twc-36:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/36.svg" height="50"/><br />
<code>:wu-v4-36:</code><br />
|-<br />
| 37<br />
| Isolated Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/37.png" height="50"/><br />
<code>:twc-37:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/37.svg" height="50"/><br />
<code>:wu-v4-37:</code><br />
|-<br />
| 38<br />
| Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/38.png" height="50"/><br />
<code>:twc-38:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/38.svg" height="50"/><br />
<code>:wu-v4-38:</code><br />
|-<br />
| 39<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/39.png" height="50"/><br />
<code>:twc-39:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/39.svg" height="50"/><br />
<code>:wu-v4-39:</code><br />
|-<br />
| 40<br />
| Heavy Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/40.png" height="50"/><br />
<code>:twc-40:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/40.svg" height="50"/><br />
<code>:wu-v4-40:</code><br />
|-<br />
| 41<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/41.png" height="50"/><br />
<code>:twc-41:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/41.svg" height="50"/><br />
<code>:wu-v4-41:</code><br />
|-<br />
| 42<br />
| Heavy Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/42.png" height="50"/><br />
<code>:twc-42:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/42.svg" height="50"/><br />
<code>:wu-v4-42:</code><br />
|-<br />
| 43<br />
| Blizzard<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/43.png" height="50"/><br />
<code>:twc-43:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/43.svg" height="50"/><br />
<code>:wu-v4-43:</code><br />
|-<br />
| 44<br />
| Not Available (N/A)<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/44.png" height="50"/><br />
<code>:twc-44:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/44.svg" height="50"/><br />
<code>:wu-v4-44:</code><br />
|-<br />
| 45<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/45.png" height="50"/><br />
<code>:twc-45:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/45.svg" height="50"/><br />
<code>:wu-v4-45:</code><br />
|-<br />
| 46<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/46.png" height="50"/><br />
<code>:twc-46:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/46.svg" height="50"/><br />
<code>:wu-v4-46:</code><br />
|-<br />
| 47<br />
| Scattered Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/47.png" height="50"/><br />
<code>:twc-47:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/47.svg" height="50"/><br />
<code>:wu-v4-47:</code><br />
|}<br />
<br />
==Old icon sets==<br />
<br />
Several additional icon sets are available but all have a much more limited set of icons. We have ensured that the <code>$twcWeather</code> icon code numbers map to an approximately accurate representation in the old icon sets. While the old sets work we encourage use of the more expressive TWC and WU v4 icon sets.<br />
<br />
All of the icon sets described on the original [[Weather#Weather_Icons | Weather Icons]] page work with the new codes, for example <code>:wu-b-36:</code> maps to the "sunny" icon in the "B" icon set.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=webCoRE&diff=830webCoRE2019-02-23T12:41:49Z<p>Ipaterson: </p>
<hr />
<div><youtube>jgXA_rv2-_8</youtube><br />
<br />
<div style="float: left; clear: both; margin-right: 2em; margin-top: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
= General =<br />
The ''web Community's own Rule Engine'' (or for short, webCoRE) is a general rule engine for SmartThings. It works by allowing users to create scripts that are interpreted and executed by the SmartThings SmartApp, allowing for complex decisions. webCoRE is currently a work in progress. webCoRE reached the first Beta milestone on April 29, 2017. <br />
<br />
Currently webCoRE is in the Second Beta milestone as of June 7th, 2017. Lots of bugs have been squashed and several new features have been implemented. <br />
<br />
Please review the [[webCoRE todo]] list for a loose road map.<br />
<br />
=Definitions=<br />
{{:Glossary}}<br />
<br />
= Getting started =<br />
A few steps need to be completed before you can use webCoRE. First, webCoRE needs to be installed in your SmartThings account, then automations need to be configured. These are called [[Piston|pistons]] and will be detailed later. So let's start by installing webCoRE, please follow the steps below. <br />
<br />
Please be sure to read through all the instructions. If you are still getting stuck then check the troubleshooting sections. Should you still have problems then please feel free to ask for some help on the SmartThings Forums. Be sure to find the latest webCoRE help post.<br />
<br />
=Installing webCoRE=<br />
These instructions will guide you through installing webCoRE via GitHub integration or manually all the way to adding devices and authorizing your browser for use. Be sure to follow all the steps as proper order is crucial when installing for the first time.<br />
<br />
==GitHub Installation (preferred method)==<br />
<br />
<youtube>y_ElUwmmI6Y</youtube><br />
<br />
# If you are in the UK/EU, click this link [https://graph-eu01-euwest1.api.smartthings.com/githubAuth/step1 link] and follow the on-screen instructions to activate GitHub integration for your IDE shard.<br />
# Login to the [https://account.smartthings.com SmartThings IDE].<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''Settings''' button at the top of the page.<br />
#:[[File:Settings.jpg]]<br />
# Click the '''Add new repository''' link at the bottom of the pop up.<br />
# Enter <code>ady624</code> in the '''Owner''' column.<br />
# Enter <code>webCoRE</code> in the '''Name''' column.<br />
# Enter <code>master</code> in the '''Branch''' column.<br />
# Click '''Save''' (do not hit the Enter key, it will exit the form without saving).<br />
#:[[File:Githubrepo.jpg|frameless|400px]]<br />
# Click '''Update From Repo'''.<br />
# Select '''webCoRE (master)''' from the list.<br />
#:[[File:Update.jpg]]<br />
# Check "webCore.groovy" from the '''New (only in GitHub)''' box. {{Warning |Do not update all at once}}<br />
#:[[File:Githubinstall_webcoreonly.png]]<br />
# Check the '''Publish''' checkbox at the bottom of the pop up.<br />
#:[[File:Ide_update.png]]<br />
# Click the '''Execute Update''' button.<br />
#:[[File:Ide_update-new.png]]<br />
# Click again on '''Update From Repo'''.<br />
# Select '''webCoRE (master)''' from the list.<br />
#:[[File:Update.jpg]]<br />
# Check "webCoRE Piston.groovy", "webCoRE Storage.groovy"and "webCoRE Dashboard.groovy" from the '''New (only in GitHub)''' box.<br />
#:[[File:Githubinstall_allchecked.png]]<br />
# Check the '''Publish''' checkbox at the bottom of the pop up.<br />
#:[[File:Ide_update.png]]<br />
# Click the '''Execute Update''' button.<br />
#:[[File:Ide_update-new.png]]<br />
<br />
==Manual Install==<br />
<br />
<br />
=== webCoRE Smart App ===<br />
<br />
# Login to the [https://account.smartthings.com SmartThings IDE].<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore.src/webcore.groovy webCore.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save'''.<br />
# Click '''Publish'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Piston Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-piston.src/webcore-piston.groovy webCoRE-piston.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Storage Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-storage.src/webcore-storage.groovy webCoRE-storage.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Dashboard Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-dashboard.src/webcore-dashboard.groovy webCoRE-dashboard.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
<br />
<br />
==Enabling OAuth for webCoRE==<br />
# Navigate to the '''My SmartApps''' page if you are not already there.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the edit button to the left of '''ady624 : webCoRE''', it looks like a rounded square with a pencil in it.<br />
#:[[File:Editwebcore.jpg]]<br />
# Scroll down and click on '''OAuth'''.<br />
# Click the '''Enable OAuth in SmartApp''' button.<br />
# Click the '''Update''' button at the bottom of the page.<br />
#:[[File:Oauth.jpg|frameless|600px]]<br />
<br />
<br />
<br />
==Installing webCoRE==<br />
# Open the SmartThings app on your mobile device.<br />
# Tap the '''Marketplace''' icon at the bottom of the screen. If you are in a Room or Device within the app you will need to go back to '''My Home'''.<br />
# Tap the '''SmartApps''' header at the top of the page.<br />
# Scroll down and tap '''My Apps'''.<br />
# Scroll down until you find '''webCoRE''' and tap it. Do not tap '''webCoRE Piston'''. If you can't find '''webCore''' you likely skipped some steps above.<br />
# Tap '''Next'''.<br />
# Here you can change the name from '''webCoRE''' to anything you desire then tap '''Next'''. (''Recommend leaving it unless you are working with multiple instances.'')<br />
# Choose a password and expiration length then tap '''Next'''.<br />
# Scroll through the list and select all of the devices you want webCoRE to have access to. If you do not do this, you will not be able to use those devices in webCoRE. This must also be done again when adding new devices to your SmartThings Account. webCoRE will not automatically import them.<br />
# Tap '''Next'''.<br />
# Tap '''Done'''.<br />
<br />
<br />
<br />
==Opening the new dashboard from your phone==<br />
# From within the SmartThings app, tap the Automations icon at the bottom of the screen and select the SmartApps section.<br />
# Scroll down and tap the name of the webCoRE instance you are trying to access. This is typically webCoRE, unless you edited the name during the installation process.<br />
# Tap Dashboard.<br />
# You will be prompted to enter the security password, the same password you created when you installed webCoRE.<br />
<br />
<br />
<br />
==Using webCoRE from another browser==<br />
You cannot bookmark the URL you launched from the SmartThing app. In order to use webCoRE on another device you must follow these instructions.<br />
<br />
# From within the SmartThings app, tap the '''Automations''' icon at the bottom of the screen and select the '''SmartApps''' section.<br />
# Scroll down and tap the name of the webCoRE instance you are trying to access. This is typically '''webCoRE''', unless you edited the name during the installation process.<br />
# Tap '''Register a browser''', a page will appear providing you with a registration code. The code expires in 3 minutes and can only be used once.<br />
#: [[File:Register-browser.png|Register a Browser]] [[File:Register-browser-code.png|Register a Browser]]<br />
# On your other device, open the browser and visit <i>[https://webcore.co/re webcore.co/re]</i><br />
# Enter the code and click '''Register'''.<br />
# You will be prompted to enter the security password, the same password you created when you installed webCoRE.<br />
<br />
<br />
<br />
= Updating webCoRE =<br />
[[file:UpdateAlert.png]]<BR><br />
When you see the alert that there is a new version available or that your smartapps are not the same version then you will need to update the webCoRE code. This has a few benefits besides being on the latest and greatest version. It is best to keep webCoRE up to date because bugs are constantly getting squashed and new features added with each version. This will make troubleshooting easier when you are running into issues and seeking help. Lastly SmartThings keeps the most used SmartApps in their cache which means quicker response times on your pistons. <br />
<br />
For those of you with gitHub integration this is a quick and painless process. If you manually installed then it is a similar process as before. Either way updating only takes a few minutes of your time. <br />
<br />
== GitHub ==<br />
#Log into the [https://account.smartthings.com SmartThings IDE].<br />
#Select My SmartApps<br />
#*You will see all the webCoRE SmartApps listed in a purple color<br />
#Click update from Repo<br />
#Select webCoRE(Master)<br />
#*In the Obsolete column you will see the 4 webCoRE SmartApps<br />
#Select all 4 checkboxes<br />
#Click the publish checkbox<br />
#Click Execute Update<br />
<br />
== Manual Update == <br />
This requires a little bit more work than gitHub integration but still will only take a few moments. Visit the links below and copy and paste the new raw code over the obsolete code then publish and execute update.<br />
<br />
<br />
{| class="wikitable"<br />
|+ Link to Raw gitHub code<br />
|-<br />
! webCoRE<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore.src/webcore.groovy<br />
|-<br />
! webCoRE Dashboard<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-dashboard.src/webcore-dashboard.groovy<br />
|-<br />
! webCoRE Piston<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-piston.src/webcore-piston.groovy<br />
|-<br />
! webCoRE Storage<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-storage.src/webcore-storage.groovy<br />
|}<br />
<br />
== Update Complete ==<br />
That is all you have to do. Your webCoRE instance's are now up to date. However if you have multiple locations(hubs) then you will need to do this for each location(hub).<br />
<br />
=Troubleshooting=<br />
Here are some common troubleshooting things to try if you are having issues with the following categories<br />
<br />
==Installation==<br />
[[File:500error.png|frameless|400px]]<br><br />
<br />
If you receive this error it may be because you installed and published both "webCore.groovy" and other SmartApps at the same time. Please do them in order per the instructions. Be sure to install/publish "webCore.groovy" first then the others after (See steps 11-16). You can do the other SmartApps at the same time after "webCore.groovy" has been installed and published.<br />
<br />
<br />
==General==<br />
Endless Spinning Square<br />
#Open The SmartThings App<br />
#Go into settings<br />
#Click the map location<br />
#Move the pin on the map around<br />
#Position on your actual location<br />
#save actual location<br />
#Save the settings<br />
<br />
<br />
= Creating your first piston =<br />
{{:Creating your first piston}}<br />
<br />
=Sample Pistons=<br />
This section has some user contributed sample pistons. You can import any of these pistons using the import code displayed at the top of the piston.<br />
# [[Samples]]<br />
<br />
= Understanding the basics =<br />
webCoRE is comprised of the three main components listed below.<br />
<br />
== The webCoRE child SmartApp (''webCoRE Piston'') ==<br />
The webCoRE child SmartApp is also known as a [[Piston|piston]]. It is responsible for executing the automation script that the user creates and does the heavy lifting in the whole webCoRE ecosystem. It is directly managed by the webCoRE parent SmartApp, which can create, maintain, and delete a Piston.<br />
<br />
== The webCoRE parent SmartApp (''webCoRE'') ==<br />
The wabCoRE parent SmartApp is the component responsible for managing the child SmartApp instances and their relationship with the Dashboard. It is the middle man that allows adding new Pistons, maintaining them, or deleting them. It is also responsible with the security of the whole ecosystem, allowing password secured access from the Dashboard.<br />
<br />
== The [[Dashboard|dashboard]] ==<br />
The Dashboard is an [https://en.wikipedia.org/wiki/HTML HTML] interface for webCoRE that allows users to manage their webCoRE installation. It is the central hub to controlling webCoRE, allowing the user to create, modify, test, and delete Pistons.<br />
<br />
=Anatomy of a webCoRE Piston=<br />
::''Main article [[Piston]]''<br />
A piston is a script that contains a collection of elements, arranged so that the logic and flow of the piston perform tasks in a desired sequence. It is broken down into several sections, each having its own important role.<br />
<br />
//todo: most details below need to be moved into the main article<br />
<br />
==The ''settings'' section==<br />
This menu is accessed from the piston editor. In the upper right hand corner select options and then enable <code>Show piston settings</code><br />
<br />
<br />
[[file:pistonoptions.png]]<br />
<br />
These settings allows configuration of how certain aspects of the piston function. <br />
<br />
[[file:pistonsettings.png|frameless|500px]]<br />
<br />
*'''Name''' - Change the name of a piston.<br />
*'''Description''' - Give a description of what the piston does.<br />
*'''Automatic piston state''' - Change whether the piston handles it state or make it manual and you can control the piston's state.<br />
*'''Piston execution parallelism''' - //todo<br />
*'''Condition traversal optimizations''' - //todo<br />
*'''Event subscriptions''' - Allow event subscriptions or turn them off if you would like to make the piston a follow up style piston. If you disable this then you must have some other means for the piston to be fired.<br />
*'''Command execution delay''' - A delay in milliseconds for commands to be executed piston wide.<br />
<br />
==The ''define'' section==<br />
This menu is accessed from the piston editor. In the upper right hand corner select options and then enable <code>Show variables</code><br />
<br />
<br />
[[file:pistonoptions.png]]<br />
<br />
A very powerful feature of webCoRE is the ability to use [[Variable|variables]]. Think of variables as temporary pockets where you can store information and are able to later retrieve and use this information for any purpose. This information can be used either during the current piston run, or at a later time, when another event occurs.<br />
<br />
[[file:pistondefine.png|frameless|500px]]<br />
<br />
*'''Type''' - You can select from the different [[Variable_data_types|Variable Data Types]] for you variable.<br />
*'''Name''' - This is the empty box next to the type. Enter a name for your variable.<br />
*'''Initial value''' - This is defaulted to <code>Nothing selected</code>. If you decide to give it an initial value then that value will be used at each piston run regardless of what is stored in later piston runs.<br />
*'''Description''' - Give a description of what the variable is used for.<br />
<br />
==The ''execute'' section==<br />
This section describes the piston's logic flow. This is the starting point of most executions. Whenever a device event happens, the piston starts its execution here. To get started click on <code>Add a new statement</code><br />
<br />
[[file:executesimple.png|frameless|500px]]<br />
<br />
<br />
These are you 3 basic building blocks with their description listed below them. There are several more options to choose from aside from these three. In order to gain access to these you will again have to visit that trusty options menu in the top right hand corner and select <code>Show advanced statments</code><br />
<br />
[[file:pistonoptions.png]]<br />
<br />
<br />
After you do this and you click on <code>Add a new statement</code> you will now have access to all the available statement options.<br />
<br />
[[file:executeadvanced.png|frameless|500px]]<br />
<br />
=Misc Pages=<br />
==[[webCoRE Logging]]==<br />
==[[Functions]]==<br />
==[[Expressions]]==<br />
==[[Case_Traversal_Policy|Case Traversal Policy]]==<br />
==[[Execution_Method|Execution Method]]==<br />
==[[Piston_State|Piston State]]==<br />
==[[Font_Awesome|Icons with Font Awesome]]==<br />
==[[Task_Scheduling_Policy|Task Scheduling Policy]]==<br />
==[[TWC Weather | Weather]]==<br />
==[[NFL | NFL API]]==<br />
<br />
<br />
<seo keywords="webCoRE,dashboard,smart home,automation,SmartThings,rule engine,zigbee,z-wave,smart device" description="The official wiki for webCoRE, the Web-enabled Community's own Rule Engine SmartApp"></seo></div>Ipatersonhttps://wiki.webcore.co/index.php?title=Weather&diff=829Weather2019-02-23T12:41:09Z<p>Ipaterson: </p>
<hr />
<div>=<span style="color: red"><i class="fas fa-exclamation-triangle fa-lg"></i> Deprecated</span>=<br />
<br />
<span style="color: red">The Weather Underground API is no longer available and all datapoints will be return zero or null. SmartThings users should update pistons to use [[TWC Weather]] or weather smart apps.</span><br />
<br />
----<br />
<br />
:This feature pulls from the Weather Underground Data API. The location is automatically set from the location of your hub. Use the information below to incorporate this robust API into your pistons. Further documentation can be found [https://www.wunderground.com/weather/api/d/docs here] on the Weather Underground website. <br />
<br />
<div style="float: left; clear: both; margin-right: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
=Alerts=<br />
:Returns the short name description, expiration time and a long text description of a severe alert, if one has been issued for your location.<br />
<br />
==Type==<br />
[[File:Shorthand.png|page=1|thumb|232px|Chart of alert codes]]<br />
:Syntax<br />
::<code>$weather.alerts.alerts.type</code><br />
:Returns<br />
::Returns a 3 letter code of any alerts in your area.<br />
:Example<br />
::<code>[WAT, SPE]</code><br />
<br />
==Description==<br />
:Syntax<br />
::<code>$weather.alerts.alerts.description</code><br />
:Returns<br />
::Returns a full text description of any alerts in your area. <br />
:Example<br />
::<code>[Areal Flood Advisory, Special Statement]</code><br />
<br />
==Date==<br />
:Syntax<br />
::<code>$weather.alerts.alerts.date</code><br />
:Returns<br />
::Returns the time and date of when alerts went into effect.<br />
:Example<br />
::<code>[8:28 PM CDT on July 13, 2017, 8:41 PM CDT on July 13, 2017]</code><br />
<br />
==Date Epoch==<br />
:Syntax<br />
::<code>$weather.alerts.alerts.date_epoch</code><br />
:Returns<br />
::Returns the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT) till the alert went into effect.<br />
:Example<br />
::<code>[1499995680, 1499996460]</code><br />
<br />
<br />
==Expires==<br />
:Syntax<br />
::<code>$weather.alerts.alerts.expires</code><br />
:Returns<br />
::Returns the time and date of when the alerts expire.<br />
:Examples<br />
::<code>[2:30 AM CDT on July 14, 2017, 9:15 PM CDT on July 13, 2017]</code><br />
<br />
==Expires Epoch==<br />
:Syntax<br />
::<code>$weather.alerts.alerts.expires_epoch</code><br />
:Returns<br />
::Returns the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT) till the alert expires<br />
:Examples<br />
::<code>[1500017400, 1499998500]</code><br />
<br />
==Message==<br />
:Syntax<br />
::<code>$weather.alerts.alerts.message</code><br />
:Returns<br />
::Returns the full weather alert message <br />
:Examples<br />
::<code>[ The National Weather Service in Pleasant Hill has issued a * urban and small stream flood advisory for... Johnson County in east central Kansas... * until 230 am CDT Friday * at 826 PM CDT, Doppler radar indicated heavy rain due to thunderstorms. This will cause urban and small stream flooding in the advisory area. Up to two to three inches of rain have already fallen with an additional one to two inches possible over the next two hours to three hours. * Some locations that will experience flooding include... Overland Park, Olathe, Shawnee, Lenexa, Leawood, Prairie Village, Gardner, Merriam, mission, Bonner Springs, De Soto, Spring Hill, Fairway, Mission Hills, Edgerton, Westwood, Lake quivira, Westwood Hills, Mission Woods and Countryside. Precautionary/preparedness actions... Turn around, don't drown when encountering flooded roads. Most flood deaths occur in vehicles. Be especially cautious at night when it is harder to recognize the dangers of flooding. Lat...Lon 3899 9502 3900 9502 3898 9495 3900 9492 3898 9492 3901 9489 3906 9487 3906 9484 3904 9480 3904 9461 3874 9461 3874 9500 3897 9504 Welsh 828 PM CDT Thu Jul 13 2017 The National Weather Service in Pleasant Hill has issued a * urban and small stream flood advisory for... Johnson County in east central Kansas... * until 230 am CDT Friday * at 826 PM CDT, Doppler radar indicated heavy rain due to thunderstorms. This will cause urban and small stream flooding in the advisory area. Up to two to three inches of rain have already fallen with an additional one to two inches possible over the next two hours to three hours. * Some locations that will experience flooding include... Overland Park, Olathe, Shawnee, Lenexa, Leawood, Prairie Village, Gardner, Merriam, mission, Bonner Springs, De Soto, Spring Hill, Fairway, Mission Hills, Edgerton, Westwood, Lake quivira, Westwood Hills, Mission Woods and Countryside. Precautionary/preparedness actions... Turn around, don't drown when encountering flooded roads. Most flood deaths occur in vehicles. Be especially cautious at night when it is harder to recognize the dangers of flooding. Lat...Lon 3899 9502 3900 9502 3898 9495 3900 9492 3898 9492 3901 9489 3906 9487 3906 9484 3904 9480 3904 9461 3874 9461 3874 9500 3897 9504 Welsh , ...Significant weather advisory for southeastern Johnson... northwestern Cass and southwestern Jackson counties until 915 PM CDT... At 841 PM CDT, Doppler radar was tracking a strong thunderstorm near Belton, moving east at 20 mph. Winds in excess of 40 mph will be possible with this storm. Locations impacted include... Kansas City, Overland Park, Olathe, Lee's Summit, Lenexa, Leawood, Raytown, Grandview, Belton, Prairie Village, Raymore and Stanley. This includes the following highways... Interstate 35 in Kansas near mile marker 222. Interstate 470 between mile markers 0 and 4. Interstate 435 near mile marker 0, and between mile markers 65 and 83. Lat...Lon 3877 9471 3894 9475 3903 9450 3879 9441 time...Mot...loc 0141z 255deg 13kt 3884 9465 Welsh 841 PM CDT Thu Jul 13 2017 ...Significant weather advisory for southeastern Johnson... northwestern Cass and southwestern Jackson counties until 915 PM CDT... At 841 PM CDT, Doppler radar was tracking a strong thunderstorm near Belton, moving east at 20 mph. Winds in excess of 40 mph will be possible with this storm. Locations impacted include... Kansas City, Overland Park, Olathe, Lee's Summit, Lenexa, Leawood, Raytown, Grandview, Belton, Prairie Village, Raymore and Stanley. This includes the following highways... Interstate 35 in Kansas near mile marker 222. Interstate 470 between mile markers 0 and 4. Interstate 435 near mile marker 0, and between mile markers 65 and 83. Lat...Lon 3877 9471 3894 9475 3903 9450 3879 9441 time...Mot...loc 0141z 255deg 13kt 3884 9465 Welsh ]</code><br />
<br />
==Phenomena==<br />
[[File:Phenomena.png|page=1|thumb|651px|Chart of different Phenomena codes]]<br />
:Syntax<br />
::<code>$weather.alerts.alerts.phenomena</code><br />
:Returns<br />
::Returns a 2 letter code of the phenomena. (Reference chart on the right)<br />
:Examples<br />
::<code>[FA, SP]</code><br />
<br />
==Significance==<br />
[[File:Significance.png|page=1|thumb|183px|Chart of different significance codes]]<br />
:Syntax<br />
::<code>$weather.alerts.alerts.significance</code><br />
:Arguments<br />
:Returns<br />
::Returns a single letter code of the significance. (Reference chart on the right)<br />
:Examples<br />
::<code>[Y, S]</code><br />
<br />
==Zones==<br />
:Syntax<br />
::<code>$weather.alerts.alerts.ZONES</code><br />
:Returns<br />
::Returns the affected zones in [state: , ZONE: ] format.<br />
:Examples<br />
::<code>[[[state:KS, ZONE:105]], [[state:KS, ZONE:105], [state:MO, ZONE:037], [state:MO, ZONE:043]]]</code><br />
<br />
<br />
==Storm Based==<br />
:Syntax<br />
::<code>$weather.alerts.alerts.StormBased</code><br />
:Returns<br />
::Returns location inforomation with basic latitude and longitude coordinates for the storm as well as the storms position, heading and speed.<br />
:Examples<br />
::<code>[[:], [Vertex_count:4, vertices:[[lon:-94.71, lat:38.77], [lon:-94.75, lat:38.94], [lon:-94.50, lat:39.03], [lon:-94.41, lat:38.79]], stormInfo:[Motion_deg:255, time_epoch:1499910060, position_lon:-94.65, position_lat:38.84, Motion_spd:13]]]</code><br />
<br />
<br />
=Almanac=<br />
:Records within the United States come from the National Weather Service, with approximately 120 reporting stations giving records. Records for the rest of the United States, and locations outside of the United States, come from the data we have stored. These are compiled records and only go as far back as we have data for. The average high and low temperature going back as far as Weather Underground has data for OR from National Weather Service going back 30 years.<br />
<br />
:Examples from July 13th<br />
<br />
==Airport Code==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.airport_code</code><br />
:Returns<br />
::Returns the observed location.<br />
:Examples<br />
::<code>KIXD</code><br />
<br />
==Average High Fahrenheit==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_high.normal.F</code><br />
:Returns<br />
::Returns the average high temperature in fahrenheit.<br />
:Examples<br />
::<code>87</code><br />
<br />
==Avegage High Celsius==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_high.normal.C</code><br />
:Returns<br />
::Returns the average high temperature in celsius.<br />
:Examples<br />
::<code>30</code><br />
<br />
==Record High Fahrenheit==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_high.record.F</code><br />
:Returns<br />
::Returns the highest temperature in fahrenheit measured on this date.<br />
:Examples<br />
::<code>98</code><br />
<br />
==Record High Celsius==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_high.record.C</code><br />
:Returns<br />
::Returns the highest temperature in celsius measured on this date.<br />
:Examples<br />
::<code>36</code><br />
<br />
==Record High Year==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_high.recordyear</code><br />
:Returns<br />
::Returns the year the highest temperature was measured on this date.<br />
:Examples<br />
::<code>2004</code><br />
<br />
==Average Low Fahrenheit==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_low.normal.F</code><br />
:Returns<br />
::Returns the average low temperature in fahrenheit.<br />
:Examples<br />
::<code>66</code><br />
<br />
==Average Low Celsius==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_low.normal.C</code><br />
:Returns<br />
::Returns the average low temperature in celsius.<br />
:Examples<br />
::<code>18</code><br />
<br />
==Record Low Fahrenheit==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_low.record.F</code><br />
:Returns<br />
::Returns the lowest temperature in fahrenheit measured on this date.<br />
:Examples<br />
::<code>57</code><br />
<br />
==Record Low Celsius==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_low.record.C</code><br />
:Returns<br />
::Returns the lowest temperature in celsius measured on this date.<br />
:Examples<br />
::<code>13</code><br />
<br />
==Record Low Year==<br />
:Syntax<br />
::<code>$weather.almanac.almanac.temp_low.recordyear</code><br />
:Returns<br />
::Returns the year the lowest temperature was measured on this date.<br />
:Examples<br />
::<code>1999</code><br />
<br />
=Conditions=<br />
:Returns the current temperature, weather condition, humidity, wind, 'feels like' temperature, barometric pressure, and visibility.<br />
<br />
==Weather==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.weather</code><br />
:Returns<br />
::Returns the description of the current weather.<br />
:Example<br />
::<code>Light Rain</code><br />
<br />
==Temperature String==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.temperature_string</code><br />
:Returns<br />
::Returns a string value with temperature in fahrenheit and celsius.<br />
:Example<br />
::<code>71.1 F (21.7 C)</code><br />
<br />
==Temperature - Fahrenheit ==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.temp_f</code><br />
:Returns<br />
::Returns a decimal of the temperature in fahrenheit.<br />
:Example<br />
::<code>71.1</code><br />
<br />
==Temperature - Celsius==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.temp_c</code><br />
:Returns<br />
::Returns a decimal of the temperature in celsius.<br />
:Example<br />
::<code>21.7</code><br />
<br />
==Relative Humidity==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.relative_humidity</code><br />
:Returns<br />
::Returns the relative humidity with percent sign.<br />
:Example<br />
::<code>88%</code><br />
<br />
==Wind String==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.wind_string</code><br />
:Returns<br />
::Returns a string value with description of the wind.<br />
:Example<br />
::<code>From the SSW at 2.0 MPH</code><br />
<br />
==Wind Direction==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.wind_dir</code><br />
:Returns<br />
::Returns a string value of the current wind direction.<br />
:Example<br />
::<code>West</code><br />
<br />
==Wind Degrees==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.wind_degrees</code><br />
:Returns<br />
::Returns an integer value of the winds degree.<br />
:Example<br />
::<code>270</code><br />
<br />
==Wind MPH==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.wind_mph</code><br />
:Returns<br />
::Returns a decimal value of the current wind MPH.<br />
:Example<br />
::<code>1.0</code><br />
<br />
==Wind Gust MPH==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.wind_gust_mph</code><br />
:Returns<br />
::Returns an integer value of wind gust MPH.<br />
:Example<br />
::<code>0</code><br />
<br />
==Wind KPH==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.wind_kph</code><br />
:Returns<br />
::Returns a decimal value of the current wind KPH.<br />
:Example<br />
::<code>0</code><br />
<br />
==Wind Gust KPH==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.wind_gust_kph</code><br />
:Returns<br />
::Returns an integer value of wind gust KPH.<br />
:Example<br />
::<code>0</code><br />
<br />
==Pressure - mB==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.pressure_mb</code><br />
:Returns<br />
::Returns an integer of current pressure in millibars.<br />
:Example<br />
::<code>1019</code><br />
<br />
==Pressure - Inches==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.pressure_in</code><br />
:Returns<br />
::Returns a decimal of current pressure in inches.<br />
:Example<br />
::<code>30.09</code><br />
<br />
==Pressure Trend==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.pressure_trend</code><br />
:Returns<br />
::Returns a positive (+) or negative (-) sign of pressure trend.<br />
:Example<br />
::<code>+</code><br />
<br />
==Dewpoint - String==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.dewpoint_string</code><br />
:Returns<br />
::Returns a string value of current dewpoint temperatures in fahrenheit and celsius.<br />
:Example<br />
::<code>68 F (20 C)</code><br />
<br />
==Dewpoint - Fahrenheit==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.dewpoint_f</code><br />
:Returns<br />
::Returns an integer of the current dewpoint in fahrenheit.<br />
:Example<br />
::<code>68</code><br />
<br />
==Dewpoint - Celsius==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.dewpoint_c</code><br />
:Returns<br />
::Returns an integer of the current dewpoint in celsius.<br />
:Example<br />
::<code>20</code><br />
<br />
==Heat Index - String==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.heat_index_string</code><br />
:Returns<br />
::Returns a string of the current heat index.<br />
:Example<br />
::<code>(TODO)</code><br />
<br />
==Heat Index - Fahrenheit==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.heat_index_f</code><br />
:Returns<br />
::Returns (TODO).<br />
:Example<br />
::<code>(TODO)</code><br />
<br />
==Heat Index - Celsius==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.heat_index_c</code><br />
:Returns<br />
::Returns (TODO).<br />
:Example<br />
::<code>(TODO)</code><br />
<br />
==Wind Chill - String==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.windchill_string</code><br />
:Returns<br />
::Returns (TODO).<br />
:Example<br />
::<code>(TODO)</code><br />
<br />
==Wind Chill - Fahrenheit==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.windchill_f</code><br />
:Returns<br />
::Returns (TODO).<br />
:Example<br />
::<code>(TODO)</code><br />
<br />
==Wind Chill - Celsius==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.windchill_c</code><br />
:Returns<br />
::Returns (TODO).<br />
:Example<br />
::<code>(TODO)</code><br />
<br />
==Feels Like - String==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.feelslike_string</code><br />
:Returns<br />
::Returns a string with current feels like temperatures in fahrenheit and celsius.<br />
:Example<br />
::<code>71.0 F (21.7 C)</code><br />
<br />
==Feels Like - Fahrenheit==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.feelslike_f</code><br />
:Returns<br />
::Returns a decimal of current feels like temperature in fahrenheit.<br />
:Example<br />
::<code>71</code><br />
<br />
==Feels Like - Celsius==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.feelslike_c</code><br />
:Returns<br />
::Returns a decimal of current feels like temperature in celsius.<br />
:Example<br />
::<code>21.7</code><br />
<br />
==Visibility - Miles==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.visibility_mi</code><br />
:Returns<br />
::Returns a decimal of current visibility in miles.<br />
:Example<br />
::<code>10.0</code><br />
<br />
==Visibility - Kilometers==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.visibility_km</code><br />
:Returns<br />
::Returns a decimal of current visibility in kilometers.<br />
:Example<br />
::<code>16.1</code><br />
<br />
==Solar Radiation==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.solarradiation</code><br />
:Returns<br />
::Returns (TODO).<br />
:Example<br />
::<code>(TODO)</code><br />
<br />
==UltraViolet==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.UV</code><br />
:Returns<br />
::Returns an integer of current UltraViolet.<br />
:Example<br />
::<code>0</code><br />
<br />
==Precip 1hr - String==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.precip_1hr_string</code><br />
:Returns<br />
::Returns a string of precipitation in the past hour in inches and millimeters.<br />
:Example<br />
::<code>0.01 in ( 0 mm)</code><br />
<br />
==Precip 1hr - Inches==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.precip_1hr_in</code><br />
:Returns<br />
::Returns a decimal of precipitation in the past hour in inches.<br />
:Example<br />
::<code>0.01</code><br />
<br />
==Precip 1hr - Metric==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.precip_1hr_metric</code><br />
:Returns<br />
::Returns a decimal of precipitation in the past hour in millimeters.<br />
:Example<br />
::<code>0</code><br />
<br />
==Precip Today - String==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.precip_today_string</code><br />
:Returns<br />
::Returns a string of precipitation in total for the day in inches and millimeters.<br />
:Example<br />
::<code>0.49 in (12 mm)</code><br />
<br />
==Precip Today - Inches==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.precip_today_in</code><br />
:Returns<br />
::Returns a decimal of precipitation in total for the day in inches.<br />
:Example<br />
::<code>0.49</code><br />
<br />
==Precip Today - Metric==<br />
:Syntax<br />
::<code>$weather.conditions.current_observation.precip_today_metric</code><br />
:Returns<br />
::Returns a decimal of precipitation in total for the day in millimeters.<br />
:Example<br />
::<code>12</code><br />
<br />
=Forecast=<br />
:Returns a summary of the weather for the next 3 days and nights. This includes high and low temperatures, a string text forecast and the conditions. To select an idividual forecast use <code>$weather.forecast.forecast.(txt_forecast/simpleforecast).forecastday[INDEX]</code> where index is listed below. <br />
<br />
:This data attribute has two main categories <code>txt_forecast</code> and <code>simpleforecast</code>. <br />
:Use txt_forecast for a put together string forecast of the next 3 days and nights. The index ranges from <code>0-7</code>.<br />
:Use simpleforecast if you want to piece together your own forecast or just want individual elements from the forecasted weather. The index ranges from <code>0-3</code>.<br />
<br />
==Text Forecast==<br />
<br />
===Title===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.txt_forecast.forecastday.title</code><br />
:Returns<br />
::Returns the name of the day/night.<br />
:Example<br />
::<code>[Saturday, Saturday Night, Sunday, Sunday Night, Monday, Monday Night, Tuesday, Tuesday Night]</code><br />
<br />
===Icon===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.txt_forecast.forecastday.icon</code><br />
:Returns<br />
::Returns the name of the icon used.<br />
:Example<br />
::<code>[clear, nt_clear, clear, nt_clear, clear, nt_clear, partlycloudy, nt_clear]</code><br />
<br />
===Forecast Text===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.txt_forecast.forecastday.fcttext</code><br />
:Returns<br />
::Returns the string forecast for the next 3 days and nights. <br />
:Example<br />
::<code>[Plentiful sunshine. High 89F. Winds ESE at 5 to 10 mph., Mostly clear. Low 68F. Winds light and variable., Sunny. High 92F. Winds SSW at 5 to 10 mph., A mostly clear sky. Low 68F. Winds light and variable., Sunny skies. High 94F. Winds S at 10 to 15 mph., Clear skies. Low 71F. Winds SSE at 5 to 10 mph., Partly cloudy skies. High 94F. Winds SSW at 10 to 15 mph., Clear. Low 74F. Winds S at 10 to 15 mph.]</code><br />
<br />
===Forecast Text - Metric===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.txt_forecast.forecastday.fcttext_metric</code><br />
:Returns<br />
::Returns the string forecast in metric for the next 3 days and nights. <br />
:Example<br />
::<code> [Abundant sunshine. High 32C. Winds ESE at 10 to 15 km/h., Generally clear skies. Low around 20C. Winds light and variable., Sunny skies. High 33C. Winds SSW at 10 to 15 km/h., Clear. Low near 20C. Winds light and variable., A mainly sunny sky. High 34C. Winds S at 10 to 15 km/h., A mostly clear sky. Low 22C. Winds SSE at 10 to 15 km/h., Partly cloudy skies. High 34C. Winds SSW at 15 to 25 km/h., A mostly clear sky. Low 23C. Winds S at 10 to 15 km/h.]</code><br />
<br />
==Simple forecast==<br />
<br />
===High===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.high</code><br />
:Returns<br />
::Returns the high temperature for today and next 3 days. Add <code>.celsius</code> or <code>.fahrenheit</code> to the end for metric and imperial respectively. <br />
:Example<br />
::<code>[[celsius:32, fahrenheit:89], [celsius:33, fahrenheit:92], [celsius:34, fahrenheit:94], [celsius:34, fahrenheit:94]]</code><br />
<br />
===Low===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.low</code><br />
:Returns<br />
::Returns the low temperature for today and next 3 days. Add <code>.celsius</code> or <code>.fahrenheit</code> to the end for metric and imperial respectively. <br />
:Example<br />
::<code>[[celsius:20, fahrenheit:68], [celsius:20, fahrenheit:68], [celsius:22, fahrenheit:71], [celsius:23, fahrenheit:74]]</code><br />
<br />
===Conditions===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.conditions</code><br />
:Returns<br />
::Returns a string of forecasted conditions.<br />
:Example<br />
::<code>[Clear, Clear, Clear, Partly Cloudy]</code><br />
<br />
===Icon===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.icon</code><br />
:Returns<br />
::Returns the icon used for the forecasted weather.<br />
:Example<br />
::<code>[clear, clear, clear, partlycloudy]</code><br />
<br />
===Quantitative Precipitation Forecast - All Day===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.qpf_allday</code><br />
:Returns<br />
::Returns the Quantitative Precipitation Forecast is the expected amount of melted precipitation accumulated over a specified time period. Add <code>.mm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00]]</code><br />
<br />
===Quantitative Precipitation Forecast - Day===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.qpf_day</code><br />
:Returns<br />
::Returns the Quantitative Precipitation Forecast is the expected amount of melted precipitation accumulated over a specified time period. Add <code>.mm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00]]</code><br />
<br />
===Quantitative Precipitation Forecast - Night===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.qpf_night</code><br />
:Returns<br />
::Returns the Quantitative Precipitation Forecast is the expected amount of melted precipitation accumulated over a specified time period. Add <code>.mm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00]]</code><br />
<br />
===Snow - All Day===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.snow_allday</code><br />
:Returns<br />
::Returns the forecasted amount of snow for all day. Add <code>.cm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0]]</code><br />
<br />
===Snow - Day===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.snow_day</code><br />
:Returns<br />
::Returns the forecasted amount of snow for the day. Add <code>.cm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0]]</code><br />
<br />
===Snow - Night===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.snow_night</code><br />
:Returns<br />
::Returns the forecasted amount of snow for the night. Add <code>.cm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0]]</code><br />
<br />
===Max Wind===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.maxwind</code><br />
:Returns<br />
::Returns the speed and direction (string and degrees) of the max wind forecast. Adding <code>mph</code> or <code>kph</code> or <code>dir</code> or <code>degrees</code> to the end will select the individual attributes.<br />
:Example<br />
::<code>[[mph:10, dir:ESE, degrees:108, kph:16], [mph:10, dir:SSW, degrees:203, kph:16], [mph:15, dir:S, degrees:182, kph:24], [mph:20, dir:S, degrees:189, kph:32]]</code><br />
<br />
===Average Wind===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.avewind</code><br />
:Returns<br />
::Returns the speed and direction (string and degrees) of the average wind forecast. Adding <code>mph</code> or <code>kph</code> or <code>dir</code> or <code>degrees</code> to the end will select the individual attributes.<br />
:Example<br />
::<code>[[mph:10, dir:ESE, degrees:108, kph:16], [mph:10, dir:SSW, degrees:203, kph:16], [mph:15, dir:S, degrees:182, kph:24], [mph:20, dir:S, degrees:189, kph:32]]</code><br />
<br />
===Average Humidity===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.avehumidity</code><br />
:Returns<br />
::Returns the average humidity for the day.<br />
:Example<br />
::<code>[56, 58, 56, 59]</code><br />
<br />
===Max Humidity===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.maxhumidity</code><br />
:Returns<br />
::Returns the maximum humidity for the day.<br />
:Example<br />
::<code>[0, 0, 0, 0]</code><br />
<br />
===Min Humidity===<br />
:Syntax<br />
::<code>$weather.forecast.forecast.simpleforecast.forecastday.minhumidity</code><br />
:Returns<br />
::Returns the minimum humidity for the day.<br />
:Example<br />
::<code>[0, 0, 0, 0]</code><br />
<br />
=10 Day Forecast=<br />
:Returns a summary of the weather for the next 10 days. This includes high and low temperatures, a string text forecast and the conditions. To select an idividual forecast use <code>$weather.forecast10day.forecast.(txt_forecast/simpleforecast).forecastday[INDEX]</code> where index is listed below.<br />
<br />
:This data attribute has two main categories <code>txt_forecast</code> and <code>simpleforecast</code>. <br />
:Use txt_forecast for a put together string forecast of the next 10 days and nights. The index ranges from <code>0-19</code>.<br />
:Use simpleforecast if you want to piece together your own forecast or just want individual elements from the forecasted weather. The index ranges from <code>0-9</code>.<br />
<br />
==Text Forecast==<br />
<br />
===Title===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.txt_forecast.forecastday.title</code><br />
:Returns<br />
::Returns the name of the day/night.<br />
:Example<br />
::<code> [Saturday, Saturday Night, Sunday, Sunday Night, Monday, Monday Night, Tuesday, Tuesday Night, Wednesday, Wednesday Night, Thursday, Thursday Night, Friday, Friday Night, Saturday, Saturday Night, Sunday, Sunday Night, Monday, Monday Night]</code><br />
<br />
===Icon===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.txt_forecast.forecastday.icon</code><br />
:Returns<br />
::Returns the name of the icon used.<br />
:Example<br />
::<code>[clear, nt_partlycloudy, clear, nt_clear, clear, nt_clear, partlycloudy, nt_clear, clear, nt_clear, clear, nt_clear, clear, nt_clear, partlycloudy, nt_clear, chancetstorms, nt_partlycloudy, partlycloudy, nt_partlycloudy]</code><br />
<br />
===Forecast Text===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.txt_forecast.forecastday.fcttext</code><br />
:Returns<br />
::Returns the string forecast for the next 10 days and nights. <br />
:Example<br />
::<code>[Sunny to partly cloudy. High 89F. Winds ESE at 5 to 10 mph., Partly cloudy skies. Low 68F. Winds light and variable., Sunny skies. High 92F. Winds SSW at 5 to 10 mph., Clear skies. Low 69F. Winds light and variable., A mainly sunny sky. High 93F. Winds S at 10 to 15 mph., Clear. Low 71F. Winds SSE at 5 to 10 mph., Partly cloudy skies. High 94F. Winds S at 10 to 20 mph., Clear skies. Low 74F. Winds S at 10 to 15 mph., Sunny skies. High 96F. Winds SSW at 10 to 15 mph., Mostly clear. Low 76F. Winds S at 5 to 10 mph., Except for a few afternoon clouds, mainly sunny. High 97F. Winds SSW at 10 to 15 mph., Clear skies. Low near 75F. Winds S at 5 to 10 mph., A mainly sunny sky. High 97F. Winds SSW at 10 to 15 mph., A mostly clear sky. Low 76F. Winds S at 10 to 15 mph., Sunshine and clouds mixed. A stray shower or thunderstorm is possible. High 96F. Winds SSW at 10 to 20 mph., A mostly clear sky. Low 77F. Winds SSW at 10 to 15 mph., Variable clouds with scattered thunderstorms. High 93F. Winds SW at 10 to 15 mph. Chance of rain 50%., A few clouds from time to time. Low 74F. Winds SSW at 5 to 10 mph., Sunshine and clouds mixed. High near 95F. Winds SSW at 5 to 10 mph., A few clouds from time to time. Low around 75F. Winds S at 5 to 10 mph.]</code><br />
<br />
===Forecast Text - Metric===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.txt_forecast.forecastday.fcttext_metric</code><br />
:Returns<br />
::Returns the string forecast in metric for the next 10 days and nights. <br />
:Example<br />
::<code> [Partly cloudy. High 31C. Winds ESE at 10 to 15 km/h., Some clouds this evening will give way to mainly clear skies overnight. Low near 20C. Winds light and variable., Mainly sunny. High 33C. Winds light and variable., Clear skies. Low near 20C. Winds light and variable., Sunny skies. High 34C. Winds S at 10 to 15 km/h., Clear skies. Low 22C. Winds SSE at 10 to 15 km/h., Some clouds in the morning will give way to mainly sunny skies for the afternoon. High 34C. Winds S at 15 to 30 km/h., A mostly clear sky. Low 23C. Winds S at 15 to 25 km/h., Sunny skies. High around 35C. Winds SSW at 15 to 25 km/h., A mostly clear sky. Low 24C. Winds S at 10 to 15 km/h., Sunny along with a few clouds. High 36C. Winds SSW at 15 to 25 km/h., Clear. Low 24C. Winds S at 10 to 15 km/h., A mainly sunny sky. High 36C. Winds SSW at 15 to 25 km/h., Clear skies. Low 24C. Winds S at 10 to 15 km/h., Sunshine and clouds mixed. A stray shower or thunderstorm is possible. High around 35C. Winds SSW at 15 to 30 km/h., Mostly clear skies. Low near 25C. Winds SSW at 15 to 25 km/h., Scattered showers and thunderstorms. High 34C. Winds SW at 15 to 25 km/h. Chance of rain 50%., Partly cloudy. Low 23C. Winds SSW at 10 to 15 km/h., Partly cloudy skies. High near 35C. Winds SSW at 10 to 15 km/h., A few clouds from time to time. Low 24C. Winds S at 10 to 15 km/h.]</code><br />
<br />
==Simple Forecast==<br />
<br />
===High===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.high</code><br />
:Returns<br />
::Returns the high temperature for today and next 3 days. Add <code>.celsius</code> or <code>.fahrenheit</code> to the end for metric and imperial respectively. <br />
:Example<br />
::<code> [[celsius:32, fahrenheit:89], [celsius:33, fahrenheit:92], [celsius:34, fahrenheit:93], [celsius:34, fahrenheit:94], [celsius:36, fahrenheit:96], [celsius:36, fahrenheit:97], [celsius:36, fahrenheit:97], [celsius:36, fahrenheit:96], [celsius:34, fahrenheit:93], [celsius:35, fahrenheit:95]]</code><br />
<br />
===Low===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.low</code><br />
:Returns<br />
::Returns the low temperature for today and next 3 days. Add <code>.celsius</code> or <code>.fahrenheit</code> to the end for metric and imperial respectively. <br />
:Example<br />
::<code> [[celsius:20, fahrenheit:68], [celsius:21, fahrenheit:69], [celsius:22, fahrenheit:71], [celsius:23, fahrenheit:74], [celsius:24, fahrenheit:76], [celsius:24, fahrenheit:75], [celsius:24, fahrenheit:76], [celsius:25, fahrenheit:77], [celsius:23, fahrenheit:74], [celsius:24, fahrenheit:75]]</code><br />
<br />
===Conditions===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.conditions</code><br />
:Returns<br />
::Returns a string of forecasted conditions.<br />
:Example<br />
::<code> [Clear, Clear, Clear, Partly Cloudy, Clear, Clear, Clear, Partly Cloudy, Chance of a Thunderstorm, Partly Cloudy]</code><br />
<br />
===Icon===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.icon</code><br />
:Returns<br />
::Returns the icon used for the forecasted weather.<br />
:Example<br />
::<code>[clear, clear, clear, partlycloudy, clear, clear, clear, partlycloudy, chancetstorms, partlycloudy]</code><br />
<br />
===Quantitative Precipitation Forecast - All Day===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.qpf_allday</code><br />
:Returns<br />
::Returns the Quantitative Precipitation Forecast is the expected amount of melted precipitation accumulated over a specified time period. Add <code>.mm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:3, in:0.13], [mm:0, in:0.00]]</code><br />
<br />
===Quantitative Precipitation Forecast - Day===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.qpf_day</code><br />
:Returns<br />
::Returns the Quantitative Precipitation Forecast is the expected amount of melted precipitation accumulated over a specified time period. Add <code>.mm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:3, in:0.13], [mm:0, in:0.00]]</code><br />
<br />
===Quantitative Precipitation Forecast - Night===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.qpf_night</code><br />
:Returns<br />
::Returns the Quantitative Precipitation Forecast is the expected amount of melted precipitation accumulated over a specified time period. Add <code>.mm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00], [mm:0, in:0.00]]</code><br />
<br />
===Snow - All Day===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.snow_allday</code><br />
:Returns<br />
::Returns the forecasted amount of snow for all day. Add <code>.cm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0]]</code><br />
<br />
===Snow - Day===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.snow_day</code><br />
:Returns<br />
::Returns the forecasted amount of snow for the day. Add <code>.cm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0]]</code><br />
<br />
===Snow - Night===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.snow_night</code><br />
:Returns<br />
::Returns the forecasted amount of snow for the night. Add <code>.cm</code> or <code>.in</code> to the end for metric and imperial respectively.<br />
:Example<br />
::<code>[[cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0], [cm:0.0, in:0.0]]</code><br />
<br />
===Max Wind===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.maxwind</code><br />
:Returns<br />
::Returns the speed and direction (string and degrees) of the max wind forecast. Adding <code>mph</code> or <code>kph</code> or <code>dir</code> or <code>degrees</code> to the end will select the individual attributes.<br />
:Example<br />
::<code>[[mph:10, dir:ESE, degrees:107, kph:16], [mph:10, dir:SSW, degrees:203, kph:16], [mph:15, dir:S, degrees:182, kph:24], [mph:20, dir:S, degrees:189, kph:32], [mph:15, dir:SSW, degrees:201, kph:24], [mph:15, dir:SSW, degrees:206, kph:24], [mph:15, dir:SSW, degrees:195, kph:24], [mph:20, dir:SSW, degrees:203, kph:32], [mph:15, dir:SW, degrees:232, kph:24], [mph:10, dir:SSW, degrees:211, kph:16]]</code><br />
<br />
===Average Wind===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.avewind</code><br />
:Returns<br />
::Returns the speed and direction (string and degrees) of the average wind forecast. Adding <code>mph</code> or <code>kph</code> or <code>dir</code> or <code>degrees</code> to the end will select the individual attributes.<br />
:Example<br />
::<code>[[mph:8, dir:ESE, degrees:107, kph:13], [mph:6, dir:SSW, degrees:203, kph:10], [mph:10, dir:S, degrees:182, kph:16], [mph:13, dir:S, degrees:189, kph:21], [mph:12, dir:SSW, degrees:201, kph:19], [mph:12, dir:SSW, degrees:206, kph:19], [mph:12, dir:SSW, degrees:195, kph:19], [mph:14, dir:SSW, degrees:203, kph:23], [mph:12, dir:SW, degrees:232, kph:19], [mph:8, dir:SSW, degrees:211, kph:13]]</code><br />
<br />
===Average Humidity===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.avehumidity</code><br />
:Returns<br />
::Returns the average humidity for the day.<br />
:Example<br />
::<code>[56, 58, 56, 59, 60, 55, 53, 53, 55, 55]</code><br />
<br />
===Max Humidity===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.maxhumidity</code><br />
:Returns<br />
::Returns the maximum humidity for the day.<br />
:Example<br />
::<code>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]</code><br />
<br />
===Min Humidity===<br />
:Syntax<br />
::<code>$weather.forecast10day.forecast.simpleforecast.forecastday.minhumidity</code><br />
:Returns<br />
::Returns the minimum humidity for the day.<br />
:Example<br />
::<code>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]</code><br />
<br />
=Hourly=<br />
:Returns a summary of the weather for the next 36 hours. This includes high and low temperatures, a string text forecast and the conditions.<br />
<br />
:Use <code>$weather.hourly.hourly_forecast[INDEX]</code> where index is between <code>0-35</code>. 0 is the very next hour upcoming.<br />
<br />
==Temperature==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.temp</code><br />
:Returns<br />
::Returns the temperature. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:30, english:86], [metric:31, english:87], [metric:31, english:88], [metric:31, english:88], [metric:31, english:88], [metric:31, english:88], [metric:31, english:87], [metric:30, english:86], [metric:28, english:83], [metric:26, english:79], [metric:25, english:77], [metric:24, english:75], [metric:23, english:74], [metric:23, english:73], [metric:22, english:72], [metric:22, english:71], [metric:21, english:70], [metric:21, english:70], [metric:21, english:69], [metric:21, english:70], [metric:23, english:74], [metric:26, english:78], [metric:27, english:81], [metric:29, english:84], [metric:30, english:86], [metric:31, english:88], [metric:32, english:89], [metric:32, english:90], [metric:32, english:90], [metric:32, english:90], [metric:32, english:89], [metric:31, english:88], [metric:29, english:85], [metric:27, english:80], [metric:26, english:78], [metric:24, english:76]]</code><br />
<br />
==Dewpoint==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.dewpoint</code><br />
:Returns<br />
::Returns the dewpoint. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:22, english:71], [metric:21, english:70], [metric:21, english:69], [metric:20, english:68], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:21, english:70], [metric:21, english:69], [metric:21, english:69], [metric:20, english:68], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:66], [metric:19, english:66], [metric:19, english:66], [metric:20, english:68], [metric:20, english:68], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:66], [metric:19, english:66], [metric:19, english:66], [metric:19, english:66], [metric:18, english:65], [metric:19, english:66], [metric:19, english:66], [metric:19, english:67], [metric:19, english:67], [metric:20, english:68], [metric:19, english:67]]</code><br />
<br />
==Condition==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.condition</code><br />
:Returns<br />
::Returns the string condition.<br />
:Example<br />
::<code>[Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Partly Cloudy, Clear, Clear, Partly Cloudy, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear]</code><br />
<br />
==Icon==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.icon</code><br />
:Returns<br />
::Returns the icon used.<br />
:Example<br />
::<code>[clear, clear, clear, clear, clear, clear, clear, partlycloudy, clear, clear, partlycloudy, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear]</code><br />
<br />
==Wind Speed==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.wspd</code><br />
:Returns<br />
::Returns the wind speed. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:11, english:7], [metric:13, english:8], [metric:8, english:5], [metric:8, english:5], [metric:8, english:5], [metric:8, english:5], [metric:6, english:4], [metric:6, english:4], [metric:5, english:3], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:5, english:3], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:8, english:5], [metric:10, english:6], [metric:8, english:5], [metric:8, english:5], [metric:8, english:5], [metric:10, english:6], [metric:6, english:4], [metric:8, english:5], [metric:8, english:5], [metric:8, english:5], [metric:6, english:4], [metric:6, english:4], [metric:5, english:3], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4]]</code><br />
<br />
==Wind Direction==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.wdir</code><br />
:Returns<br />
::Returns the direction and degrees of the wind. Add <code>.dir</code> or <code>.degrees</code> to limit the data to one of the two attributes.<br />
:Example<br />
::<code> [[dir:SE, degrees:128], [dir:SE, degrees:128], [dir:ESE, degrees:119], [dir:ESE, degrees:116], [dir:ESE, degrees:106], [dir:ESE, degrees:107], [dir:ESE, degrees:114], [dir:SE, degrees:135], [dir:SE, degrees:141], [dir:SSE, degrees:153], [dir:SSE, degrees:157], [dir:SSE, degrees:160], [dir:SSE, degrees:162], [dir:SSE, degrees:164], [dir:SSE, degrees:163], [dir:SSE, degrees:165], [dir:S, degrees:172], [dir:S, degrees:191], [dir:SSW, degrees:202], [dir:SSW, degrees:203], [dir:SW, degrees:216], [dir:SW, degrees:220], [dir:SW, degrees:235], [dir:SW, degrees:229], [dir:SW, degrees:215], [dir:S, degrees:184], [dir:S, degrees:180], [dir:S, degrees:180], [dir:S, degrees:180], [dir:S, degrees:184], [dir:S, degrees:175], [dir:S, degrees:171], [dir:S, degrees:176], [dir:SSE, degrees:163], [dir:SSE, degrees:158], [dir:SSE, degrees:167]]</code><br />
<br />
==Weather Description==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.wx</code><br />
:Returns<br />
::Returns the description of the weather.<br />
:Example<br />
::<code>[Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Partly Cloudy, Mostly Clear, Mostly Clear, Partly Cloudy, Mostly Clear, Mostly Clear, Clear, Clear, Clear, Clear, Clear, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Clear, Clear, Clear, Clear]</code><br />
<br />
==Ultraviolet Index==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.uvi</code><br />
:Returns<br />
::Returns the ultraviolet index.<br />
:Example<br />
::<code>[10, 10, 8, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 8, 10, 10, 8, 6, 4, 2, 1, 0, 0, 0, 0, 0]</code><br />
<br />
==Humidity==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.humidity</code><br />
:Returns<br />
::Returns the humidity value.<br />
:Example<br />
::<code>[59, 54, 51, 51, 54, 53, 54, 64, 70, 75, 78, 81, 83, 85, 87, 88, 88, 89, 88, 82, 73, 64, 58, 54, 50, 47, 46, 45, 44, 46, 48, 57, 64, 72, 76, 78]</code><br />
<br />
==Wind Chill==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.windchill</code><br />
:Returns<br />
::Returns the wind chill value. Note that values will be <code>-9999</code> or <code>-999</code> for Null or Non applicable (NA) values. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999]]</code><br />
<br />
==Heat Index==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.heatindex</code><br />
:Returns<br />
::Returns the heat index value. Note that values will be <code>-9999</code> or <code>-999</code> for Null or Non applicable (NA) values. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:34, english:93], [metric:34, english:93], [metric:33, english:91], [metric:32, english:90], [metric:32, english:90], [metric:32, english:90], [metric:31, english:88], [metric:30, english:86], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:28, english:83], [metric:30, english:87], [metric:31, english:88], [metric:32, english:90], [metric:33, english:92], [metric:33, english:92], [metric:33, english:92], [metric:33, english:91], [metric:33, english:92], [metric:32, english:90], [metric:30, english:87], [metric:28, english:83], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999]]</code><br />
<br />
==Feels Like==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.feelslike</code><br />
:Returns<br />
::Returns temperature it feels like. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:33, english:92], [metric:34, english:93], [metric:34, english:93], [metric:32, english:90], [metric:32, english:90], [metric:32, english:90], [metric:31, english:88], [metric:30, english:86], [metric:26, english:79], [metric:25, english:77], [metric:24, english:75], [metric:23, english:74], [metric:23, english:73], [metric:22, english:72], [metric:22, english:71], [metric:21, english:70], [metric:21, english:70], [metric:21, english:69], [metric:21, english:70], [metric:23, english:74], [metric:26, english:78], [metric:28, english:83], [metric:30, english:87], [metric:31, english:88], [metric:32, english:90], [metric:33, english:92], [metric:33, english:92], [metric:33, english:92], [metric:33, english:91], [metric:33, english:92], [metric:32, english:90], [metric:30, english:87], [metric:27, english:80], [metric:26, english:78], [metric:24, english:76], [metric:23, english:74]]</code><br />
<br />
==Quantitative Precipitation Forecast==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.qpf</code><br />
:Returns<br />
::Returns the Quantitative Precipitation Forecast is the expected amount of melted precipitation accumulated over a specified time period. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0]]</code><br />
<br />
==Snow==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.snow</code><br />
:Returns<br />
::Returns the forecaasted amount of snow. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0]]</code><br />
<br />
==Probability of Precipitation==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.pop</code><br />
:Returns<br />
::Returns the probability of precipication. Probability of precipitation refers to the percent chance that a specific location (i.e., the local airport) will receive measurable precipitation (.01 inch of rain or melted snow) in these type of weather conditions. For example, on ten days when the weather is similar to today's, the airport will receive at least .01 inches of rain on four of those days if the chance of rain is 40%.<br />
<br />
:Example<br />
::<code>[0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 5, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 2]</code><br />
<br />
==Mean Sea Level Pressure==<br />
:Syntax<br />
::<code>$weather.hourly.hourly_forecast.mslp</code><br />
:Returns<br />
::Returns the pressure. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:1019, english:30.1], [metric:1019, english:30.09], [metric:1018, english:30.06], [metric:1017, english:30.04], [metric:1017, english:30.02], [metric:1016, english:30.0], [metric:1016, english:29.99], [metric:1016, english:29.99], [metric:1016, english:30.0], [metric:1016, english:30.01], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.03], [metric:1017, english:30.03], [metric:1017, english:30.03], [metric:1017, english:30.03], [metric:1016, english:30.01], [metric:1016, english:29.99], [metric:1015, english:29.98], [metric:1015, english:29.96], [metric:1014, english:29.94], [metric:1014, english:29.93], [metric:1013, english:29.91], [metric:1013, english:29.9], [metric:1013, english:29.9], [metric:1013, english:29.91], [metric:1014, english:29.93], [metric:1014, english:29.94], [metric:1014, english:29.95]]</code><br />
<br />
=Hourly 10 Day=<br />
:Returns a summary of the weather for the next 240 hours. This includes high and low temperatures, a string text forecast and the conditions. All of these examples will be truncated to reduce scrolling efforts.<br />
<br />
:Use <code>$weather.hourly10day.hourly_forecast[INDEX]</code> where index is between <code>0-239</code>. 0 is the very next hour upcoming.<br />
<br />
==Temperature==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.temp</code><br />
:Returns<br />
::Returns the temperature. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:30, english:86], [metric:31, english:87], [metric:31, english:88], [metric:31, english:88], [metric:31, english:88], [metric:31, english:88], [metric:31, english:87], [metric:30, english:86], [metric:28, english:83], [metric:26, english:79], [metric:25, english:77], [metric:24, english:75], [metric:23, english:74], [metric:23, english:73], [metric:22, english:72], [metric:22, english:71], [metric:21, english:70], [metric:21, english:70], [metric:21, english:69], [metric:21, english:70], [metric:23, english:74], [metric:26, english:78], [metric:27, english:81], [metric:29, english:84], [metric:30, english:86], [metric:31, english:88], [metric:32, english:89], [metric:32, english:90], [metric:32, english:90], [metric:32, english:90], [metric:32, english:89], [metric:31, english:88], [metric:29, english:85], [metric:27, english:80], [metric:26, english:78], [metric:24, english:76]]...truncated</code><br />
<br />
==Dewpoint==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.dewpoint</code><br />
:Returns<br />
::Returns the dewpoint. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:22, english:71], [metric:21, english:70], [metric:21, english:69], [metric:20, english:68], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:21, english:70], [metric:21, english:69], [metric:21, english:69], [metric:20, english:68], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:66], [metric:19, english:66], [metric:19, english:66], [metric:20, english:68], [metric:20, english:68], [metric:19, english:67], [metric:19, english:67], [metric:19, english:67], [metric:19, english:66], [metric:19, english:66], [metric:19, english:66], [metric:19, english:66], [metric:18, english:65], [metric:19, english:66], [metric:19, english:66], [metric:19, english:67], [metric:19, english:67], [metric:20, english:68], [metric:19, english:67]]...truncated</code><br />
<br />
==Condition==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.condition</code><br />
:Returns<br />
::Returns the string condition.<br />
:Example<br />
::<code>[Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Partly Cloudy, Clear, Clear, Partly Cloudy, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear, Clear]...truncated</code><br />
<br />
==Icon==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.icon</code><br />
:Returns<br />
::Returns the icon used.<br />
:Example<br />
::<code>[clear, clear, clear, clear, clear, clear, clear, partlycloudy, clear, clear, partlycloudy, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear, clear]...truncated</code><br />
<br />
==Wind Speed==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.wspd</code><br />
:Returns<br />
::Returns the wind speed. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:11, english:7], [metric:13, english:8], [metric:8, english:5], [metric:8, english:5], [metric:8, english:5], [metric:8, english:5], [metric:6, english:4], [metric:6, english:4], [metric:5, english:3], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:5, english:3], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4], [metric:8, english:5], [metric:10, english:6], [metric:8, english:5], [metric:8, english:5], [metric:8, english:5], [metric:10, english:6], [metric:6, english:4], [metric:8, english:5], [metric:8, english:5], [metric:8, english:5], [metric:6, english:4], [metric:6, english:4], [metric:5, english:3], [metric:6, english:4], [metric:6, english:4], [metric:6, english:4]]...truncated</code><br />
<br />
==Wind Direction==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.wdir</code><br />
:Returns<br />
::Returns the direction and degrees of the wind. Add <code>.dir</code> or <code>.degrees</code> to limit the data to one of the two attributes.<br />
:Example<br />
::<code> [[dir:SE, degrees:128], [dir:SE, degrees:128], [dir:ESE, degrees:119], [dir:ESE, degrees:116], [dir:ESE, degrees:106], [dir:ESE, degrees:107], [dir:ESE, degrees:114], [dir:SE, degrees:135], [dir:SE, degrees:141], [dir:SSE, degrees:153], [dir:SSE, degrees:157], [dir:SSE, degrees:160], [dir:SSE, degrees:162], [dir:SSE, degrees:164], [dir:SSE, degrees:163], [dir:SSE, degrees:165], [dir:S, degrees:172], [dir:S, degrees:191], [dir:SSW, degrees:202], [dir:SSW, degrees:203], [dir:SW, degrees:216], [dir:SW, degrees:220], [dir:SW, degrees:235], [dir:SW, degrees:229], [dir:SW, degrees:215], [dir:S, degrees:184], [dir:S, degrees:180], [dir:S, degrees:180], [dir:S, degrees:180], [dir:S, degrees:184], [dir:S, degrees:175], [dir:S, degrees:171], [dir:S, degrees:176], [dir:SSE, degrees:163], [dir:SSE, degrees:158], [dir:SSE, degrees:167]]...truncated</code><br />
<br />
==Weather Description==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.wx</code><br />
:Returns<br />
::Returns the description of the weather.<br />
:Example<br />
::<code>[Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Partly Cloudy, Mostly Clear, Mostly Clear, Partly Cloudy, Mostly Clear, Mostly Clear, Clear, Clear, Clear, Clear, Clear, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Sunny, Clear, Clear, Clear, Clear]...truncated</code><br />
<br />
==Ultraviolet Index==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.uvi</code><br />
:Returns<br />
::Returns the ultraviolet index.<br />
:Example<br />
::<code>[10, 10, 8, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 8, 10, 10, 8, 6, 4, 2, 1, 0, 0, 0, 0, 0]...truncated</code><br />
<br />
==Humidity==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.humidity</code><br />
:Returns<br />
::Returns the humidity value.<br />
:Example<br />
::<code>[59, 54, 51, 51, 54, 53, 54, 64, 70, 75, 78, 81, 83, 85, 87, 88, 88, 89, 88, 82, 73, 64, 58, 54, 50, 47, 46, 45, 44, 46, 48, 57, 64, 72, 76, 78]...truncated</code><br />
<br />
==Wind Chill==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.windchill</code><br />
:Returns<br />
::Returns the wind chill value. Note that values will be <code>-9999</code> or <code>-999</code> for Null or Non applicable (NA) values. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999]]...truncated</code><br />
<br />
==Heat Index==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.heatindex</code><br />
:Returns<br />
::Returns the heat index value. Note that values will be <code>-9999</code> or <code>-999</code> for Null or Non applicable (NA) values. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:34, english:93], [metric:34, english:93], [metric:33, english:91], [metric:32, english:90], [metric:32, english:90], [metric:32, english:90], [metric:31, english:88], [metric:30, english:86], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:28, english:83], [metric:30, english:87], [metric:31, english:88], [metric:32, english:90], [metric:33, english:92], [metric:33, english:92], [metric:33, english:92], [metric:33, english:91], [metric:33, english:92], [metric:32, english:90], [metric:30, english:87], [metric:28, english:83], [metric:-9999, english:-9999], [metric:-9999, english:-9999], [metric:-9999, english:-9999]]...truncated</code><br />
<br />
==Feels Like==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.feelslike</code><br />
:Returns<br />
::Returns temperature it feels like. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:33, english:92], [metric:34, english:93], [metric:34, english:93], [metric:32, english:90], [metric:32, english:90], [metric:32, english:90], [metric:31, english:88], [metric:30, english:86], [metric:26, english:79], [metric:25, english:77], [metric:24, english:75], [metric:23, english:74], [metric:23, english:73], [metric:22, english:72], [metric:22, english:71], [metric:21, english:70], [metric:21, english:70], [metric:21, english:69], [metric:21, english:70], [metric:23, english:74], [metric:26, english:78], [metric:28, english:83], [metric:30, english:87], [metric:31, english:88], [metric:32, english:90], [metric:33, english:92], [metric:33, english:92], [metric:33, english:92], [metric:33, english:91], [metric:33, english:92], [metric:32, english:90], [metric:30, english:87], [metric:27, english:80], [metric:26, english:78], [metric:24, english:76], [metric:23, english:74]]...truncated</code><br />
<br />
==Quantitative Precipitation Forecast==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.qpf</code><br />
:Returns<br />
::Returns the Quantitative Precipitation Forecast is the expected amount of melted precipitation accumulated over a specified time period. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0]]...truncated</code><br />
<br />
==Snow==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.snow</code><br />
:Returns<br />
::Returns the forecaasted amount of snow. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0], [metric:0, english:0.0]]...truncated</code><br />
<br />
==Probability of Precipitation==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.pop</code><br />
:Returns<br />
::Returns the probability of precipication. Probability of precipitation refers to the percent chance that a specific location (i.e., the local airport) will receive measurable precipitation (.01 inch of rain or melted snow) in these type of weather conditions. For example, on ten days when the weather is similar to today's, the airport will receive at least .01 inches of rain on four of those days if the chance of rain is 40%.<br />
<br />
:Example<br />
::<code>[0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 5, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 2]...truncated</code><br />
<br />
==Mean Sea Level Pressure==<br />
:Syntax<br />
::<code>$weather.hourly10day.hourly_forecast.mslp</code><br />
:Returns<br />
::Returns the pressure. Add <code>.metric</code> or <code>.english</code> to the end for metric and imperial values respectively.<br />
:Example<br />
::<code>[[metric:1019, english:30.1], [metric:1019, english:30.09], [metric:1018, english:30.06], [metric:1017, english:30.04], [metric:1017, english:30.02], [metric:1016, english:30.0], [metric:1016, english:29.99], [metric:1016, english:29.99], [metric:1016, english:30.0], [metric:1016, english:30.01], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.02], [metric:1017, english:30.03], [metric:1017, english:30.03], [metric:1017, english:30.03], [metric:1017, english:30.03], [metric:1016, english:30.01], [metric:1016, english:29.99], [metric:1015, english:29.98], [metric:1015, english:29.96], [metric:1014, english:29.94], [metric:1014, english:29.93], [metric:1013, english:29.91], [metric:1013, english:29.9], [metric:1013, english:29.9], [metric:1013, english:29.91], [metric:1014, english:29.93], [metric:1014, english:29.94], [metric:1014, english:29.95]]...truncated</code><br />
<br />
=Weather Icons=<br />
[[File:Labels.png|page=1|thumb|232px|Chart of icon labels]]<br />
Adding the weather icon associated with the current or forecasted weather is now as simple as adding <code>:wu-[iconset]-[icon]:</code> into your text. This works exactly like the [[Font Awesome]] icons. <br />
<br />
==Usage==<br />
Choose an icon set below and use the lowercase title for the [iconset] portion. Place the following examples into the value field<br />
<br />
Current Weather: <code>:wu-b-{$weather.conditions.current_observation.icon}:</code><br />
<br />
Forecast Day: <code>:wu-g-{$weather.forecast.forecast.txt_forecast.forecastday[INDEX].icon}</code> note: You will need to change [INDEX] to a value from 0-7 (0 being the next forecasted half day/night and 7 being the 3rd day/night)<br />
<br />
Simple Forecast: <code>:wu-k-{$weather.forecast.forecast.simpleforecast.forecastday[INDEX].icon}</code> note: You will need to change [INDEX] to a value from 0-3 (0 being the next forecasted day and 3 being the 4th day)<br />
<br />
10 Day: <code>:wu-g-{$weather.forecast10day.forecast.txt_forecast.forecastday[INDEX].icon}</code> note: You will need to change [INDEX] to a value from 0-19 (0 being the next forecasted half day/night and 19 being the 10th day/night)<br />
<br />
10 Day Simple Forecast: <code>:wu-k-{$weather.forecast10day.forecast.simpleforecast.forecastday[INDEX].icon}</code> note: You will need to change [INDEX] to a value from 0-9 (0 being the next forecasted day and 9 being the 10th day)<br />
<br />
TODO//<br />
HOURLY<br />
<br />
10 DAY HOURLY<br />
<br />
==A==<br />
[[file:IconA.png]]<br />
<br />
==B==<br />
[[file:IconB.png]]<br />
<br />
==C==<br />
[[file:IconC.png]]<br />
<br />
==D==<br />
[[file:IconD.png]]<br />
<br />
==E==<br />
[[file:IconE.png]]<br />
<br />
==F==<br />
[[file:IconF.png]]<br />
<br />
==G==<br />
[[file:IconG.png]]<br />
<br />
==H==<br />
[[file:IconH.png]]<br />
<br />
==I==<br />
[[file:IconI.png]]<br />
<br />
==J==<br />
[[file:IconJ.png]]<br />
<br />
==K==<br />
[[file:IconK.png]]</div>Ipatersonhttps://wiki.webcore.co/index.php?title=TWC_Weather&diff=828TWC Weather2019-02-23T12:35:03Z<p>Ipaterson: </p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. <code>$twcweather</code> was introduced in webCoRE v0.3.10a.20190223. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
=Conditions=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Low"</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
| <code>"Sunny"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhase</code><br />
| <br />
[<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Full Moon"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"WXG",<br />
"WXG",<br />
"WXG",<br />
"F"<br />
]<br />
|-<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcweather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Cloudy, periods of rain. Highs in the upper 40s with temperatures nearly steady overnight.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].cloudCover</code><br />
|<br />
[<br />
16,<br />
79,<br />
100,<br />
100,<br />
99,<br />
85,<br />
32,<br />
14<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
12,<br />
12,<br />
26,<br />
34,<br />
33<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
1200,<br />
1200,<br />
2600,<br />
3400,<br />
3300<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90,<br />
100,<br />
20,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipType</code><br />
|<br />
[<br />
"rain",<br />
"precip",<br />
"rain",<br />
"rain",<br />
"rain",<br />
"precip",<br />
"rain",<br />
"precip"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpf</code><br />
|<br />
[<br />
0,<br />
0,<br />
0.93,<br />
0.51,<br />
0.48,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierCode</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Q8003",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierPhrase</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Thunder possible.",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
93,<br />
96,<br />
92,<br />
76,<br />
55,<br />
72<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].snowRange</code><br />
|<br />
[<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderCategory</code><br />
|<br />
[<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"Thunder possible",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderIndex</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
1,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvDescription</code><br />
|<br />
[<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds light and variable.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseLong</code><br />
|<br />
[<br />
"Mostly Sunny",<br />
"Mostly Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"Mostly Sunny",<br />
"Mostly Clear"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseShort</code><br />
|<br />
[<br />
"M Sunny",<br />
"M Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"M Sunny",<br />
"M Clear"<br />
]<br />
|}<br />
<br />
=Weather Icons=<br />
<br />
==Usage==<br />
Choose an icon set below and use it with the iconCode values from <code>$twcweather</code>. The following examples can be used in the Value field.<br />
<br />
Current Weather using the "TWC" icon set: <code>:twc-{$twcweather.conditions.iconCode}:</code><br />
<br />
Forecast Day using the "WU v4" icon set: <code>:wu-v4-{$twcweather.forecast.daypart[0].iconCode[INDEX]}</code> note: You will need to change [INDEX] to a value from 0-7 (0 being the next forecasted half day/night and 7 being the 3rd day/night)<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Code<br />
! Description<br />
! TWC Icon<br />
! WU v4 Icon<br />
|-<br />
| 0<br />
| Tornado<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/00.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/0.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 1<br />
| Tropical Storm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/01.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/1.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 2<br />
| Hurricane<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/02.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/2.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 3<br />
| Strong Storms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/03.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/3.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 4<br />
| Thunder and Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/04.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/4.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 5<br />
| Rain to Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/05.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/5.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 6<br />
| Rain / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/06.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/6.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 7<br />
| Wintry Mix Snow / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/07.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/7.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 8<br />
| Freezing Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/08.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/8.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 9<br />
| Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/09.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/9.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 10<br />
| Freezing Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/10.png" height="50"/><br />
<code>:twc-10:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/10.svg" height="50"/><br />
<code>:wu-v4-10:</code><br />
|-<br />
| 11<br />
| Light Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/11.png" height="50"/><br />
<code>:twc-11:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/11.svg" height="50"/><br />
<code>:wu-v4-11:</code><br />
|-<br />
| 12<br />
| Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/12.png" height="50"/><br />
<code>:twc-12:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/12.svg" height="50"/><br />
<code>:wu-v4-12:</code><br />
|-<br />
| 13<br />
| Scattered Flurries<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/13.png" height="50"/><br />
<code>:twc-13:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/13.svg" height="50"/><br />
<code>:wu-v4-13:</code><br />
|-<br />
| 14<br />
| Light Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/14.png" height="50"/><br />
<code>:twc-14:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/14.svg" height="50"/><br />
<code>:wu-v4-14:</code><br />
|-<br />
| 15<br />
| Blowing / Drifting Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/15.png" height="50"/><br />
<code>:twc-15:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/15.svg" height="50"/><br />
<code>:wu-v4-15:</code><br />
|-<br />
| 16<br />
| Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/16.png" height="50"/><br />
<code>:twc-16:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/16.svg" height="50"/><br />
<code>:wu-v4-16:</code><br />
|-<br />
| 17<br />
| Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/17.png" height="50"/><br />
<code>:twc-17:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/17.svg" height="50"/><br />
<code>:wu-v4-17:</code><br />
|-<br />
| 18<br />
| Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/18.png" height="50"/><br />
<code>:twc-18:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/18.svg" height="50"/><br />
<code>:wu-v4-18:</code><br />
|-<br />
| 19<br />
| Blowing Dust / Sandstorm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/19.png" height="50"/><br />
<code>:twc-19:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/19.svg" height="50"/><br />
<code>:wu-v4-19:</code><br />
|-<br />
| 20<br />
| Foggy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/20.png" height="50"/><br />
<code>:twc-20:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/20.svg" height="50"/><br />
<code>:wu-v4-20:</code><br />
|-<br />
| 21<br />
| Haze / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/21.png" height="50"/><br />
<code>:twc-21:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/21.svg" height="50"/><br />
<code>:wu-v4-21:</code><br />
|-<br />
| 22<br />
| Smoke / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/22.png" height="50"/><br />
<code>:twc-22:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/22.svg" height="50"/><br />
<code>:wu-v4-22:</code><br />
|-<br />
| 23<br />
| Breezy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/23.png" height="50"/><br />
<code>:twc-23:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/23.svg" height="50"/><br />
<code>:wu-v4-23:</code><br />
|-<br />
| 24<br />
| Blowing Spray / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/24.png" height="50"/><br />
<code>:twc-24:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/24.svg" height="50"/><br />
<code>:wu-v4-24:</code><br />
|-<br />
| 25<br />
| Frigid / Ice Crystals<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/25.png" height="50"/><br />
<code>:twc-25:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/25.svg" height="50"/><br />
<code>:wu-v4-25:</code><br />
|-<br />
| 26<br />
| Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/26.png" height="50"/><br />
<code>:twc-26:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/26.svg" height="50"/><br />
<code>:wu-v4-26:</code><br />
|-<br />
| 27<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/27.png" height="50"/><br />
<code>:twc-27:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/27.svg" height="50"/><br />
<code>:wu-v4-27:</code><br />
|-<br />
| 28<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/28.png" height="50"/><br />
<code>:twc-28:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/28.svg" height="50"/><br />
<code>:wu-v4-28:</code><br />
|-<br />
| 29<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/29.png" height="50"/><br />
<code>:twc-29:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/29.svg" height="50"/><br />
<code>:wu-v4-29:</code><br />
|-<br />
| 30<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/30.png" height="50"/><br />
<code>:twc-30:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/30.svg" height="50"/><br />
<code>:wu-v4-30:</code><br />
|-<br />
| 31<br />
| Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/31.png" height="50"/><br />
<code>:twc-31:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/31.svg" height="50"/><br />
<code>:wu-v4-31:</code><br />
|-<br />
| 32<br />
| Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/32.png" height="50"/><br />
<code>:twc-32:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/32.svg" height="50"/><br />
<code>:wu-v4-32:</code><br />
|-<br />
| 33<br />
| Fair / Mostly Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/33.png" height="50"/><br />
<code>:twc-33:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/33.svg" height="50"/><br />
<code>:wu-v4-33:</code><br />
|-<br />
| 34<br />
| Fair / Mostly Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/34.png" height="50"/><br />
<code>:twc-34:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/34.svg" height="50"/><br />
<code>:wu-v4-34:</code><br />
|-<br />
| 35<br />
| Mixed Rain & Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/35.png" height="50"/><br />
<code>:twc-35:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/35.svg" height="50"/><br />
<code>:wu-v4-35:</code><br />
|-<br />
| 36<br />
| Hot<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/36.png" height="50"/><br />
<code>:twc-36:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/36.svg" height="50"/><br />
<code>:wu-v4-36:</code><br />
|-<br />
| 37<br />
| Isolated Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/37.png" height="50"/><br />
<code>:twc-37:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/37.svg" height="50"/><br />
<code>:wu-v4-37:</code><br />
|-<br />
| 38<br />
| Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/38.png" height="50"/><br />
<code>:twc-38:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/38.svg" height="50"/><br />
<code>:wu-v4-38:</code><br />
|-<br />
| 39<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/39.png" height="50"/><br />
<code>:twc-39:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/39.svg" height="50"/><br />
<code>:wu-v4-39:</code><br />
|-<br />
| 40<br />
| Heavy Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/40.png" height="50"/><br />
<code>:twc-40:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/40.svg" height="50"/><br />
<code>:wu-v4-40:</code><br />
|-<br />
| 41<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/41.png" height="50"/><br />
<code>:twc-41:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/41.svg" height="50"/><br />
<code>:wu-v4-41:</code><br />
|-<br />
| 42<br />
| Heavy Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/42.png" height="50"/><br />
<code>:twc-42:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/42.svg" height="50"/><br />
<code>:wu-v4-42:</code><br />
|-<br />
| 43<br />
| Blizzard<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/43.png" height="50"/><br />
<code>:twc-43:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/43.svg" height="50"/><br />
<code>:wu-v4-43:</code><br />
|-<br />
| 44<br />
| Not Available (N/A)<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/44.png" height="50"/><br />
<code>:twc-44:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/44.svg" height="50"/><br />
<code>:wu-v4-44:</code><br />
|-<br />
| 45<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/45.png" height="50"/><br />
<code>:twc-45:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/45.svg" height="50"/><br />
<code>:wu-v4-45:</code><br />
|-<br />
| 46<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/46.png" height="50"/><br />
<code>:twc-46:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/46.svg" height="50"/><br />
<code>:wu-v4-46:</code><br />
|-<br />
| 47<br />
| Scattered Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/47.png" height="50"/><br />
<code>:twc-47:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/47.svg" height="50"/><br />
<code>:wu-v4-47:</code><br />
|}<br />
<br />
==Old icon sets==<br />
<br />
Several additional icon sets are available but all have a much more limited set of icons. We have ensured that the <code>$twcWeather</code> icon code numbers map to an approximately accurate representation in the old icon sets. While the old sets work we encourage use of the more expressive TWC and WU v4 icon sets.<br />
<br />
All of the icon sets described on the original [[Weather Icons|Weather#Weather_Icons]] page work with the new codes, for example <code>:wu-b-36:</code> maps to the "sunny" icon in the "B" icon set.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=TWC_Weather&diff=827TWC Weather2019-02-22T18:03:04Z<p>Ipaterson: Fixed icon numbers</p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
=Conditions=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Low"</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
| <code>"Sunny"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhase</code><br />
| <br />
[<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Full Moon"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"WXG",<br />
"WXG",<br />
"WXG",<br />
"F"<br />
]<br />
|-<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcweather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Cloudy, periods of rain. Highs in the upper 40s with temperatures nearly steady overnight.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].cloudCover</code><br />
|<br />
[<br />
16,<br />
79,<br />
100,<br />
100,<br />
99,<br />
85,<br />
32,<br />
14<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
12,<br />
12,<br />
26,<br />
34,<br />
33<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
1200,<br />
1200,<br />
2600,<br />
3400,<br />
3300<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90,<br />
100,<br />
20,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipType</code><br />
|<br />
[<br />
"rain",<br />
"precip",<br />
"rain",<br />
"rain",<br />
"rain",<br />
"precip",<br />
"rain",<br />
"precip"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpf</code><br />
|<br />
[<br />
0,<br />
0,<br />
0.93,<br />
0.51,<br />
0.48,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierCode</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Q8003",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierPhrase</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Thunder possible.",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
93,<br />
96,<br />
92,<br />
76,<br />
55,<br />
72<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].snowRange</code><br />
|<br />
[<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderCategory</code><br />
|<br />
[<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"Thunder possible",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderIndex</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
1,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvDescription</code><br />
|<br />
[<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds light and variable.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseLong</code><br />
|<br />
[<br />
"Mostly Sunny",<br />
"Mostly Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"Mostly Sunny",<br />
"Mostly Clear"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseShort</code><br />
|<br />
[<br />
"M Sunny",<br />
"M Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"M Sunny",<br />
"M Clear"<br />
]<br />
|}<br />
<br />
=Weather Icons=<br />
<br />
==Usage==<br />
Choose an icon set below and use it with the iconCode values from <code>$twcweather</code>. The following examples can be used in the Value field.<br />
<br />
Current Weather using the "TWC" icon set: <code>:twc-{$twcweather.conditions.iconCode}:</code><br />
<br />
Forecast Day using the "WU v4" icon set: <code>:wu-v4-{$twcweather.forecast.daypart[0].iconCode[INDEX]}</code> note: You will need to change [INDEX] to a value from 0-7 (0 being the next forecasted half day/night and 7 being the 3rd day/night)<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Code<br />
! Description<br />
! TWC Icon<br />
! WU v4 Icon<br />
|-<br />
| 0<br />
| Tornado<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/00.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/0.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 1<br />
| Tropical Storm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/01.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/1.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 2<br />
| Hurricane<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/02.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/2.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 3<br />
| Strong Storms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/03.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/3.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 4<br />
| Thunder and Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/04.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/4.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 5<br />
| Rain to Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/05.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/5.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 6<br />
| Rain / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/06.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/6.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 7<br />
| Wintry Mix Snow / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/07.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/7.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 8<br />
| Freezing Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/08.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/8.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 9<br />
| Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/09.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/9.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 10<br />
| Freezing Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/10.png" height="50"/><br />
<code>:twc-10:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/10.svg" height="50"/><br />
<code>:wu-v4-10:</code><br />
|-<br />
| 11<br />
| Light Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/11.png" height="50"/><br />
<code>:twc-11:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/11.svg" height="50"/><br />
<code>:wu-v4-11:</code><br />
|-<br />
| 12<br />
| Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/12.png" height="50"/><br />
<code>:twc-12:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/12.svg" height="50"/><br />
<code>:wu-v4-12:</code><br />
|-<br />
| 13<br />
| Scattered Flurries<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/13.png" height="50"/><br />
<code>:twc-13:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/13.svg" height="50"/><br />
<code>:wu-v4-13:</code><br />
|-<br />
| 14<br />
| Light Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/14.png" height="50"/><br />
<code>:twc-14:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/14.svg" height="50"/><br />
<code>:wu-v4-14:</code><br />
|-<br />
| 15<br />
| Blowing / Drifting Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/15.png" height="50"/><br />
<code>:twc-15:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/15.svg" height="50"/><br />
<code>:wu-v4-15:</code><br />
|-<br />
| 16<br />
| Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/16.png" height="50"/><br />
<code>:twc-16:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/16.svg" height="50"/><br />
<code>:wu-v4-16:</code><br />
|-<br />
| 17<br />
| Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/17.png" height="50"/><br />
<code>:twc-17:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/17.svg" height="50"/><br />
<code>:wu-v4-17:</code><br />
|-<br />
| 18<br />
| Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/18.png" height="50"/><br />
<code>:twc-18:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/18.svg" height="50"/><br />
<code>:wu-v4-18:</code><br />
|-<br />
| 19<br />
| Blowing Dust / Sandstorm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/19.png" height="50"/><br />
<code>:twc-19:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/19.svg" height="50"/><br />
<code>:wu-v4-19:</code><br />
|-<br />
| 20<br />
| Foggy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/20.png" height="50"/><br />
<code>:twc-20:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/20.svg" height="50"/><br />
<code>:wu-v4-20:</code><br />
|-<br />
| 21<br />
| Haze / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/21.png" height="50"/><br />
<code>:twc-21:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/21.svg" height="50"/><br />
<code>:wu-v4-21:</code><br />
|-<br />
| 22<br />
| Smoke / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/22.png" height="50"/><br />
<code>:twc-22:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/22.svg" height="50"/><br />
<code>:wu-v4-22:</code><br />
|-<br />
| 23<br />
| Breezy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/23.png" height="50"/><br />
<code>:twc-23:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/23.svg" height="50"/><br />
<code>:wu-v4-23:</code><br />
|-<br />
| 24<br />
| Blowing Spray / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/24.png" height="50"/><br />
<code>:twc-24:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/24.svg" height="50"/><br />
<code>:wu-v4-24:</code><br />
|-<br />
| 25<br />
| Frigid / Ice Crystals<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/25.png" height="50"/><br />
<code>:twc-25:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/25.svg" height="50"/><br />
<code>:wu-v4-25:</code><br />
|-<br />
| 26<br />
| Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/26.png" height="50"/><br />
<code>:twc-26:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/26.svg" height="50"/><br />
<code>:wu-v4-26:</code><br />
|-<br />
| 27<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/27.png" height="50"/><br />
<code>:twc-27:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/27.svg" height="50"/><br />
<code>:wu-v4-27:</code><br />
|-<br />
| 28<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/28.png" height="50"/><br />
<code>:twc-28:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/28.svg" height="50"/><br />
<code>:wu-v4-28:</code><br />
|-<br />
| 29<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/29.png" height="50"/><br />
<code>:twc-29:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/29.svg" height="50"/><br />
<code>:wu-v4-29:</code><br />
|-<br />
| 30<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/30.png" height="50"/><br />
<code>:twc-30:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/30.svg" height="50"/><br />
<code>:wu-v4-30:</code><br />
|-<br />
| 31<br />
| Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/31.png" height="50"/><br />
<code>:twc-31:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/31.svg" height="50"/><br />
<code>:wu-v4-31:</code><br />
|-<br />
| 32<br />
| Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/32.png" height="50"/><br />
<code>:twc-32:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/32.svg" height="50"/><br />
<code>:wu-v4-32:</code><br />
|-<br />
| 33<br />
| Fair / Mostly Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/33.png" height="50"/><br />
<code>:twc-33:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/33.svg" height="50"/><br />
<code>:wu-v4-33:</code><br />
|-<br />
| 34<br />
| Fair / Mostly Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/34.png" height="50"/><br />
<code>:twc-34:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/34.svg" height="50"/><br />
<code>:wu-v4-34:</code><br />
|-<br />
| 35<br />
| Mixed Rain & Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/35.png" height="50"/><br />
<code>:twc-35:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/35.svg" height="50"/><br />
<code>:wu-v4-35:</code><br />
|-<br />
| 36<br />
| Hot<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/36.png" height="50"/><br />
<code>:twc-36:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/36.svg" height="50"/><br />
<code>:wu-v4-36:</code><br />
|-<br />
| 37<br />
| Isolated Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/37.png" height="50"/><br />
<code>:twc-37:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/37.svg" height="50"/><br />
<code>:wu-v4-37:</code><br />
|-<br />
| 38<br />
| Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/38.png" height="50"/><br />
<code>:twc-38:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/38.svg" height="50"/><br />
<code>:wu-v4-38:</code><br />
|-<br />
| 39<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/39.png" height="50"/><br />
<code>:twc-39:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/39.svg" height="50"/><br />
<code>:wu-v4-39:</code><br />
|-<br />
| 40<br />
| Heavy Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/40.png" height="50"/><br />
<code>:twc-40:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/40.svg" height="50"/><br />
<code>:wu-v4-40:</code><br />
|-<br />
| 41<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/41.png" height="50"/><br />
<code>:twc-41:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/41.svg" height="50"/><br />
<code>:wu-v4-41:</code><br />
|-<br />
| 42<br />
| Heavy Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/42.png" height="50"/><br />
<code>:twc-42:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/42.svg" height="50"/><br />
<code>:wu-v4-42:</code><br />
|-<br />
| 43<br />
| Blizzard<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/43.png" height="50"/><br />
<code>:twc-43:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/43.svg" height="50"/><br />
<code>:wu-v4-43:</code><br />
|-<br />
| 44<br />
| Not Available (N/A)<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/44.png" height="50"/><br />
<code>:twc-44:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/44.svg" height="50"/><br />
<code>:wu-v4-44:</code><br />
|-<br />
| 45<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/45.png" height="50"/><br />
<code>:twc-45:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/45.svg" height="50"/><br />
<code>:wu-v4-45:</code><br />
|-<br />
| 46<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/46.png" height="50"/><br />
<code>:twc-46:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/46.svg" height="50"/><br />
<code>:wu-v4-46:</code><br />
|-<br />
| 47<br />
| Scattered Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/47.png" height="50"/><br />
<code>:twc-47:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/47.svg" height="50"/><br />
<code>:wu-v4-47:</code><br />
|}<br />
<br />
==Old icon sets==<br />
<br />
Several additional icon sets are available but all have a much more limited set of icons. We have ensured that the <code>$twcWeather</code> icon code numbers map to an approximately accurate representation in the old icon sets. While the old sets work we encourage use of the more expressive TWC and WU v4 icon sets.<br />
<br />
All of the icon sets described on the original [[Weather Icons|Weather#Weather_Icons]] page work with the new codes, for example <code>:wu-b-36:</code> maps to the "sunny" icon in the "B" icon set.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=TWC_Weather&diff=826TWC Weather2019-02-22T17:48:08Z<p>Ipaterson: Table formatting</p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
=Conditions=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Low"</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
| <code>"Sunny"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhase</code><br />
| <br />
[<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Full Moon"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"WXG",<br />
"WXG",<br />
"WXG",<br />
"F"<br />
]<br />
|-<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcweather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Cloudy, periods of rain. Highs in the upper 40s with temperatures nearly steady overnight.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].cloudCover</code><br />
|<br />
[<br />
16,<br />
79,<br />
100,<br />
100,<br />
99,<br />
85,<br />
32,<br />
14<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
12,<br />
12,<br />
26,<br />
34,<br />
33<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
1200,<br />
1200,<br />
2600,<br />
3400,<br />
3300<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90,<br />
100,<br />
20,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipType</code><br />
|<br />
[<br />
"rain",<br />
"precip",<br />
"rain",<br />
"rain",<br />
"rain",<br />
"precip",<br />
"rain",<br />
"precip"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpf</code><br />
|<br />
[<br />
0,<br />
0,<br />
0.93,<br />
0.51,<br />
0.48,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierCode</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Q8003",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierPhrase</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Thunder possible.",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
93,<br />
96,<br />
92,<br />
76,<br />
55,<br />
72<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].snowRange</code><br />
|<br />
[<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderCategory</code><br />
|<br />
[<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"Thunder possible",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderIndex</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
1,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvDescription</code><br />
|<br />
[<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds light and variable.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseLong</code><br />
|<br />
[<br />
"Mostly Sunny",<br />
"Mostly Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"Mostly Sunny",<br />
"Mostly Clear"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseShort</code><br />
|<br />
[<br />
"M Sunny",<br />
"M Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"M Sunny",<br />
"M Clear"<br />
]<br />
|}<br />
<br />
=Weather Icons=<br />
<br />
==Usage==<br />
Choose an icon set below and use it with the iconCode values from <code>$twcweather</code>. The following examples can be used in the Value field.<br />
<br />
Current Weather using the "TWC" icon set: <code>:twc-{$twcweather.conditions.iconCode}:</code><br />
<br />
Forecast Day using the "WU v4" icon set: <code>:wu-v4-{$twcweather.forecast.daypart[0].iconCode[INDEX]}</code> note: You will need to change [INDEX] to a value from 0-7 (0 being the next forecasted half day/night and 7 being the 3rd day/night)<br />
<br />
{| class="mw-datatable"<br />
|-<br />
! Code<br />
! Description<br />
! TWC Icon<br />
! WU v4 Icon<br />
|-<br />
| 0<br />
| Tornado<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/00.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/0.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 1<br />
| Tropical Storm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/01.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/1.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 2<br />
| Hurricane<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/02.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/2.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 3<br />
| Strong Storms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/03.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/3.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 4<br />
| Thunder and Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/04.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/4.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 5<br />
| Rain to Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/05.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/5.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 6<br />
| Rain / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/06.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/6.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 7<br />
| Wintry Mix Snow / Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/07.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/7.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 8<br />
| Freezing Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/08.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/8.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 9<br />
| Drizzle<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/09.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/9.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 10<br />
| Freezing Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/10.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/10.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 11<br />
| Light Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/11.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/11.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 12<br />
| Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/12.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/12.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 13<br />
| Scattered Flurries<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/13.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/13.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 14<br />
| Light Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/14.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/14.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 15<br />
| Blowing / Drifting Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/15.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/15.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 16<br />
| Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/16.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/16.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 17<br />
| Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/17.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/17.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 18<br />
| Sleet<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/18.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/18.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 19<br />
| Blowing Dust / Sandstorm<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/19.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/19.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 20<br />
| Foggy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/20.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/20.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 21<br />
| Haze / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/21.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/21.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 22<br />
| Smoke / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/22.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/22.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 23<br />
| Breezy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/23.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/23.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 24<br />
| Blowing Spray / Windy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/24.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/24.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 25<br />
| Frigid / Ice Crystals<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/25.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/25.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 26<br />
| Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/26.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/26.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 27<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/27.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/27.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 28<br />
| Mostly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/28.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/28.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 29<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/29.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/29.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 30<br />
| Partly Cloudy<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/30.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/30.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 31<br />
| Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/31.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/31.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 32<br />
| Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/32.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/32.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 33<br />
| Fair / Mostly Clear<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/33.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/33.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 34<br />
| Fair / Mostly Sunny<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/34.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/34.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 35<br />
| Mixed Rain & Hail<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/35.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/35.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 36<br />
| Hot<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/36.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/36.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 37<br />
| Isolated Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/37.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/37.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|-<br />
| 38<br />
| Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/38.png" height="50"/><br />
<code>:twc-8:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/38.svg" height="50"/><br />
<code>:wu-v4-8:</code><br />
|-<br />
| 39<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/39.png" height="50"/><br />
<code>:twc-9:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/39.svg" height="50"/><br />
<code>:wu-v4-9:</code><br />
|-<br />
| 40<br />
| Heavy Rain<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/40.png" height="50"/><br />
<code>:twc-0:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/40.svg" height="50"/><br />
<code>:wu-v4-0:</code><br />
|-<br />
| 41<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/41.png" height="50"/><br />
<code>:twc-1:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/41.svg" height="50"/><br />
<code>:wu-v4-1:</code><br />
|-<br />
| 42<br />
| Heavy Snow<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/42.png" height="50"/><br />
<code>:twc-2:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/42.svg" height="50"/><br />
<code>:wu-v4-2:</code><br />
|-<br />
| 43<br />
| Blizzard<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/43.png" height="50"/><br />
<code>:twc-3:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/43.svg" height="50"/><br />
<code>:wu-v4-3:</code><br />
|-<br />
| 44<br />
| Not Available (N/A)<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/44.png" height="50"/><br />
<code>:twc-4:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/44.svg" height="50"/><br />
<code>:wu-v4-4:</code><br />
|-<br />
| 45<br />
| Scattered Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/45.png" height="50"/><br />
<code>:twc-5:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/45.svg" height="50"/><br />
<code>:wu-v4-5:</code><br />
|-<br />
| 46<br />
| Scattered Snow Showers<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/46.png" height="50"/><br />
<code>:twc-6:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/46.svg" height="50"/><br />
<code>:wu-v4-6:</code><br />
|-<br />
| 47<br />
| Scattered Thunderstorms<br />
| style="text-align: center" | <img src="https://smartthings-twc-icons.s3.amazonaws.com/47.png" height="50"/><br />
<code>:twc-7:</code><br />
| style="text-align: center" | <img src="https://icons.wxug.com/i/c/v4/47.svg" height="50"/><br />
<code>:wu-v4-7:</code><br />
|}<br />
<br />
==Old icon sets==<br />
<br />
Several additional icon sets are available but all have a much more limited set of icons. We have ensured that the <code>$twcWeather</code> icon code numbers map to an approximately accurate representation in the old icon sets. While the old sets work we encourage use of the more expressive TWC and WU v4 icon sets.<br />
<br />
All of the icon sets described on the original [[Weather Icons|Weather#Weather_Icons]] page work with the new codes, for example <code>:wu-b-36:</code> maps to the "sunny" icon in the "B" icon set.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=TWC_Weather&diff=825TWC Weather2019-02-22T15:58:20Z<p>Ipaterson: Added icons</p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
=Conditions=<br />
<br />
{| class="wikitable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Low"</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
| <code>"Sunny"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
{| class="wikitable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhase</code><br />
| <br />
[<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Full Moon"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"WXG",<br />
"WXG",<br />
"WXG",<br />
"F"<br />
]<br />
|-<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcweather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Cloudy, periods of rain. Highs in the upper 40s with temperatures nearly steady overnight.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].cloudCover</code><br />
|<br />
[<br />
16,<br />
79,<br />
100,<br />
100,<br />
99,<br />
85,<br />
32,<br />
14<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
12,<br />
12,<br />
26,<br />
34,<br />
33<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
1200,<br />
1200,<br />
2600,<br />
3400,<br />
3300<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90,<br />
100,<br />
20,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipType</code><br />
|<br />
[<br />
"rain",<br />
"precip",<br />
"rain",<br />
"rain",<br />
"rain",<br />
"precip",<br />
"rain",<br />
"precip"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpf</code><br />
|<br />
[<br />
0,<br />
0,<br />
0.93,<br />
0.51,<br />
0.48,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierCode</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Q8003",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierPhrase</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Thunder possible.",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
93,<br />
96,<br />
92,<br />
76,<br />
55,<br />
72<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].snowRange</code><br />
|<br />
[<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderCategory</code><br />
|<br />
[<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"Thunder possible",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderIndex</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
1,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvDescription</code><br />
|<br />
[<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds light and variable.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseLong</code><br />
|<br />
[<br />
"Mostly Sunny",<br />
"Mostly Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"Mostly Sunny",<br />
"Mostly Clear"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseShort</code><br />
|<br />
[<br />
"M Sunny",<br />
"M Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"M Sunny",<br />
"M Clear"<br />
]<br />
|}<br />
<br />
=Weather Icons=<br />
<br />
==Usage==<br />
Choose an icon set below and use it with the iconCode values from <code>$twcweather</code>. The following examples can be used in the Value field.<br />
<br />
Current Weather using the "TWC" icon set: <code>:twc-{$twcweather.conditions.iconCode}:</code><br />
<br />
Forecast Day using the "WU v4" icon set: <code>:wu-v4-{$twcweather.forecast.daypart[0].iconCode[INDEX]}</code> note: You will need to change [INDEX] to a value from 0-7 (0 being the next forecasted half day/night and 7 being the 3rd day/night)<br />
<br />
{|<br />
|-<br />
! Code<br />
! Description<br />
! TWC Icon<br />
! WU v4 Icon<br />
! Night or Daytime<br />
|-<br />
| 0<br />
| Tornado<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/00.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/0.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 1<br />
| Tropical Storm<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/01.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/1.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 2<br />
| Hurricane<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/02.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/2.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 3<br />
| Strong Storms<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/03.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/3.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 4<br />
| Thunder and Hail<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/04.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/4.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 5<br />
| Rain to Snow Showers<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/05.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/5.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 6<br />
| Rain / Sleet<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/06.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/6.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 7<br />
| Wintry Mix Snow / Sleet<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/07.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/7.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 8<br />
| Freezing Drizzle<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/08.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/8.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 9<br />
| Drizzle<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/09.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/9.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 10<br />
| Freezing Rain<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/10.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/10.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 11<br />
| Light Rain<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/11.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/11.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 12<br />
| Rain<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/12.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/12.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 13<br />
| Scattered Flurries<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/13.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/13.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 14<br />
| Light Snow<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/14.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/14.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 15<br />
| Blowing / Drifting Snow<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/15.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/15.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 16<br />
| Snow<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/16.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/16.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 17<br />
| Hail<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/17.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/17.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 18<br />
| Sleet<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/18.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/18.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 19<br />
| Blowing Dust / Sandstorm<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/19.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/19.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 20<br />
| Foggy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/20.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/20.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 21<br />
| Haze / Windy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/21.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/21.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 22<br />
| Smoke / Windy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/22.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/22.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 23<br />
| Breezy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/23.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/23.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 24<br />
| Blowing Spray / Windy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/24.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/24.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 25<br />
| Frigid / Ice Crystals<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/25.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/25.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 26<br />
| Cloudy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/26.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/26.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 27<br />
| Mostly Cloudy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/27.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/27.svg" height="50"/><br />
| Night<br />
|-<br />
| 28<br />
| Mostly Cloudy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/28.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/28.svg" height="50"/><br />
| Day<br />
|-<br />
| 29<br />
| Partly Cloudy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/29.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/29.svg" height="50"/><br />
| Night<br />
|-<br />
| 30<br />
| Partly Cloudy<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/30.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/30.svg" height="50"/><br />
| Day<br />
|-<br />
| 31<br />
| Clear<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/31.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/31.svg" height="50"/><br />
| Night<br />
|-<br />
| 32<br />
| Sunny<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/32.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/32.svg" height="50"/><br />
| Day<br />
|-<br />
| 33<br />
| Fair / Mostly Clear<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/33.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/33.svg" height="50"/><br />
| Night<br />
|-<br />
| 34<br />
| Fair / Mostly Sunny<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/34.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/34.svg" height="50"/><br />
| Day<br />
|-<br />
| 35<br />
| Mixed Rain & Hail<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/35.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/35.svg" height="50"/><br />
| Day<br />
|-<br />
| 36<br />
| Hot<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/36.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/36.svg" height="50"/><br />
| Day<br />
|-<br />
| 37<br />
| Isolated Thunderstorms<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/37.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/37.svg" height="50"/><br />
| Day<br />
|-<br />
| 38<br />
| Thunderstorms<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/38.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/38.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 39<br />
| Scattered Showers<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/39.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/39.svg" height="50"/><br />
| Day<br />
|-<br />
| 40<br />
| Heavy Rain<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/40.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/40.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 41<br />
| Scattered Snow Showers<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/41.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/41.svg" height="50"/><br />
| Day<br />
|-<br />
| 42<br />
| Heavy Snow<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/42.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/42.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 43<br />
| Blizzard<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/43.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/43.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 44<br />
| Not Available (N/A)<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/44.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/44.svg" height="50"/><br />
| Night and Day<br />
|-<br />
| 45<br />
| Scattered Showers<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/45.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/45.svg" height="50"/><br />
| Night<br />
|-<br />
| 46<br />
| Scattered Snow Showers<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/46.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/46.svg" height="50"/><br />
| Night<br />
|-<br />
| 47<br />
| Scattered Thunderstorms<br />
| <img src="https://smartthings-twc-icons.s3.amazonaws.com/47.png" height="50"/><br />
| <img src="https://icons.wxug.com/i/c/v4/47.svg" height="50"/><br />
| Night<br />
|}<br />
<br />
==Old icon sets==<br />
<br />
Several additional icon sets are available but all have a much more limited set of icons. We have ensured that the <code>$twcWeather</code> icon code numbers map to an approximately accurate representation in the old icon sets. While the old sets work we encourage use of the more expressive TWC and WU v4 icon sets.<br />
<br />
All of the icon sets described on the original [[Weather Icons|Weather#Weather_Icons]] page work with the new codes, for example <code>:wu-b-36:</code> maps to the "sunny" icon in the "B" icon set.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=TWC_Weather&diff=824TWC Weather2019-02-20T12:59:53Z<p>Ipaterson: </p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
=Conditions=<br />
<br />
{| class="wikitable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Low"</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
| <code>"Sunny"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
{| class="wikitable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhase</code><br />
| <br />
[<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Full Moon"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"WXG",<br />
"WXG",<br />
"WXG",<br />
"F"<br />
]<br />
|-<br />
|-<br />
| <code>$twcweather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcweather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Cloudy, periods of rain. Highs in the upper 40s with temperatures nearly steady overnight.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcweather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].cloudCover</code><br />
|<br />
[<br />
16,<br />
79,<br />
100,<br />
100,<br />
99,<br />
85,<br />
32,<br />
14<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
12,<br />
12,<br />
26,<br />
34,<br />
33<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
1200,<br />
1200,<br />
2600,<br />
3400,<br />
3300<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90,<br />
100,<br />
20,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].precipType</code><br />
|<br />
[<br />
"rain",<br />
"precip",<br />
"rain",<br />
"rain",<br />
"rain",<br />
"precip",<br />
"rain",<br />
"precip"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpf</code><br />
|<br />
[<br />
0,<br />
0,<br />
0.93,<br />
0.51,<br />
0.48,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierCode</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Q8003",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].qualifierPhrase</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Thunder possible.",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
93,<br />
96,<br />
92,<br />
76,<br />
55,<br />
72<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].snowRange</code><br />
|<br />
[<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderCategory</code><br />
|<br />
[<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"Thunder possible",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].thunderIndex</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
1,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvDescription</code><br />
|<br />
[<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds light and variable.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseLong</code><br />
|<br />
[<br />
"Mostly Sunny",<br />
"Mostly Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"Mostly Sunny",<br />
"Mostly Clear"<br />
]<br />
|-<br />
| <code>$twcweather.forecast.daypart[0].wxPhraseShort</code><br />
|<br />
[<br />
"M Sunny",<br />
"M Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"M Sunny",<br />
"M Clear"<br />
]<br />
|}</div>Ipatersonhttps://wiki.webcore.co/index.php?title=TWC_Weather&diff=823TWC Weather2019-02-19T15:10:57Z<p>Ipaterson: Created page with "The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. S..."</p>
<hr />
<div>The <code>$twcweather</code> system variable provides data from The Weather Company following the shutdown of the Weather Underground API that powered <code>$weather</code>. See sample data below which is available for webCoRE installs running on the SmartThings platform.<br />
<br />
=Conditions=<br />
<br />
{| class="wikitable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcweather.conditions.cloudCeiling</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.cloudCoverPhrase</code><br />
| <code>"Clear"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOfWeek</code><br />
| <code>"Wednesday"</code><br />
|-<br />
| <code>$twcweather.conditions.dayOrNight</code><br />
| <code>"D"</code><br />
|-<br />
| <code>$twcweather.conditions.expirationTimeUtc</code><br />
| <code>1545249077</code><br />
|-<br />
| <code>$twcweather.conditions.iconCode</code><br />
| <code>32</code><br />
|-<br />
| <code>$twcweather.conditions.iconCodeExtend</code><br />
| <code>3200</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierCode</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.obsQualifierSeverity</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.precip1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.precip24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.pressureAltimeter</code><br />
| <code>1018.29</code><br />
|-<br />
| <code>$twcweather.conditions.pressureChange</code><br />
| <code>-2.71</code><br />
|-<br />
| <code>$twcweather.conditions.pressureMeanSeaLevel</code><br />
| <code>1018.5</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyCode</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.pressureTendencyTrend</code><br />
| <code>"Falling"</code><br />
|-<br />
| <code>$twcweather.conditions.relativeHumidity</code><br />
| <code>55</code><br />
|-<br />
| <code>$twcweather.conditions.snow1Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow6Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.snow24Hour</code><br />
| <code>0</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeLocal</code><br />
| <code>"2018-12-19T07:28:58-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunriseTimeUtc</code><br />
| <code>1545222538</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeLocal</code><br />
| <code>"2018-12-19T17:10:52-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.sunsetTimeUtc</code><br />
| <code>1545257452</code><br />
|-<br />
| <code>$twcweather.conditions.temperature</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureChange24Hour</code><br />
| <code>-2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureDewPoint</code><br />
| <code>2</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureFeelsLike</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureHeatIndex</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMax24Hour</code><br />
| <code>12</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMaxSince7Am</code><br />
| <code>10</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureMin24Hour</code><br />
| <code>-3</code><br />
|-<br />
| <code>$twcweather.conditions.temperatureWindChill</code><br />
| <code>9</code><br />
|-<br />
| <code>$twcweather.conditions.uvDescription</code><br />
| <code>"Low"</code><br />
|-<br />
| <code>$twcweather.conditions.uvIndex</code><br />
| <code>1</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeLocal</code><br />
| <code>"2018-12-19T14:41:17-0500"</code><br />
|-<br />
| <code>$twcweather.conditions.validTimeUtc</code><br />
| <code>1545248477</code><br />
|-<br />
| <code>$twcweather.conditions.visibility</code><br />
| <code>16.09</code><br />
|-<br />
| <code>$twcweather.conditions.windDirection</code><br />
| <code>180</code><br />
|-<br />
| <code>$twcweather.conditions.windDirectionCardinal</code><br />
| <code>"S"</code><br />
|-<br />
| <code>$twcweather.conditions.windGust</code><br />
| <code>null</code><br />
|-<br />
| <code>$twcweather.conditions.windSpeed</code><br />
| <code>6</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseLong</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseMedium</code><br />
| <code>"Sunny"</code><br />
|-<br />
| <code>$twcweather.conditions.wxPhraseShort</code><br />
| <code>"Sunny"</code><br />
|}<br />
<br />
=Forecast=<br />
<br />
{| class="wikitable"<br />
|-<br />
! Expression<br />
! Sample value<br />
|-<br />
| <code>$twcWeather.forecast.dayOfWeek</code><br />
|<br />
[<br />
"Wednesday",<br />
"Thursday",<br />
"Friday",<br />
"Saturday"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.expirationTimeUtc</code><br />
|<br />
[<br />
1545251268,<br />
1545251268,<br />
1545251268,<br />
1545251268<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.moonPhase</code><br />
| <br />
[<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Waxing Gibbous",<br />
"Full Moon"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.moonPhaseCode</code><br />
|<br />
[<br />
"WXG",<br />
"WXG",<br />
"WXG",<br />
"F"<br />
]<br />
|-<br />
|-<br />
| <code>$twcWeather.forecast.moonPhaseDay</code><br />
|<br />
[<br />
11,<br />
12,<br />
13,<br />
15<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.moonriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T15:04:06-0500",<br />
"2018-12-20T15:44:43-0500",<br />
"2018-12-21T16:32:25-0500",<br />
"2018-12-22T17:26:58-0500"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.moonriseTimeUtc</code><br />
|<br />
[<br />
1545249846,<br />
1545338683,<br />
1545427945,<br />
1545517618<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.moonsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T03:50:48-0500",<br />
"2018-12-20T04:56:24-0500",<br />
"2018-12-21T06:03:51-0500",<br />
"2018-12-22T07:11:16-0500"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.moonsetTimeUtc</code><br />
|<br />
[<br />
1545209448,<br />
1545299784,<br />
1545390231,<br />
1545480676<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.narrative</code><br />
|<br />
[<br />
"A few clouds. Highs in the low 50s and lows in the upper 30s.",<br />
"Cloudy, periods of rain. Highs in the upper 40s with temperatures nearly steady overnight.",<br />
"Cloudy with rain. Highs in the mid 50s and lows in the upper 30s.",<br />
"Mostly sunny. Highs in the upper 40s and lows in the low 30s."<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.qpf</code><br />
|<br />
[<br />
0,<br />
1.44,<br />
0.49,<br />
0<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.sunriseTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:28:58-0500",<br />
"2018-12-20T07:29:31-0500",<br />
"2018-12-21T07:30:02-0500",<br />
"2018-12-22T07:30:32-0500"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.sunriseTimeUtc</code><br />
|<br />
[<br />
1545222538,<br />
1545308971,<br />
1545395402,<br />
1545481832<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.sunsetTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T17:10:52-0500",<br />
"2018-12-20T17:11:19-0500",<br />
"2018-12-21T17:11:47-0500",<br />
"2018-12-22T17:12:18-0500"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.sunsetTimeUtc</code><br />
|<br />
[<br />
1545257452,<br />
1545343879,<br />
1545430307,<br />
1545516738<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.temperatureMax</code><br />
|<br />
[<br />
51,<br />
49,<br />
54,<br />
49<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.temperatureMin</code><br />
|<br />
[<br />
38,<br />
47,<br />
37,<br />
31<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.validTimeLocal</code><br />
|<br />
[<br />
"2018-12-19T07:00:00-0500",<br />
"2018-12-20T07:00:00-0500",<br />
"2018-12-21T07:00:00-0500",<br />
"2018-12-22T07:00:00-0500"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.validTimeUtc</code><br />
|<br />
[<br />
1545220800,<br />
1545307200,<br />
1545393600,<br />
1545480000<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.cloudCover</code><br />
|<br />
[<br />
16,<br />
79,<br />
100,<br />
100,<br />
99,<br />
85,<br />
32,<br />
14<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.dayOrNight</code><br />
|<br />
[<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N",<br />
"D",<br />
"N"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.daypartName</code><br />
|<br />
[<br />
"Today",<br />
"Tonight",<br />
"Tomorrow",<br />
"Tomorrow night",<br />
"Friday",<br />
"Friday night",<br />
"Saturday",<br />
"Saturday night"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.iconCode</code><br />
|<br />
[<br />
34,<br />
27,<br />
12,<br />
12,<br />
12,<br />
26,<br />
34,<br />
33<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.iconCodeExtend</code><br />
|<br />
[<br />
3400,<br />
2700,<br />
1200,<br />
1200,<br />
1200,<br />
2600,<br />
3400,<br />
3300<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.narrative</code><br />
|<br />
[<br />
"Lots of sunshine. High 51F. Winds light and variable.",<br />
"Partly cloudy early followed by cloudy skies overnight. Low 38F. Winds light and variable.",<br />
"Rain likely. High 49F. Winds NE at 5 to 10 mph. Chance of rain 100%. Rainfall near an inch.",<br />
"Rain likely. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a half an inch.",<br />
"Periods of rain. Thunder possible. High 54F. Winds SSW at 5 to 10 mph. Chance of rain 100%.",<br />
"Cloudy. Low 37F. Winds WNW at 5 to 10 mph.",<br />
"A few clouds early, otherwise mostly sunny. High 49F. Winds WNW at 5 to 10 mph.",<br />
"Clear to partly cloudy. Low 31F. Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.precipChance</code><br />
|<br />
[<br />
0,<br />
20,<br />
100,<br />
90,<br />
100,<br />
20,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.precipType</code><br />
|<br />
[<br />
"rain",<br />
"precip",<br />
"rain",<br />
"rain",<br />
"rain",<br />
"precip",<br />
"rain",<br />
"precip"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.qpf</code><br />
|<br />
[<br />
0,<br />
0,<br />
0.93,<br />
0.51,<br />
0.48,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.qpfSnow</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.qualifierCode</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Q8003",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.qualifierPhrase</code><br />
|<br />
[<br />
null,<br />
null,<br />
null,<br />
null,<br />
"Thunder possible.",<br />
null,<br />
null,<br />
null<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.relativeHumidity</code><br />
|<br />
[<br />
63,<br />
85,<br />
93,<br />
96,<br />
92,<br />
76,<br />
55,<br />
72<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.snowRange</code><br />
|<br />
[<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
"",<br />
""<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.temperature</code><br />
|<br />
[<br />
51,<br />
38,<br />
49,<br />
47,<br />
54,<br />
37,<br />
49,<br />
31<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.temperatureHeatIndex</code><br />
|<br />
[<br />
50,<br />
43,<br />
48,<br />
50,<br />
54,<br />
46,<br />
48,<br />
39<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.temperatureWindChill</code><br />
|<br />
[<br />
44,<br />
39,<br />
41,<br />
46,<br />
43,<br />
34,<br />
33,<br />
32<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.thunderCategory</code><br />
|<br />
[<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder",<br />
"Thunder possible",<br />
"No thunder",<br />
"No thunder",<br />
"No thunder"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.thunderIndex</code><br />
|<br />
[<br />
0,<br />
0,<br />
0,<br />
0,<br />
1,<br />
0,<br />
0,<br />
0<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.uvDescription</code><br />
|<br />
[<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low",<br />
"Low"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.uvIndex</code><br />
|<br />
[<br />
1,<br />
0,<br />
1,<br />
0,<br />
1,<br />
0,<br />
2,<br />
0<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.windDirection</code><br />
|<br />
[<br />
173,<br />
44,<br />
51,<br />
125,<br />
208,<br />
292,<br />
282,<br />
274<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.windDirectionCardinal</code><br />
|<br />
[<br />
"S",<br />
"NE",<br />
"NE",<br />
"SE",<br />
"SSW",<br />
"WNW",<br />
"WNW",<br />
"W"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.windPhrase</code><br />
|<br />
[<br />
"Winds light and variable.",<br />
"Winds light and variable.",<br />
"Winds NE at 5 to 10 mph.",<br />
"Winds light and variable.",<br />
"Winds SSW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds WNW at 5 to 10 mph.",<br />
"Winds light and variable."<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.windSpeed</code><br />
|<br />
[<br />
3,<br />
1,<br />
6,<br />
5,<br />
9,<br />
9,<br />
9,<br />
3<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.wxPhraseLong</code><br />
|<br />
[<br />
"Mostly Sunny",<br />
"Mostly Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"Mostly Sunny",<br />
"Mostly Clear"<br />
]<br />
|-<br />
| <code>$twcWeather.forecast.daypart.wxPhraseShort</code><br />
|<br />
[<br />
"M Sunny",<br />
"M Cloudy",<br />
"Rain",<br />
"Rain",<br />
"Rain",<br />
"Cloudy",<br />
"M Sunny",<br />
"M Clear"<br />
]<br />
|}</div>Ipatersonhttps://wiki.webcore.co/index.php?title=webCoRE&diff=822webCoRE2018-09-14T00:02:43Z<p>Ipaterson: /* Misc Pages */ Added Font Awesome link</p>
<hr />
<div><youtube>jgXA_rv2-_8</youtube><br />
<br />
<div style="float: left; clear: both; margin-right: 2em; margin-top: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
= General =<br />
The ''web Community's own Rule Engine'' (or for short, webCoRE) is a general rule engine for SmartThings. It works by allowing users to create scripts that are interpreted and executed by the SmartThings SmartApp, allowing for complex decisions. webCoRE is currently a work in progress. webCoRE reached the first Beta milestone on April 29, 2017. <br />
<br />
Currently webCoRE is in the Second Beta milestone as of June 7th, 2017. Lots of bugs have been squashed and several new features have been implemented. <br />
<br />
Please review the [[webCoRE todo]] list for a loose road map.<br />
<br />
=Definitions=<br />
{{:Glossary}}<br />
<br />
= Getting started =<br />
A few steps need to be completed before you can use webCoRE. First, webCoRE needs to be installed in your SmartThings account, then automations need to be configured. These are called [[Piston|pistons]] and will be detailed later. So let's start by installing webCoRE, please follow the steps below. <br />
<br />
Please be sure to read through all the instructions. If you are still getting stuck then check the troubleshooting sections. Should you still have problems then please feel free to ask for some help on the SmartThings Forums. Be sure to find the latest webCoRE help post.<br />
<br />
=Installing webCoRE=<br />
These instructions will guide you through installing webCoRE via GitHub integration or manually all the way to adding devices and authorizing your browser for use. Be sure to follow all the steps as proper order is crucial when installing for the first time.<br />
<br />
==GitHub Installation (preferred method)==<br />
<br />
<youtube>y_ElUwmmI6Y</youtube><br />
<br />
# If you are in the UK/EU, click this link [https://graph-eu01-euwest1.api.smartthings.com/githubAuth/step1 link] and follow the on-screen instructions to activate GitHub integration for your IDE shard.<br />
# Login to the [https://account.smartthings.com SmartThings IDE].<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''Settings''' button at the top of the page.<br />
#:[[File:Settings.jpg]]<br />
# Click the '''Add new repository''' link at the bottom of the pop up.<br />
# Enter <code>ady624</code> in the '''Owner''' column.<br />
# Enter <code>webCoRE</code> in the '''Name''' column.<br />
# Enter <code>master</code> in the '''Branch''' column.<br />
# Click '''Save''' (do not hit the Enter key, it will exit the form without saving).<br />
#:[[File:Githubrepo.jpg|frameless|400px]]<br />
# Click '''Update From Repo'''.<br />
# Select '''webCoRE (master)''' from the list.<br />
#:[[File:Update.jpg]]<br />
# Check "webCore.groovy" from the '''New (only in GitHub)''' box. {{Warning |Do not update all at once}}<br />
#:[[File:Githubinstall_webcoreonly.png]]<br />
# Check the '''Publish''' checkbox at the bottom of the pop up.<br />
#:[[File:Ide_update.png]]<br />
# Click the '''Execute Update''' button.<br />
#:[[File:Ide_update-new.png]]<br />
# Click again on '''Update From Repo'''.<br />
# Select '''webCoRE (master)''' from the list.<br />
#:[[File:Update.jpg]]<br />
# Check "webCoRE Piston.groovy", "webCoRE Storage.groovy"and "webCoRE Dashboard.groovy" from the '''New (only in GitHub)''' box.<br />
#:[[File:Githubinstall_allchecked.png]]<br />
# Check the '''Publish''' checkbox at the bottom of the pop up.<br />
#:[[File:Ide_update.png]]<br />
# Click the '''Execute Update''' button.<br />
#:[[File:Ide_update-new.png]]<br />
<br />
==Manual Install==<br />
<br />
<br />
=== webCoRE Smart App ===<br />
<br />
# Login to the [https://account.smartthings.com SmartThings IDE].<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore.src/webcore.groovy webCore.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save'''.<br />
# Click '''Publish'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Piston Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-piston.src/webcore-piston.groovy webCoRE-piston.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Storage Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-storage.src/webcore-storage.groovy webCoRE-storage.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Dashboard Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-dashboard.src/webcore-dashboard.groovy webCoRE-dashboard.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
<br />
<br />
==Enabling OAuth for webCoRE==<br />
# Navigate to the '''My SmartApps''' page if you are not already there.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the edit button to the left of '''ady624 : webCoRE''', it looks like a rounded square with a pencil in it.<br />
#:[[File:Editwebcore.jpg]]<br />
# Scroll down and click on '''OAuth'''.<br />
# Click the '''Enable OAuth in SmartApp''' button.<br />
# Click the '''Update''' button at the bottom of the page.<br />
#:[[File:Oauth.jpg|frameless|600px]]<br />
<br />
<br />
<br />
==Installing webCoRE==<br />
# Open the SmartThings app on your mobile device.<br />
# Tap the '''Marketplace''' icon at the bottom of the screen. If you are in a Room or Device within the app you will need to go back to '''My Home'''.<br />
# Tap the '''SmartApps''' header at the top of the page.<br />
# Scroll down and tap '''My Apps'''.<br />
# Scroll down until you find '''webCoRE''' and tap it. Do not tap '''webCoRE Piston'''. If you can't find '''webCore''' you likely skipped some steps above.<br />
# Tap '''Next'''.<br />
# Here you can change the name from '''webCoRE''' to anything you desire then tap '''Next'''. (''Recommend leaving it unless you are working with multiple instances.'')<br />
# Choose a password and expiration length then tap '''Next'''.<br />
# Scroll through the list and select all of the devices you want webCoRE to have access to. If you do not do this, you will not be able to use those devices in webCoRE. This must also be done again when adding new devices to your SmartThings Account. webCoRE will not automatically import them.<br />
# Tap '''Next'''.<br />
# Tap '''Done'''.<br />
<br />
<br />
<br />
==Opening the new dashboard from your phone==<br />
# From within the SmartThings app, tap the Automations icon at the bottom of the screen and select the SmartApps section.<br />
# Scroll down and tap the name of the webCoRE instance you are trying to access. This is typically webCoRE, unless you edited the name during the installation process.<br />
# Tap Dashboard.<br />
# You will be prompted to enter the security password, the same password you created when you installed webCoRE.<br />
<br />
<br />
<br />
==Using webCoRE from another browser==<br />
You cannot bookmark the URL you launched from the SmartThing app. In order to use webCoRE on another device you must follow these instructions.<br />
<br />
# From within the SmartThings app, tap the '''Automations''' icon at the bottom of the screen and select the '''SmartApps''' section.<br />
# Scroll down and tap the name of the webCoRE instance you are trying to access. This is typically '''webCoRE''', unless you edited the name during the installation process.<br />
# Tap '''Register a browser''', a page will appear providing you with a registration code. The code expires in 3 minutes and can only be used once.<br />
#: [[File:Register-browser.png|Register a Browser]] [[File:Register-browser-code.png|Register a Browser]]<br />
# On your other device, open the browser and visit <i>[https://webcore.co/re webcore.co/re]</i><br />
# Enter the code and click '''Register'''.<br />
# You will be prompted to enter the security password, the same password you created when you installed webCoRE.<br />
<br />
<br />
<br />
= Updating webCoRE =<br />
[[file:UpdateAlert.png]]<BR><br />
When you see the alert that there is a new version available or that your smartapps are not the same version then you will need to update the webCoRE code. This has a few benefits besides being on the latest and greatest version. It is best to keep webCoRE up to date because bugs are constantly getting squashed and new features added with each version. This will make troubleshooting easier when you are running into issues and seeking help. Lastly SmartThings keeps the most used SmartApps in their cache which means quicker response times on your pistons. <br />
<br />
For those of you with gitHub integration this is a quick and painless process. If you manually installed then it is a similar process as before. Either way updating only takes a few minutes of your time. <br />
<br />
== GitHub ==<br />
#Log into the [https://account.smartthings.com SmartThings IDE].<br />
#Select My SmartApps<br />
#*You will see all the webCoRE SmartApps listed in a purple color<br />
#Click update from Repo<br />
#Select webCoRE(Master)<br />
#*In the Obsolete column you will see the 4 webCoRE SmartApps<br />
#Select all 4 checkboxes<br />
#Click the publish checkbox<br />
#Click Execute Update<br />
<br />
== Manual Update == <br />
This requires a little bit more work than gitHub integration but still will only take a few moments. Visit the links below and copy and paste the new raw code over the obsolete code then publish and execute update.<br />
<br />
<br />
{| class="wikitable"<br />
|+ Link to Raw gitHub code<br />
|-<br />
! webCoRE<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore.src/webcore.groovy<br />
|-<br />
! webCoRE Dashboard<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-dashboard.src/webcore-dashboard.groovy<br />
|-<br />
! webCoRE Piston<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-piston.src/webcore-piston.groovy<br />
|-<br />
! webCoRE Storage<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-storage.src/webcore-storage.groovy<br />
|}<br />
<br />
== Update Complete ==<br />
That is all you have to do. Your webCoRE instance's are now up to date. However if you have multiple locations(hubs) then you will need to do this for each location(hub).<br />
<br />
=Troubleshooting=<br />
Here are some common troubleshooting things to try if you are having issues with the following categories<br />
<br />
==Installation==<br />
[[File:500error.png|frameless|400px]]<br><br />
<br />
If you receive this error it may be because you installed and published both "webCore.groovy" and other SmartApps at the same time. Please do them in order per the instructions. Be sure to install/publish "webCore.groovy" first then the others after (See steps 11-16). You can do the other SmartApps at the same time after "webCore.groovy" has been installed and published.<br />
<br />
<br />
==General==<br />
Endless Spinning Square<br />
#Open The SmartThings App<br />
#Go into settings<br />
#Click the map location<br />
#Move the pin on the map around<br />
#Position on your actual location<br />
#save actual location<br />
#Save the settings<br />
<br />
<br />
= Creating your first piston =<br />
{{:Creating your first piston}}<br />
<br />
=Sample Pistons=<br />
This section has some user contributed sample pistons. You can import any of these pistons using the import code displayed at the top of the piston.<br />
# [[Samples]]<br />
<br />
= Understanding the basics =<br />
webCoRE is comprised of the three main components listed below.<br />
<br />
== The webCoRE child SmartApp (''webCoRE Piston'') ==<br />
The webCoRE child SmartApp is also known as a [[Piston|piston]]. It is responsible for executing the automation script that the user creates and does the heavy lifting in the whole webCoRE ecosystem. It is directly managed by the webCoRE parent SmartApp, which can create, maintain, and delete a Piston.<br />
<br />
== The webCoRE parent SmartApp (''webCoRE'') ==<br />
The wabCoRE parent SmartApp is the component responsible for managing the child SmartApp instances and their relationship with the Dashboard. It is the middle man that allows adding new Pistons, maintaining them, or deleting them. It is also responsible with the security of the whole ecosystem, allowing password secured access from the Dashboard.<br />
<br />
== The [[Dashboard|dashboard]] ==<br />
The Dashboard is an [https://en.wikipedia.org/wiki/HTML HTML] interface for webCoRE that allows users to manage their webCoRE installation. It is the central hub to controlling webCoRE, allowing the user to create, modify, test, and delete Pistons.<br />
<br />
=Anatomy of a webCoRE Piston=<br />
::''Main article [[Piston]]''<br />
A piston is a script that contains a collection of elements, arranged so that the logic and flow of the piston perform tasks in a desired sequence. It is broken down into several sections, each having its own important role.<br />
<br />
//todo: most details below need to be moved into the main article<br />
<br />
==The ''settings'' section==<br />
This menu is accessed from the piston editor. In the upper right hand corner select options and then enable <code>Show piston settings</code><br />
<br />
<br />
[[file:pistonoptions.png]]<br />
<br />
These settings allows configuration of how certain aspects of the piston function. <br />
<br />
[[file:pistonsettings.png|frameless|500px]]<br />
<br />
*'''Name''' - Change the name of a piston.<br />
*'''Description''' - Give a description of what the piston does.<br />
*'''Automatic piston state''' - Change whether the piston handles it state or make it manual and you can control the piston's state.<br />
*'''Piston execution parallelism''' - //todo<br />
*'''Condition traversal optimizations''' - //todo<br />
*'''Event subscriptions''' - Allow event subscriptions or turn them off if you would like to make the piston a follow up style piston. If you disable this then you must have some other means for the piston to be fired.<br />
*'''Command execution delay''' - A delay in milliseconds for commands to be executed piston wide.<br />
<br />
==The ''define'' section==<br />
This menu is accessed from the piston editor. In the upper right hand corner select options and then enable <code>Show variables</code><br />
<br />
<br />
[[file:pistonoptions.png]]<br />
<br />
A very powerful feature of webCoRE is the ability to use [[Variable|variables]]. Think of variables as temporary pockets where you can store information and are able to later retrieve and use this information for any purpose. This information can be used either during the current piston run, or at a later time, when another event occurs.<br />
<br />
[[file:pistondefine.png|frameless|500px]]<br />
<br />
*'''Type''' - You can select from the different [[Variable_data_types|Variable Data Types]] for you variable.<br />
*'''Name''' - This is the empty box next to the type. Enter a name for your variable.<br />
*'''Initial value''' - This is defaulted to <code>Nothing selected</code>. If you decide to give it an initial value then that value will be used at each piston run regardless of what is stored in later piston runs.<br />
*'''Description''' - Give a description of what the variable is used for.<br />
<br />
==The ''execute'' section==<br />
This section describes the piston's logic flow. This is the starting point of most executions. Whenever a device event happens, the piston starts its execution here. To get started click on <code>Add a new statement</code><br />
<br />
[[file:executesimple.png|frameless|500px]]<br />
<br />
<br />
These are you 3 basic building blocks with their description listed below them. There are several more options to choose from aside from these three. In order to gain access to these you will again have to visit that trusty options menu in the top right hand corner and select <code>Show advanced statments</code><br />
<br />
[[file:pistonoptions.png]]<br />
<br />
<br />
After you do this and you click on <code>Add a new statement</code> you will now have access to all the available statement options.<br />
<br />
[[file:executeadvanced.png|frameless|500px]]<br />
<br />
=Misc Pages=<br />
==[[webCoRE Logging]]==<br />
==[[Functions]]==<br />
==[[Expressions]]==<br />
==[[Case_Traversal_Policy|Case Traversal Policy]]==<br />
==[[Execution_Method|Execution Method]]==<br />
==[[Piston_State|Piston State]]==<br />
==[[Font_Awesome|Icons with Font Awesome]]==<br />
==[[Task_Scheduling_Policy|Task Scheduling Policy]]==<br />
==[[Weather | Weather]]==<br />
==[[NFL | NFL API]]==<br />
<br />
<br />
<seo keywords="webCoRE,dashboard,smart home,automation,SmartThings,rule engine,zigbee,z-wave,smart device" description="The official wiki for webCoRE, the Web-enabled Community's own Rule Engine SmartApp"></seo></div>Ipatersonhttps://wiki.webcore.co/index.php?title=Functions&diff=820Functions2018-08-21T15:02:43Z<p>Ipaterson: /* Integers */ Corrected previousAge to identify that it is the total elapsed time rather than just the duration of the previous value</p>
<hr />
<div><div style="float: left; clear: both; margin-right: 1em; margin-bottom: 1em;">__TOC__</div><br />
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions<br />
<br />
<br />
=[[Variable_data_types#String|String]] functions=<br />
<br />
==concat==<br />
:Syntax<br />
::<code>''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.<br />
<br />
==contains==<br />
:Syntax<br />
::<code>''boolean'' contains(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if the <code>needle</code> is found anywhere in the <code>haystack</code><br />
<br />
==endsWith==<br />
:Syntax<br />
::<code>''boolean'' endsWith(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if <code>haystack</code> ends with the <code>needle</code><br />
<br />
==format==<br />
[[File:Format.pdf|page=1|thumb|256px|A very nice article written by Professor Don Colton, at the Brigham Young University of Hawaii]]<br />
:Syntax<br />
::<code>''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])</code><br />
:Returns<br />
::Returns a string that is built based on the <code>formatString</code> with arguments replaced by their corresponding values. Follows the java syntax for <code>printf()</code>. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].<br />
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. <br />
:Example<br />
::<code>format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])</code> outputs <code>The temperature outside is 71.26 degrees Fahrenheit</code><br />
::The <code>%.2f</code> translates to "format as <code>f</code>loat and use <code>.2</code> decimal places.<br />
<br />
==indexOf==<br />
:Syntax<br />
::<code>''integer'' indexOf(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns the character index of the first occurrence of <code>needle</code> inside <code>haystack</code><br />
:Examples<br />
::<code>indexOf("hello world", 'l')</code> outputs <code>2</code><br />
<br />
==json==<br />
:Syntax<br />
::<code>''string'' json(''dynamic'' value[, "boolean" pretty])</code><br />
:Returns<br />
::Returns the JSON representation of the provided value. If the pretty parameter is true, indentation is added to improve human readability <br />
:Examples<br />
::<code>json(true)</code> outputs <code>"true"</code><br />
::<code>json(123)</code> outputs <code>"123"</code><br />
::<code>json('Nicole "Nikki" Sawyer')</code> outputs <code>""Nicole \"Nikki\" Sawyer""</code><br />
::<code>json(myStringList, true)</code> outputs with pretty formatting<br />
:::<code>"{<br/>&nbsp; "name": "Jaime",<br/>&nbsp; "present": true<br/>}"</code><br />
::<code>json(myDeviceList)</code> outputs <code>"[":97e051eb6fea489fa7cf1aaa4cb7c171:",":73d68350942e4555a8c47c36f558681e:"]"</code> since device variables are internally a list of device IDs<br />
::<code><nowiki>"\{"device": {json($currentEventDevice)}, "rooms": \[ {json(activeRoom)}, "Basement" \] \}"</nowiki></code> building JSON by hand in a webCoRE expression requires any <code>{}[]</code> characters in the JSON to be escaped with a backslash and all dynamic values must use the <code>json()</code> function to safely represent the value<br />
<br />
==lastIndexOf==<br />
:Syntax<br />
::<code>''integer'' lastIndexOf(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns the character index of the last occurrence of <code>needle</code> inside <code>haystack</code><br />
:Examples<br />
::<code>lastIndexOf("hello world", 'l')</code> outputs <code>9</code><br />
<br />
==left==<br />
:Syntax<br />
::<code>''string'' left(''string'' value, ''integer'' length)</code><br />
:Returns<br />
::Returns the first <code>length</code> characters in <code>value</code><br />
:Examples<br />
::<code>left("hello world", 2)</code> outputs <code>he</code><br />
<br />
==lower==<br />
:Syntax<br />
::<code>''string'' lower(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but with all lower case letters.<br />
:Examples<br />
::<code>lower("Hello World")</code> outputs <code>hello world</code><br />
<br />
==mid==<br />
:Syntax<br />
::<code>''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])</code><br />
:Arguments<br />
::<code>start</code> - provides the 0-based index of the first character to copy. If <code>start</code> is negative, the counting starts from the end of <code>value</code>.<br />
::<code>count</code> - provides the number of characters to copy from <code>value</code>. If not provided, all of the remaining characters from <code>value</code> are returned, starting with character number <code>start</code>. If <code>count</code> is negative, prior characters are returned.<br />
:Returns<br />
::Returns a substring of <code>value</code>, <code>count</code> characters long, starting at character number <code>start</code>. Note that the first character in any string has index 0.<br />
:Examples<br />
::<code>mid("Hello World", 2, 3)</code> outputs <code>llo</code><br />
::<code>mid("Hello World", 2)</code> outputs <code>llo World</code><br />
::<code>mid("Hello World", -5, 2)</code> outputs <code>Wo</code><br />
::<code>mid("Hello World", -1, -3)</code> outputs <code>orl</code><br />
<br />
==random==<br />
:Syntax<br />
::<code>''dynamic'' random([''integer'' range | ''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN]])</code><br />
:Arguments<br />
::<code>range</code> - an integer number representing a range<br />
::<code>value1</code>..<code>valueN</code> - any kind of arguments, one will be randomly returned<br />
:Returns<br />
::Returns a random decimal number between <code>0</code> and <code>1</code> if no arguments are provided, or a number between <code>0</code> and <code>range</code> (inclusive) if a single argument is provided, or a randomly selected argument if two or more arguments are provided.<br />
:Examples<br />
::<code>random()</code> outputs <code>0.483</code> (random decimal)<br />
::<code>random(20)</code> outputs <code>6</code> (random integer)<br />
::<code>random("Hello World", "Good morning", "Hello", "Hi")</code> outputs <code>Hello</code> (randomly selected value)<br />
:Tips<br />
::To output a random integer between 5 and 20 use <code>(5 + random(15))</code><br />
::To output a random integer between -5 and 20 use <code>(-5 + random(25))</code><br />
<br />
==replace==<br />
:Syntax<br />
::<code>''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])</code><br />
:Returns<br />
::Replaces all the occurrences of <code>needle</code> inside <code>haystack</code> with its respective <code>replacement</code>. Multiple pairs of <code>needle</code>/<code>replacement</code> can be provided in one function call.<br />
:Regular expressions<br />
::Needles support regular expressions when their value starts and ends with a <code>/</code>. For example, <code>'/(\s)/'</code> will match all spaces.<br />
:Examples<br />
::<code>replace("Hello World", 'World', 'Earth')</code> outputs <code>Hello Earth</code><br />
::<code>replace("Hello World", 'World', 'Earth', 'Hello', 'Hi')</code> outputs <code>Hi Earth</code><br />
::<code>replace("Hello World", 'World', 'Earth', 'Earth', 'Planet')</code> outputs <code>Hello Planet</code><br />
<br />
==right==<br />
:Syntax<br />
::<code>''string'' right(''string'' value, ''integer'' length)</code><br />
:Returns<br />
::Returns the last <code>length</code> characters in <code>value</code><br />
:Examples<br />
::<code>right("hello world", 4)</code> outputs <code>orld</code><br />
<br />
==startsWith==<br />
:Syntax<br />
::<code>''boolean'' startsWith(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if <code>haystack</code> starts with the <code>needle</code><br />
<br />
==string==<br />
:Syntax<br />
::<code>''string'' string(''dynamic'' value)</code><br />
:Returns<br />
::Returns <code>value</code> as a string.<br />
<br />
==substr==<br />
:Alias of <code>mid()</code><br />
<br />
==substring==<br />
:Alias of <code>mid()</code><br />
<br />
==title==<br />
:Syntax<br />
::<code>''string'' title(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but in its title case format (each word starts with a capitalized letter).<br />
:Examples<br />
::<code>lower("Hello there world")</code> outputs <code>Hello There World</code><br />
<br />
==upper==<br />
:Syntax<br />
::<code>''string'' upper(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but with all upper case letters.<br />
:Examples<br />
::<code>upper("Hello World")</code> outputs <code>HELLO WORLD</code><br />
<br />
==text==<br />
:Alias of <code>string()</code><br />
<br />
==trim==<br />
:Syntax<br />
::<code>"string" trim("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with leading and trailing spaces removed<br />
:Examples<br />
::<code>trim(" Hello World ")</code> outputs <code>Hello World</code><br />
<br />
==trimLeft==<br />
:Syntax<br />
::<code>"string" trimLeft("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with leading spaces removed<br />
:Examples<br />
::<code>trimLeft(" Hello World ")</code> outputs <code>"Hello World "</code><br />
<br />
==ltrim==<br />
:Alias of <code>trimLeft()</code><br />
<br />
==trimRight==<br />
:Syntax<br />
::<code>"string" trimRight("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with trailing spaces removed<br />
:Examples<br />
::<code>trimRight(" Hello World ")</code> outputs <code>" Hello World"</code><br />
<br />
==rtrim==<br />
:Alias of <code>trimRight()</code><br />
<br />
==urlEncode==<br />
:Syntax<br />
::<code>''string'' urlEncode(''dynamic'' value)</code><br />
:Returns<br />
::Returns a string with all characters other than <code>a-z A-Z 0-9 . - * _ +</code> converted to percent encoding for use in a URL<br />
:Examples<br />
::<code>urlEncode("John's iPhone 8+")</code> outputs <code>"John%27s%20iPhone%208+"</code><br />
::<code><nowiki>"http://webcore.co/sample?device={urlEncode($currentEventDevice)}&attribute={urlEncode($currentEventAttribute)}&value={urlEncode($currentEventValue)}"</nowiki></code> ensures that the generated URL is valid even if the event information includes spaces, & signs, or other problematic characters.<br />
<br />
==encodeURIComponent==<br />
:Alias of <code>urlEncode()</code><br />
<br />
=Numeric functions=<br />
<br />
==avg==<br />
:Syntax<br />
::<code>''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the mean average of all the values provided.<br />
<br />
==abs==<br />
:Syntax<br />
::<code>''decimal'' abs(''decimal'' value)</code><br />
:Returns<br />
::Returns the absolute value of the argument (e.g., remove negative sign for negative values).<br />
<br />
==ceil==<br />
:Syntax<br />
::<code>''integer'' ceil(''decimal'' value)</code><br />
:Returns<br />
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.<br />
:Examples<br />
::<code>ceil(5.6)</code> outputs <code>6</code><br />
::<code>ceil(-5.6)</code> outputs <code>-6</code><br />
<br />
==ceiling==<br />
:Alias of <code>ceil</code><br />
<br />
==decimal==<br />
:Syntax<br />
::<code>''decimal'' decimal(''dynamic'' value)</code><br />
:Returns<br />
::Converts <code>value</code> into a decimal. Returns <code>0</code> if <code>value</code> is not numeric.<br />
<br />
==float==<br />
:Alias of <code>decimal</code><br />
<br />
==floor==<br />
:Syntax<br />
::<code>''integer'' ceil(''decimal'' value)</code><br />
:Returns<br />
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.<br />
:Examples<br />
::<code>floor(5.6)</code> outputs <code>5</code><br />
::<code>floor(-5.6)</code> outputs <code>-5</code><br />
<br />
==max==<br />
:Syntax<br />
::<code>''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==median==<br />
:Syntax<br />
::<code>''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==min==<br />
:Syntax<br />
::<code>''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==number==<br />
:Alias of <code>decimal</code><br />
<br />
==power==<br />
:Syntax<br />
::<code>''decimal'' power(''decimal'' value, ''decimal'' exponent)</code><br />
:Returns<br />
::Returns the <code>value</code> at the power of <code>exponent</code><br />
<br />
==round==<br />
:Syntax<br />
::<code>''decimal'' round(''decimal'' value[, ''integer'' precision = 0])</code><br />
:Arguments<br />
::<code>precision</code> - the number of decimal places to be retained. If not provided, defaults to <code>0</code><br />
:Returns<br />
::Returns the rounded <code>value</code> with <code>precision</code> decimal places.<br />
<br />
==sqr==<br />
:Syntax<br />
::<code>''decimal'' sqr(''decimal'' value)</code><br />
:Returns<br />
::Returns the squared <code>value</code>, equivalent to <code>value</code> multiplied by itself.<br />
<br />
==sqrt==<br />
:Syntax<br />
::<code>''decimal'' sqrt(''decimal'' value)</code><br />
:Returns<br />
::Returns the square root of <code>value</code>.<br />
<br />
==stdev==<br />
:Syntax<br />
::<code>''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the standard deviation of all the values provided.<br />
<br />
==sum==<br />
:Syntax<br />
::<code>''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the sum of sum of all the values provided.<br />
<br />
==variance==<br />
:Syntax<br />
::<code>''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the variance of all the values provided.<br />
<br />
=[[Variable_data_types#Boolean|Boolean]] functions=<br />
<br />
==bool==<br />
:Syntax<br />
::<code>bool(''dynamic'' value)</code><br />
:Returns<br />
::Returns the truth value of the input. Accepts anything as input and will return true if <code>value</code> is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime<br />
<br />
==boolean==<br />
:This is an alias of [[Functions#bool|bool]]<br />
<br />
==eq==<br />
:Syntax<br />
::<code>eq(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is equivalent to <code>value2</code><br />
<br />
==ge==<br />
:Syntax<br />
::<code>ge(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is greater than or equal to <code>value2</code><br />
<br />
==gt==<br />
:Syntax<br />
::<code>gt(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is greater than <code>value2</code><br />
<br />
==isBetween==<br />
:Syntax<br />
::<code>isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)</code><br />
:Returns<br />
::Returns true if <code>value</code> is greater then or equal to <code>startValue</code> and less than or equal to <code>endValue</code><br />
<br />
==isEmpty==<br />
:Syntax<br />
::<code>isEmpty(''dynamic'' value)</code><br />
:Returns<br />
::Returns true if <code>value</code> is not set, an empty string, or zero<br />
<br />
==le==<br />
:Syntax<br />
::<code>le(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is less than or equal to <code>value2</code><br />
<br />
==lt==<br />
:Syntax<br />
::<code>lt(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is less than <code>value2</code><br />
<br />
==not==<br />
:Syntax<br />
::<code>not(''dynamic'' value)</code><br />
:Returns<br />
::Returns the negated truth state of <code>value</code>. This is the logical negation of <code>[[Functions#bool|bool]](''dynamic'' value)</code>.<br />
<br />
=[[Variable_data_types#Date_and_Time|Date and time]] functions=<br />
<br />
==addDays==<br />
:Syntax<br />
::<code>addDays(''datetime'' value, ''integer'' days)</code><br />
:Returns<br />
::Returns a datetime that is <code>days</code> days after the <code>value</code>. For negative values of <code>days</code>, it returns a datetime that is <code>days</code> days before <code>value</code>.<br />
<br />
==addHours==<br />
:Syntax<br />
::<code>addHours(''datetime'' value, ''integer'' hours)</code><br />
:Returns<br />
::Returns a datetime that is <code>hours</code> hours after the <code>value</code>. For negative values of <code>hours</code>, it returns a datetime that is <code>hours</code> hours before <code>value</code>.<br />
<br />
==addMinutes==<br />
:Syntax<br />
::<code>addMinutes(''datetime'' value, ''integer'' minutes)</code><br />
:Returns<br />
::Returns a datetime that is <code>minutes</code> minutes after the <code>value</code>. For negative values of <code>minutes</code>, it returns a datetime that is <code>minutes</code> minutes before <code>value</code>.<br />
<br />
==addSeconds==<br />
:Syntax<br />
::<code>addSeconds(''datetime'' value, ''integer'' seconds)</code><br />
:Returns<br />
::Returns a datetime that is <code>seconds</code> seconds after the <code>value</code>. For negative values of <code>seconds</code>, it returns a datetime that is <code>seconds</code> seconds before <code>value</code>.<br />
<br />
==addWeeks==<br />
:Syntax<br />
::<code>addWeeks(''datetime'' value, ''integer'' weeks)</code><br />
:Returns<br />
::Returns a datetime that is <code>weeks</code> weeks after the <code>value</code>. For negative values of <code>weeks</code>, it returns a datetime that is <code>weeks</code> weeks before <code>value</code>.<br />
<br />
==date==<br />
:Syntax<br />
::<code>date(''datetime'' value)</code><br />
:Returns<br />
::Returns the date portion of <code>value</code> by stripping off time information.<br />
<br />
==datetime==<br />
:Syntax<br />
::<code>''datetime'' datetime(''dynamic'' value)</code><br />
:Returns<br />
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.<br />
<br />
<br />
==formatDuration==<br />
:Syntax<br />
::<code>''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])</code><br />
:Arguments<br />
::<code>friendly</code> - <code>false</code> makes the output compact, in the form of <code>0d 00:00:00.000</code>, while <code>true</code> makes the output more human friendly, in the form of <code> 0 days, 0 hours, 0 minutes, and 0 seconds</code>. Defaults to <code>false</code>.<br />
::<code>granularity</code> - represents the smallest time unit to be output. One of <code>d</code> for days, <code>h</code> for hours, <code>m</code> for minutes, <code>s</code> for seconds, or <code>ms</code> for milliseconds. Any time unit below the selected granularity will not be output. Defaults to <code>s</code><br />
::<code>showAdverbs</code> - only affects the friendly output, when <code>true</code> the words <code>in</code> (for future durations - positive input) or <code>ago</code> (for past durations - negative input) are prepended or appended respectively to the output<br />
:Returns<br />
::Returns a string that represents the duration in a human readable format<br />
:Examples<br />
::<code>formatDuration(12029)</code> will output <code>00:00:12</code><br />
::<code>formatDuration(68493, true)</code> will output <code>1 minute and 8 seconds</code><br />
::<code>formatDuration(68493, false, 'ms')</code> will output <code>00:01:08</code><br />
::<code>formatDuration(68493, true, 'm', true)</code> will output <code>in 1 minute</code><br />
<br />
==formatDateTime==<br />
:Syntax<br />
:Arguments<br />
:Examples<br />
:Reference - https://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html<br />
<br />
==time==<br />
:Syntax<br />
::<code>''time'' time(''datetime'' value)</code><br />
:Returns<br />
::Returns the time portion of <code>value</code> by stripping off date information.<br />
<br />
=Weather related functions=<br />
<br />
==celsius==<br />
:Syntax<br />
::<code>''decimal'' celsius(''decimal'' value)</code><br />
:Returns<br />
::Converts a temperature value from Fahrenheit to Celsius.<br />
<br />
==dewPoint==<br />
:Syntax<br />
::<code>''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])</code><br />
:Parameters<br />
::<code>scale</code> - optional, one of <code>C</code> or <code>F</code>, corresponding to the temperature range used for <code>temperature</code>. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.<br />
:Returns<br />
::Returns the due temperature for a given temperature and relative humidity<br />
<br />
==fahrenheit==<br />
:Syntax<br />
::<code>''decimal'' fahrenheit(''decimal'' value)</code><br />
:Returns<br />
::Converts a temperature value from Celsius to Fahrenheit.<br />
<br />
<br />
<br />
= [[Variable_data_types#Dynamic|Dynamic]] =<br />
;if(condition, valueIfTrue, valueIfFalse)<br />
:evaluates a boolean and returns value1 if true, or value2 otherwise<br />
;least(values)<br />
:returns the value that is least found a series of numeric values<br />
;most(values)<br />
:returns the value that is most found a series of numeric values<br />
;previousValue([device;attribute])<br />
:returns the previous value of the attribute<br />
<br />
= [[Variable_data_types#Number_.28Integer.29|Integers]] =<br />
;age([device﹕attribute])<br />
:returns the number of milliseconds an attribute had the current value<br />
;count(values)<br />
:calculates the number of true/non-zero/non-empty items in a series of numeric values<br />
;int()<br />
://todo<br />
;integer(decimal or string)<br />
:converts a decimal value to it's integer value<br />
;newer([device﹕attribute],[...], [device﹕attribute], threshold)<br />
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds<br />
;older([device﹕attribute],[...], [device﹕attribute], threshold)<br />
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds<br />
;previousAge([device﹕attribute])<br />
:returns the number of milliseconds that have elapsed since an attribute changed to the previous value. If there is no previous value recorded returns <code>604800000</code>, which corresponds to 7 days.<br />
:Use <code>previousAge([device﹕attribute]) - age([device﹕attribute])</code> to determine the length of time that the device attribute had the previous value.<br />
<br />
= [[Variable_data_types#Time|Time]] =<br />
;time(value)<br />
:returns the value as a time type<br />
;addSeconds(dateTime, seconds)<br />
:adds seconds to time, returns the value as a time type<br />
;addMinutes(dateTime, minutes)<br />
:adds minutes to time, returns the value as a time type<br />
;addHours(dateTime, hours)<br />
:adds hours to time, returns the value as a time type<br />
;addDays(dateTime, days)<br />
:adds days to time, returns the value as a time type<br />
;addWeeks(dateTime, weeks)<br />
:adds weeks to time, returns the value as a time type</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Piston_State&diff=819Piston State2018-08-11T00:05:19Z<p>Ipaterson: Added missing text format options and link to icons</p>
<hr />
<div>Piston States can be used to show a brief overview of what is happening in a piston <br />
<br />
<br />
e.g. [[File:piston_State_Example.png]]<br />
<br />
<br />
To enable this feature you need to disable automatic piston state in the piston settings option. This can be found by clicking the name of your piston in the edit screen<br />
<br />
[[File:disablestate.png]]<br />
<br />
<br />
<br />
You can then set the piston state by adding the task below<br />
<br />
[[File:setstate.png]]<br />
<br />
<br />
The displayed text can be formatted using the following<br />
<br />
<br />
[class | text]<br />
<br />
<br />
The text is separated from the class using a pipe character | . The class is a comma or space separated list of the following<br />
<br />
* b >>> bold text<br />
* i >>> italic text<br />
* u >>> underlined text<br />
* s >>> strikethrough<br />
* blink >>> quick fade between visible and invisible<br />
* left center right >>> text alignment (via CSS float)<br />
* 0.5x 2x >>> font size as a multiple of the base font size<br />
* pre >>> preformatted text (allows multiple blank characters used for alignment)<br />
* mono >>> monospace text (all characters the same width for alignment, often used with pre)<br />
* #XXXXXX >>> hex colour<br />
* colourname >>> a css colour name e.g. red, orange, blue, violet, lime. A list of CSS colours can be found [https://www.w3schools.com/cssref/css_colors.asp here]<br />
* bg-#XXXXXX bg-colourname >>> background color<br />
<br />
Use [[Font Awesome|Font Awesome icons]] to add even more visual flair and function.<br />
<br />
<br />
'''Example 1:'''<br />
<br />
<br />
[[File:Piston_state_bold.png]]<br />
<br />
<br />
would give<br />
<br />
[[File:bold.png]]<br />
<br />
<br />
'''Example 2:'''<br />
<br />
<br />
[[File:red_underlined.png]]<br />
<br />
<br />
would give<br />
<br />
[[File:red_underlined3.png]]<br />
<br />
<br />
'''Example 3'''<br />
<br />
<br />
[[File:varyesterday.png]]<br />
<br />
<br />
would give<br />
<br />
<br />
[[File:variablestate.png]]</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Font_Awesome&diff=818Font Awesome2018-08-10T02:04:01Z<p>Ipaterson: /* Usage */ Clarified that icons render only in the dashboard and not in third-party software</p>
<hr />
<div><div style="float: left; clear: both; margin-right: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
== Thousands of icons ==<br />
<br />
Use this [https://fontawesome.com/icons searchable list] to find over 3000 icons supported by webCoRE. All of the icons, Free and Pro, can be used in your pistons.<br />
<br />
== Try it out ==<br />
<br />
The instructions and examples below can all be used in the Evaluation Console on any of your pistons. Just type in the icon markup as a Value and press enter to see the rendered icon. It's a quick way to experiment with icons before adding them to a piston.<br />
<br />
== Usage ==<br />
<br />
Font Awesome icons can be added to values and expressions throughout your piston, particularly useful for enriching your [[Device Tiles]] and [[Piston State]]. Font Awesome icons will not work in text displayed outside of the dashboard such as in emails, push notifications, and SMS messages.<br />
<br />
The following simple markup will be displayed as an icon:<br />
<br />
<blockquote><i class="fas fa-battery-half"></i> <code>:fas fa-battery-half:</code><br />
</blockquote><br />
Simply find the name of an icon you want to use and choose the best style<br />
<br />
* <code>fas</code> Bold, solid icons<br />
** <i class="fas fa-lock fa-lg fa-fw"></i> <i class="fas fa-bolt fa-lg fa-fw"></i> <i class="fas fa-car fa-lg fa-fw"></i><br />
* <code>far</code> Medium weight solid or outlined icons<br />
** <i class="far fa-lock fa-lg fa-fw"></i> <i class="far fa-bolt fa-lg fa-fw"></i> <i class="far fa-car fa-lg fa-fw"></i><br />
* <code>fal</code> Light, outlined icons<br />
** <i class="fal fa-lock fa-lg fa-fw"></i> <i class="fal fa-bolt fa-lg fa-fw"></i> <i class="fal fa-car fa-lg fa-fw"></i><br />
* <code>fab</code> Brand logos<br />
** <i class="fab fa-apple fa-lg fa-fw"></i> <i class="fab fa-android fa-lg fa-fw"></i> <i class="fab fa-windows fa-lg fa-fw"></i><br />
<br />
Icons can be used alongside other text in expressions and values.<br />
<br />
<blockquote><code>Welcome home :far fa-grin-hearts:!</code> Welcome home <i class="far fa-grin-hearts fa-lg"></i>!<br />
</blockquote><br />
=== Icon modifiers ===<br />
<br />
You may notice that the icon markup looks very similar to the way icons are used in the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation], <code>class=&quot;fas fa-battery-half&quot;</code>. In fact, this webCoRE markup maps to the <code>class</code> attribute so any modifiers in the Font Awesome documentation can be replicated.<br />
<br />
==== Sizing icons ====<br />
<br />
The size of Font Awesome icons can be adjusted, [https://fontawesome.com/how-to-use/on-the-web/styling/sizing-icons see all sizes here]. All sizes are relative to the surrounding text so the size of a <code>fa-3x</code> icon in the evaluation console may not exactly match the size of a <code>fa-3x</code> icon in a tile.<br />
<br />
<blockquote><i class="fas fa-clock"></i> <code>:fas fa-clock:</code><br />
<br />
<i class="fas fa-clock fa-xs"></i> <code>:fas fa-clock fa-xs:</code><br />
<br />
<i class="fas fa-clock fa-2x"></i> <code>:fas fa-clock fa-2x:</code><br />
<br />
<i class="fas fa-clock fa-4x"></i> <code>:fas fa-clock fa-4x:</code><br />
</blockquote><br />
==== Rotating icons ====<br />
<br />
If you need an icon to face a different direction, use [https://fontawesome.com/how-to-use/on-the-web/styling/rotating-icons a rotation].<br />
<br />
<blockquote><i class="fal fa-bicycle fa-lg fa-fw"></i> <code>:fal fa-bicycle:</code><br />
<br />
<i class="fal fa-bicycle fa-rotate-180 fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-rotate-180:</code><br />
<br />
<i class="fal fa-bicycle fa-flip-vertical fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-flip-vertical:</code><br />
</blockquote><br />
==== Animating icons ====<br />
<br />
Icons can spin, [https://fontawesome.com/how-to-use/on-the-web/styling/animating-icons learn more here].<br />
<br />
<blockquote><i class="fas fa-circle-notch fa-spin fa-lg fa-fw"></i> <code>:fas fa-circle-notch fa-spin:</code><br />
</blockquote><br />
==== Power transforms ====<br />
<br />
While Font Awesome provides a handful of sizing options from <code>fa-xs</code> to <code>fa-10x</code> and rotations like <code>fa-rotate-90</code>, in some cases it is useful to have more granular control over icon size and position.<br />
<br />
Note that unlike the sizing options, power transforms like this one <i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10" style="opacity: .5"></i> do not affect the flow of text around icons. The transform is a sort of &quot;after effect&quot; that changes how the icon is displayed. To use power transforms in webCoRE, simply add the transform markup to the icon.<br />
<br />
<blockquote><i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10"></i> <code>:fas fa-exclamation data-fa-transform=&quot;grow-20 rotate-10&quot;:</code><br />
</blockquote><br />
See the [https://fontawesome.com/how-to-use/on-the-web/styling/power-transforms documentation and examples] to learn more about scaling, positioning, rotating, and flipping with power transforms. Power transforms are also used extensively in the Combining Icons section.<br />
<br />
=== Combining icons ===<br />
<br />
Font Awesome provides very powerful tools for mixing icons together, in webCoRE we use a different type of markup for these icon containers. <code>[modifiers|content]</code> format allows you to create a container element around the content with the specified modifiers on that container.<br />
<br />
Follow the features described below to build complex and dynamic icons like this calendar that could show the day of the month and number of alerts today:<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">27</span><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
27<br />
]<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Stacked icons ====<br />
<br />
Combine two icons stacked with center alignment. The order of the icons matters; the first icon specified will be layered behind the second. [https://fontawesome.com/how-to-use/on-the-web/styling/stacking-icons Learn more here]<br />
<br />
<blockquote><i class="fab fa-reddit-alien fa-lg"></i> <code>:fab fa-reddit-alien:</code><br />
<br />
<i class="fas fa-certificate fa-lg"></i> <code>:fas fa-certificate:</code><br />
<br />
<span class="fa-stack fa-lg"><i class="fas fa-certificate fa-stack-2x"></i><i class="fab fa-reddit-alien fa-inverse fa-stack-1x"></i></span><br />
<pre>[fa-stack fa-lg|<br />
:fas fa-certificate fa-stack-2x:<br />
:fab fa-reddit-alien fa-inverse fa-stack-1x:<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE markup for colors for more distinct icons:<br />
<br />
<blockquote><i class="fas fa-swimmer fa-lg"></i> <code>:fas fa-swimmer:</code><br />
<br />
<i class="far fa-ban fa-lg"></i> <code>:far fa-ban:</code><br />
<br />
<span class="fa-stack fa-2x"><i class="fas fa-swimmer fa-stack-1x"></i><i class="far fa-ban fa-stack-2x" style="color: red"></i></span><br />
<pre>[fa-stack fa-2x|<br />
:fas fa-swimmer fa-stack-1x:<br />
[color-red|:far fa-ban fa-stack-2x:]<br />
]<br />
</pre><br />
</blockquote><br />
==== Layered icons ====<br />
<br />
Layering is similar to stacking but with full control over the positioning and number of icons. Font Awesome provides [https://fontawesome.com/how-to-use/on-the-web/styling/layering many good examples].<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-play" data-fa-transform="rotate--90 grow-2"></i><i class="fas fa-sun fa-inverse" data-fa-transform="shrink-10 up-2"></i><i class="fas fa-moon fa-inverse" data-fa-transform="shrink-11 down-4.2 left-4"></i><i class="fas fa-star fa-inverse" data-fa-transform="shrink-11 down-4.2 right-3"></i></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-play data-fa-transform=&quot;rotate--90 grow-2&quot;:<br />
:fas fa-sun fa-inverse data-fa-transform=&quot;shrink-10 up-2&quot;:<br />
:fas fa-moon fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 left-4&quot;:<br />
:fas fa-star fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 right-3&quot;:<br />
]<br />
</pre><br />
</blockquote><br />
==== Badges over icons ====<br />
<br />
Layered icons also provide a convenient mechanism for showing a counter or badge in the upper right corner of an icon.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-exclamation-triangle"></i><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-exclamation-triangle:<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE background color to change the badge color.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="far fa-comment"></i><span class="fa-layers-counter" style="background-color: royalblue">15</span></span><br />
<pre>[fa-layers fa-3x|<br />
:far fa-comment:<br />
[fa-layers-counter bg-royalblue|<br />
15<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Custom text over icons ====<br />
<br />
Apply transforms to custom text<br />
<br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-certificate"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-11.5 rotate--30" style="font-weight:bold">NEW</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-certificate:<br />
[fa-layers-text fa-inverse b data-fa-transform=&quot;shrink-11.5 rotate--30&quot;|<br />
NEW<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">12</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
12<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
=== Other supported features ===<br />
<br />
Please refer to the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation] for additional features and examples. Use masking to &quot;cut out&quot; one icon from another, add borders, and use a fixed width for consistent alignment.<br />
<br />
=== Unsupported features ===<br />
<br />
webCoRE expressions do not support [https://fontawesome.com/how-to-use/on-the-web/styling/icons-in-a-list Icons in a list] since it requires the <code>ul</code> and <code>li</code> elements, but you can achieve the same visual effect with fixed-width icons on multiple lines.<br />
<br />
== Font Awesome 4 Deprecated ==<br />
<br />
Pistons that used icons from the previous version of Font Awesome will continue to work, though the icons may appear slightly different in Font Awesome 5. Please discontinue use of the <code>:fa fa-lock:</code> and shorthand <code>:fa-lock:</code> markup in favor of the Font Awesome 5 styles and icon names.<br />
<br />
The dashboard uses a shim published by the Font Awesome team that maps v4 icons to v5.<br />
<br />
== Font Awesome Pro license ==<br />
<br />
The dashboard and other official webcore.co sites are authorized to use our Font Awesome 5 Pro license. If you choose to run an independent copy of the webCoRE dashboard, only a limited set of Font Awesome icons will be available. Missing icons will be indicated by a placeholder:<br />
<br />
<i class="far fa-missing-icon fa-lg"></i><br />
<br />
When Font Awesome Pro cannot be loaded the dashboard will modify all icons embedded in the UI to work with the free version of Font Awesome 5. Icons specified in pistons are not modified so Font Awesome 5 Pro will not work without a Pro license. If you have purchased a Font Awesome Pro license, simply add your dashboard domain to the whitelist on your license to enable Pro icons – no code changes are required.<br />
<br />
Font Awesome Pro icons will load when the dashboard is run from localhost.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Font_Awesome&diff=817Font Awesome2018-08-07T18:59:23Z<p>Ipaterson: /* Power transforms */ Fixed missing colon in example expression</p>
<hr />
<div><div style="float: left; clear: both; margin-right: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
== Thousands of icons ==<br />
<br />
Use this [https://fontawesome.com/icons searchable list] to find over 3000 icons supported by webCoRE. All of the icons, Free and Pro, can be used in your pistons.<br />
<br />
== Try it out ==<br />
<br />
The instructions and examples below can all be used in the Evaluation Console on any of your pistons. Just type in the icon markup as a Value and press enter to see the rendered icon. It's a quick way to experiment with icons before adding them to a piston.<br />
<br />
== Usage ==<br />
<br />
Font Awesome icons can be added to values and expressions throughout your piston, particularly useful for enriching your [[Device Tiles]] and [[Piston State]].<br />
<br />
The following simple markup will be displayed as an icon:<br />
<br />
<blockquote><i class="fas fa-battery-half"></i> <code>:fas fa-battery-half:</code><br />
</blockquote><br />
Simply find the name of an icon you want to use and choose the best style<br />
<br />
* <code>fas</code> Bold, solid icons<br />
** <i class="fas fa-lock fa-lg fa-fw"></i> <i class="fas fa-bolt fa-lg fa-fw"></i> <i class="fas fa-car fa-lg fa-fw"></i><br />
* <code>far</code> Medium weight solid or outlined icons<br />
** <i class="far fa-lock fa-lg fa-fw"></i> <i class="far fa-bolt fa-lg fa-fw"></i> <i class="far fa-car fa-lg fa-fw"></i><br />
* <code>fal</code> Light, outlined icons<br />
** <i class="fal fa-lock fa-lg fa-fw"></i> <i class="fal fa-bolt fa-lg fa-fw"></i> <i class="fal fa-car fa-lg fa-fw"></i><br />
* <code>fab</code> Brand logos<br />
** <i class="fab fa-apple fa-lg fa-fw"></i> <i class="fab fa-android fa-lg fa-fw"></i> <i class="fab fa-windows fa-lg fa-fw"></i><br />
<br />
Icons can be used alongside other text in expressions and values.<br />
<br />
<blockquote><code>Welcome home :far fa-grin-hearts:!</code> Welcome home <i class="far fa-grin-hearts fa-lg"></i>!<br />
</blockquote><br />
=== Icon modifiers ===<br />
<br />
You may notice that the icon markup looks very similar to the way icons are used in the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation], <code>class=&quot;fas fa-battery-half&quot;</code>. In fact, this webCoRE markup maps to the <code>class</code> attribute so any modifiers in the Font Awesome documentation can be replicated.<br />
<br />
==== Sizing icons ====<br />
<br />
The size of Font Awesome icons can be adjusted, [https://fontawesome.com/how-to-use/on-the-web/styling/sizing-icons see all sizes here]. All sizes are relative to the surrounding text so the size of a <code>fa-3x</code> icon in the evaluation console may not exactly match the size of a <code>fa-3x</code> icon in a tile.<br />
<br />
<blockquote><i class="fas fa-clock"></i> <code>:fas fa-clock:</code><br />
<br />
<i class="fas fa-clock fa-xs"></i> <code>:fas fa-clock fa-xs:</code><br />
<br />
<i class="fas fa-clock fa-2x"></i> <code>:fas fa-clock fa-2x:</code><br />
<br />
<i class="fas fa-clock fa-4x"></i> <code>:fas fa-clock fa-4x:</code><br />
</blockquote><br />
==== Rotating icons ====<br />
<br />
If you need an icon to face a different direction, use [https://fontawesome.com/how-to-use/on-the-web/styling/rotating-icons a rotation].<br />
<br />
<blockquote><i class="fal fa-bicycle fa-lg fa-fw"></i> <code>:fal fa-bicycle:</code><br />
<br />
<i class="fal fa-bicycle fa-rotate-180 fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-rotate-180:</code><br />
<br />
<i class="fal fa-bicycle fa-flip-vertical fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-flip-vertical:</code><br />
</blockquote><br />
==== Animating icons ====<br />
<br />
Icons can spin, [https://fontawesome.com/how-to-use/on-the-web/styling/animating-icons learn more here].<br />
<br />
<blockquote><i class="fas fa-circle-notch fa-spin fa-lg fa-fw"></i> <code>:fas fa-circle-notch fa-spin:</code><br />
</blockquote><br />
==== Power transforms ====<br />
<br />
While Font Awesome provides a handful of sizing options from <code>fa-xs</code> to <code>fa-10x</code> and rotations like <code>fa-rotate-90</code>, in some cases it is useful to have more granular control over icon size and position.<br />
<br />
Note that unlike the sizing options, power transforms like this one <i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10" style="opacity: .5"></i> do not affect the flow of text around icons. The transform is a sort of &quot;after effect&quot; that changes how the icon is displayed. To use power transforms in webCoRE, simply add the transform markup to the icon.<br />
<br />
<blockquote><i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10"></i> <code>:fas fa-exclamation data-fa-transform=&quot;grow-20 rotate-10&quot;:</code><br />
</blockquote><br />
See the [https://fontawesome.com/how-to-use/on-the-web/styling/power-transforms documentation and examples] to learn more about scaling, positioning, rotating, and flipping with power transforms. Power transforms are also used extensively in the Combining Icons section.<br />
<br />
=== Combining icons ===<br />
<br />
Font Awesome provides very powerful tools for mixing icons together, in webCoRE we use a different type of markup for these icon containers. <code>[modifiers|content]</code> format allows you to create a container element around the content with the specified modifiers on that container.<br />
<br />
Follow the features described below to build complex and dynamic icons like this calendar that could show the day of the month and number of alerts today:<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">27</span><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
27<br />
]<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Stacked icons ====<br />
<br />
Combine two icons stacked with center alignment. The order of the icons matters; the first icon specified will be layered behind the second. [https://fontawesome.com/how-to-use/on-the-web/styling/stacking-icons Learn more here]<br />
<br />
<blockquote><i class="fab fa-reddit-alien fa-lg"></i> <code>:fab fa-reddit-alien:</code><br />
<br />
<i class="fas fa-certificate fa-lg"></i> <code>:fas fa-certificate:</code><br />
<br />
<span class="fa-stack fa-lg"><i class="fas fa-certificate fa-stack-2x"></i><i class="fab fa-reddit-alien fa-inverse fa-stack-1x"></i></span><br />
<pre>[fa-stack fa-lg|<br />
:fas fa-certificate fa-stack-2x:<br />
:fab fa-reddit-alien fa-inverse fa-stack-1x:<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE markup for colors for more distinct icons:<br />
<br />
<blockquote><i class="fas fa-swimmer fa-lg"></i> <code>:fas fa-swimmer:</code><br />
<br />
<i class="far fa-ban fa-lg"></i> <code>:far fa-ban:</code><br />
<br />
<span class="fa-stack fa-2x"><i class="fas fa-swimmer fa-stack-1x"></i><i class="far fa-ban fa-stack-2x" style="color: red"></i></span><br />
<pre>[fa-stack fa-2x|<br />
:fas fa-swimmer fa-stack-1x:<br />
[color-red|:far fa-ban fa-stack-2x:]<br />
]<br />
</pre><br />
</blockquote><br />
==== Layered icons ====<br />
<br />
Layering is similar to stacking but with full control over the positioning and number of icons. Font Awesome provides [https://fontawesome.com/how-to-use/on-the-web/styling/layering many good examples].<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-play" data-fa-transform="rotate--90 grow-2"></i><i class="fas fa-sun fa-inverse" data-fa-transform="shrink-10 up-2"></i><i class="fas fa-moon fa-inverse" data-fa-transform="shrink-11 down-4.2 left-4"></i><i class="fas fa-star fa-inverse" data-fa-transform="shrink-11 down-4.2 right-3"></i></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-play data-fa-transform=&quot;rotate--90 grow-2&quot;:<br />
:fas fa-sun fa-inverse data-fa-transform=&quot;shrink-10 up-2&quot;:<br />
:fas fa-moon fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 left-4&quot;:<br />
:fas fa-star fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 right-3&quot;:<br />
]<br />
</pre><br />
</blockquote><br />
==== Badges over icons ====<br />
<br />
Layered icons also provide a convenient mechanism for showing a counter or badge in the upper right corner of an icon.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-exclamation-triangle"></i><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-exclamation-triangle:<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE background color to change the badge color.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="far fa-comment"></i><span class="fa-layers-counter" style="background-color: royalblue">15</span></span><br />
<pre>[fa-layers fa-3x|<br />
:far fa-comment:<br />
[fa-layers-counter bg-royalblue|<br />
15<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Custom text over icons ====<br />
<br />
Apply transforms to custom text<br />
<br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-certificate"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-11.5 rotate--30" style="font-weight:bold">NEW</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-certificate:<br />
[fa-layers-text fa-inverse b data-fa-transform=&quot;shrink-11.5 rotate--30&quot;|<br />
NEW<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">12</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
12<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
=== Other supported features ===<br />
<br />
Please refer to the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation] for additional features and examples. Use masking to &quot;cut out&quot; one icon from another, add borders, and use a fixed width for consistent alignment.<br />
<br />
=== Unsupported features ===<br />
<br />
webCoRE expressions do not support [https://fontawesome.com/how-to-use/on-the-web/styling/icons-in-a-list Icons in a list] since it requires the <code>ul</code> and <code>li</code> elements, but you can achieve the same visual effect with fixed-width icons on multiple lines.<br />
<br />
== Font Awesome 4 Deprecated ==<br />
<br />
Pistons that used icons from the previous version of Font Awesome will continue to work, though the icons may appear slightly different in Font Awesome 5. Please discontinue use of the <code>:fa fa-lock:</code> and shorthand <code>:fa-lock:</code> markup in favor of the Font Awesome 5 styles and icon names.<br />
<br />
The dashboard uses a shim published by the Font Awesome team that maps v4 icons to v5.<br />
<br />
== Font Awesome Pro license ==<br />
<br />
The dashboard and other official webcore.co sites are authorized to use our Font Awesome 5 Pro license. If you choose to run an independent copy of the webCoRE dashboard, only a limited set of Font Awesome icons will be available. Missing icons will be indicated by a placeholder:<br />
<br />
<i class="far fa-missing-icon fa-lg"></i><br />
<br />
When Font Awesome Pro cannot be loaded the dashboard will modify all icons embedded in the UI to work with the free version of Font Awesome 5. Icons specified in pistons are not modified so Font Awesome 5 Pro will not work without a Pro license. If you have purchased a Font Awesome Pro license, simply add your dashboard domain to the whitelist on your license to enable Pro icons – no code changes are required.<br />
<br />
Font Awesome Pro icons will load when the dashboard is run from localhost.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Font_Awesome&diff=816Font Awesome2018-07-07T19:14:47Z<p>Ipaterson: Floating TOC</p>
<hr />
<div><div style="float: left; clear: both; margin-right: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
== Thousands of icons ==<br />
<br />
Use this [https://fontawesome.com/icons searchable list] to find over 3000 icons supported by webCoRE. All of the icons, Free and Pro, can be used in your pistons.<br />
<br />
== Try it out ==<br />
<br />
The instructions and examples below can all be used in the Evaluation Console on any of your pistons. Just type in the icon markup as a Value and press enter to see the rendered icon. It's a quick way to experiment with icons before adding them to a piston.<br />
<br />
== Usage ==<br />
<br />
Font Awesome icons can be added to values and expressions throughout your piston, particularly useful for enriching your [[Device Tiles]] and [[Piston State]].<br />
<br />
The following simple markup will be displayed as an icon:<br />
<br />
<blockquote><i class="fas fa-battery-half"></i> <code>:fas fa-battery-half:</code><br />
</blockquote><br />
Simply find the name of an icon you want to use and choose the best style<br />
<br />
* <code>fas</code> Bold, solid icons<br />
** <i class="fas fa-lock fa-lg fa-fw"></i> <i class="fas fa-bolt fa-lg fa-fw"></i> <i class="fas fa-car fa-lg fa-fw"></i><br />
* <code>far</code> Medium weight solid or outlined icons<br />
** <i class="far fa-lock fa-lg fa-fw"></i> <i class="far fa-bolt fa-lg fa-fw"></i> <i class="far fa-car fa-lg fa-fw"></i><br />
* <code>fal</code> Light, outlined icons<br />
** <i class="fal fa-lock fa-lg fa-fw"></i> <i class="fal fa-bolt fa-lg fa-fw"></i> <i class="fal fa-car fa-lg fa-fw"></i><br />
* <code>fab</code> Brand logos<br />
** <i class="fab fa-apple fa-lg fa-fw"></i> <i class="fab fa-android fa-lg fa-fw"></i> <i class="fab fa-windows fa-lg fa-fw"></i><br />
<br />
Icons can be used alongside other text in expressions and values.<br />
<br />
<blockquote><code>Welcome home :far fa-grin-hearts:!</code> Welcome home <i class="far fa-grin-hearts fa-lg"></i>!<br />
</blockquote><br />
=== Icon modifiers ===<br />
<br />
You may notice that the icon markup looks very similar to the way icons are used in the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation], <code>class=&quot;fas fa-battery-half&quot;</code>. In fact, this webCoRE markup maps to the <code>class</code> attribute so any modifiers in the Font Awesome documentation can be replicated.<br />
<br />
==== Sizing icons ====<br />
<br />
The size of Font Awesome icons can be adjusted, [https://fontawesome.com/how-to-use/on-the-web/styling/sizing-icons see all sizes here]. All sizes are relative to the surrounding text so the size of a <code>fa-3x</code> icon in the evaluation console may not exactly match the size of a <code>fa-3x</code> icon in a tile.<br />
<br />
<blockquote><i class="fas fa-clock"></i> <code>:fas fa-clock:</code><br />
<br />
<i class="fas fa-clock fa-xs"></i> <code>:fas fa-clock fa-xs:</code><br />
<br />
<i class="fas fa-clock fa-2x"></i> <code>:fas fa-clock fa-2x:</code><br />
<br />
<i class="fas fa-clock fa-4x"></i> <code>:fas fa-clock fa-4x:</code><br />
</blockquote><br />
==== Rotating icons ====<br />
<br />
If you need an icon to face a different direction, use [https://fontawesome.com/how-to-use/on-the-web/styling/rotating-icons a rotation].<br />
<br />
<blockquote><i class="fal fa-bicycle fa-lg fa-fw"></i> <code>:fal fa-bicycle:</code><br />
<br />
<i class="fal fa-bicycle fa-rotate-180 fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-rotate-180:</code><br />
<br />
<i class="fal fa-bicycle fa-flip-vertical fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-flip-vertical:</code><br />
</blockquote><br />
==== Animating icons ====<br />
<br />
Icons can spin, [https://fontawesome.com/how-to-use/on-the-web/styling/animating-icons learn more here].<br />
<br />
<blockquote><i class="fas fa-circle-notch fa-spin fa-lg fa-fw"></i> <code>:fas fa-circle-notch fa-spin:</code><br />
</blockquote><br />
==== Power transforms ====<br />
<br />
While Font Awesome provides a handful of sizing options from <code>fa-xs</code> to <code>fa-10x</code> and rotations like <code>fa-rotate-90</code>, in some cases it is useful to have more granular control over icon size and position.<br />
<br />
Note that unlike the sizing options, power transforms like this one <i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10" style="opacity: .5"></i> do not affect the flow of text around icons. The transform is a sort of &quot;after effect&quot; that changes how the icon is displayed. To use power transforms in webCoRE, simply add the transform markup to the icon.<br />
<br />
<blockquote><i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10"></i> <code>:fas fa-exclamation data-fa-transform=&quot;grow-20 rotate-10&quot;</code><br />
</blockquote><br />
See the [https://fontawesome.com/how-to-use/on-the-web/styling/power-transforms documentation and examples] to learn more about scaling, positioning, rotating, and flipping with power transforms. Power transforms are also used extensively in the Combining Icons section.<br />
<br />
=== Combining icons ===<br />
<br />
Font Awesome provides very powerful tools for mixing icons together, in webCoRE we use a different type of markup for these icon containers. <code>[modifiers|content]</code> format allows you to create a container element around the content with the specified modifiers on that container.<br />
<br />
Follow the features described below to build complex and dynamic icons like this calendar that could show the day of the month and number of alerts today:<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">27</span><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
27<br />
]<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Stacked icons ====<br />
<br />
Combine two icons stacked with center alignment. The order of the icons matters; the first icon specified will be layered behind the second. [https://fontawesome.com/how-to-use/on-the-web/styling/stacking-icons Learn more here]<br />
<br />
<blockquote><i class="fab fa-reddit-alien fa-lg"></i> <code>:fab fa-reddit-alien:</code><br />
<br />
<i class="fas fa-certificate fa-lg"></i> <code>:fas fa-certificate:</code><br />
<br />
<span class="fa-stack fa-lg"><i class="fas fa-certificate fa-stack-2x"></i><i class="fab fa-reddit-alien fa-inverse fa-stack-1x"></i></span><br />
<pre>[fa-stack fa-lg|<br />
:fas fa-certificate fa-stack-2x:<br />
:fab fa-reddit-alien fa-inverse fa-stack-1x:<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE markup for colors for more distinct icons:<br />
<br />
<blockquote><i class="fas fa-swimmer fa-lg"></i> <code>:fas fa-swimmer:</code><br />
<br />
<i class="far fa-ban fa-lg"></i> <code>:far fa-ban:</code><br />
<br />
<span class="fa-stack fa-2x"><i class="fas fa-swimmer fa-stack-1x"></i><i class="far fa-ban fa-stack-2x" style="color: red"></i></span><br />
<pre>[fa-stack fa-2x|<br />
:fas fa-swimmer fa-stack-1x:<br />
[color-red|:far fa-ban fa-stack-2x:]<br />
]<br />
</pre><br />
</blockquote><br />
==== Layered icons ====<br />
<br />
Layering is similar to stacking but with full control over the positioning and number of icons. Font Awesome provides [https://fontawesome.com/how-to-use/on-the-web/styling/layering many good examples].<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-play" data-fa-transform="rotate--90 grow-2"></i><i class="fas fa-sun fa-inverse" data-fa-transform="shrink-10 up-2"></i><i class="fas fa-moon fa-inverse" data-fa-transform="shrink-11 down-4.2 left-4"></i><i class="fas fa-star fa-inverse" data-fa-transform="shrink-11 down-4.2 right-3"></i></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-play data-fa-transform=&quot;rotate--90 grow-2&quot;:<br />
:fas fa-sun fa-inverse data-fa-transform=&quot;shrink-10 up-2&quot;:<br />
:fas fa-moon fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 left-4&quot;:<br />
:fas fa-star fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 right-3&quot;:<br />
]<br />
</pre><br />
</blockquote><br />
==== Badges over icons ====<br />
<br />
Layered icons also provide a convenient mechanism for showing a counter or badge in the upper right corner of an icon.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-exclamation-triangle"></i><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-exclamation-triangle:<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE background color to change the badge color.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="far fa-comment"></i><span class="fa-layers-counter" style="background-color: royalblue">15</span></span><br />
<pre>[fa-layers fa-3x|<br />
:far fa-comment:<br />
[fa-layers-counter bg-royalblue|<br />
15<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Custom text over icons ====<br />
<br />
Apply transforms to custom text<br />
<br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-certificate"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-11.5 rotate--30" style="font-weight:bold">NEW</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-certificate:<br />
[fa-layers-text fa-inverse b data-fa-transform=&quot;shrink-11.5 rotate--30&quot;|<br />
NEW<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">12</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
12<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
=== Other supported features ===<br />
<br />
Please refer to the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation] for additional features and examples. Use masking to &quot;cut out&quot; one icon from another, add borders, and use a fixed width for consistent alignment.<br />
<br />
=== Unsupported features ===<br />
<br />
webCoRE expressions do not support [https://fontawesome.com/how-to-use/on-the-web/styling/icons-in-a-list Icons in a list] since it requires the <code>ul</code> and <code>li</code> elements, but you can achieve the same visual effect with fixed-width icons on multiple lines.<br />
<br />
== Font Awesome 4 Deprecated ==<br />
<br />
Pistons that used icons from the previous version of Font Awesome will continue to work, though the icons may appear slightly different in Font Awesome 5. Please discontinue use of the <code>:fa fa-lock:</code> and shorthand <code>:fa-lock:</code> markup in favor of the Font Awesome 5 styles and icon names.<br />
<br />
The dashboard uses a shim published by the Font Awesome team that maps v4 icons to v5.<br />
<br />
== Font Awesome Pro license ==<br />
<br />
The dashboard and other official webcore.co sites are authorized to use our Font Awesome 5 Pro license. If you choose to run an independent copy of the webCoRE dashboard, only a limited set of Font Awesome icons will be available. Missing icons will be indicated by a placeholder:<br />
<br />
<i class="far fa-missing-icon fa-lg"></i><br />
<br />
When Font Awesome Pro cannot be loaded the dashboard will modify all icons embedded in the UI to work with the free version of Font Awesome 5. Icons specified in pistons are not modified so Font Awesome 5 Pro will not work without a Pro license. If you have purchased a Font Awesome Pro license, simply add your dashboard domain to the whitelist on your license to enable Pro icons – no code changes are required.<br />
<br />
Font Awesome Pro icons will load when the dashboard is run from localhost.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Font_Awesome&diff=815Font Awesome2018-07-07T15:13:38Z<p>Ipaterson: Added info and examples for Font Awesome 5</p>
<hr />
<div>== Thousands of icons ==<br />
<br />
Use this [https://fontawesome.com/icons searchable list] to find over 3000 icons supported by webCoRE. All of the icons, Free and Pro, can be used in your pistons.<br />
<br />
== Try it out ==<br />
<br />
The instructions and examples below can all be used in the Evaluation Console on any of your pistons. Just type in the icon markup as a Value and press enter to see the rendered icon. It's a quick way to experiment with icons before adding them to a piston.<br />
<br />
== Usage ==<br />
<br />
Font Awesome icons can be added to values and expressions throughout your piston, particularly useful for enriching your [[Device Tiles]] and [[Piston State]].<br />
<br />
The following simple markup will be displayed as an icon:<br />
<br />
<blockquote><i class="fas fa-battery-half"></i> <code>:fas fa-battery-half:</code><br />
</blockquote><br />
Simply find the name of an icon you want to use and choose the best style<br />
<br />
* <code>fas</code> Bold, solid icons<br />
** <i class="fas fa-lock fa-lg fa-fw"></i> <i class="fas fa-bolt fa-lg fa-fw"></i> <i class="fas fa-car fa-lg fa-fw"></i><br />
* <code>far</code> Medium weight solid or outlined icons<br />
** <i class="far fa-lock fa-lg fa-fw"></i> <i class="far fa-bolt fa-lg fa-fw"></i> <i class="far fa-car fa-lg fa-fw"></i><br />
* <code>fal</code> Light, outlined icons<br />
** <i class="fal fa-lock fa-lg fa-fw"></i> <i class="fal fa-bolt fa-lg fa-fw"></i> <i class="fal fa-car fa-lg fa-fw"></i><br />
* <code>fab</code> Brand logos<br />
** <i class="fab fa-apple fa-lg fa-fw"></i> <i class="fab fa-android fa-lg fa-fw"></i> <i class="fab fa-windows fa-lg fa-fw"></i><br />
<br />
Icons can be used alongside other text in expressions and values.<br />
<br />
<blockquote><code>Welcome home :far fa-grin-hearts:!</code> Welcome home <i class="far fa-grin-hearts fa-lg"></i>!<br />
</blockquote><br />
=== Icon modifiers ===<br />
<br />
You may notice that the icon markup looks very similar to the way icons are used in the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation], <code>class=&quot;fas fa-battery-half&quot;</code>. In fact, this webCoRE markup maps to the <code>class</code> attribute so any modifiers in the Font Awesome documentation can be replicated.<br />
<br />
==== Sizing icons ====<br />
<br />
The size of Font Awesome icons can be adjusted, [https://fontawesome.com/how-to-use/on-the-web/styling/sizing-icons see all sizes here]. All sizes are relative to the surrounding text so the size of a <code>fa-3x</code> icon in the evaluation console may not exactly match the size of a <code>fa-3x</code> icon in a tile.<br />
<br />
<blockquote><i class="fas fa-clock"></i> <code>:fas fa-clock:</code><br />
<br />
<i class="fas fa-clock fa-xs"></i> <code>:fas fa-clock fa-xs:</code><br />
<br />
<i class="fas fa-clock fa-2x"></i> <code>:fas fa-clock fa-2x:</code><br />
<br />
<i class="fas fa-clock fa-4x"></i> <code>:fas fa-clock fa-4x:</code><br />
</blockquote><br />
==== Rotating icons ====<br />
<br />
If you need an icon to face a different direction, use [https://fontawesome.com/how-to-use/on-the-web/styling/rotating-icons a rotation].<br />
<br />
<blockquote><i class="fal fa-bicycle fa-lg fa-fw"></i> <code>:fal fa-bicycle:</code><br />
<br />
<i class="fal fa-bicycle fa-rotate-180 fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-rotate-180:</code><br />
<br />
<i class="fal fa-bicycle fa-flip-vertical fa-lg fa-fw"></i> <code>:fal fa-bicycle fa-flip-vertical:</code><br />
</blockquote><br />
==== Animating icons ====<br />
<br />
Icons can spin, [https://fontawesome.com/how-to-use/on-the-web/styling/animating-icons learn more here].<br />
<br />
<blockquote><i class="fas fa-circle-notch fa-spin fa-lg fa-fw"></i> <code>:fas fa-circle-notch fa-spin:</code><br />
</blockquote><br />
==== Power transforms ====<br />
<br />
While Font Awesome provides a handful of sizing options from <code>fa-xs</code> to <code>fa-10x</code> and rotations like <code>fa-rotate-90</code>, in some cases it is useful to have more granular control over icon size and position.<br />
<br />
Note that unlike the sizing options, power transforms like this one <i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10" style="opacity: .5"></i> do not affect the flow of text around icons. The transform is a sort of &quot;after effect&quot; that changes how the icon is displayed. To use power transforms in webCoRE, simply add the transform markup to the icon.<br />
<br />
<blockquote><i class="fas fa-exclamation" data-fa-transform="grow-20 rotate-10"></i> <code>:fas fa-exclamation data-fa-transform=&quot;grow-20 rotate-10&quot;</code><br />
</blockquote><br />
See the [https://fontawesome.com/how-to-use/on-the-web/styling/power-transforms documentation and examples] to learn more about scaling, positioning, rotating, and flipping with power transforms. Power transforms are also used extensively in the Combining Icons section.<br />
<br />
=== Combining icons ===<br />
<br />
Font Awesome provides very powerful tools for mixing icons together, in webCoRE we use a different type of markup for these icon containers. <code>[modifiers|content]</code> format allows you to create a container element around the content with the specified modifiers on that container.<br />
<br />
Follow the features described below to build complex and dynamic icons like this calendar that could show the day of the month and number of alerts today:<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">27</span><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
27<br />
]<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Stacked icons ====<br />
<br />
Combine two icons stacked with center alignment. The order of the icons matters; the first icon specified will be layered behind the second. [https://fontawesome.com/how-to-use/on-the-web/styling/stacking-icons Learn more here]<br />
<br />
<blockquote><i class="fab fa-reddit-alien fa-lg"></i> <code>:fab fa-reddit-alien:</code><br />
<br />
<i class="fas fa-certificate fa-lg"></i> <code>:fas fa-certificate:</code><br />
<br />
<span class="fa-stack fa-lg"><i class="fas fa-certificate fa-stack-2x"></i><i class="fab fa-reddit-alien fa-inverse fa-stack-1x"></i></span><br />
<pre>[fa-stack fa-lg|<br />
:fas fa-certificate fa-stack-2x:<br />
:fab fa-reddit-alien fa-inverse fa-stack-1x:<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE markup for colors for more distinct icons:<br />
<br />
<blockquote><i class="fas fa-swimmer fa-lg"></i> <code>:fas fa-swimmer:</code><br />
<br />
<i class="far fa-ban fa-lg"></i> <code>:far fa-ban:</code><br />
<br />
<span class="fa-stack fa-2x"><i class="fas fa-swimmer fa-stack-1x"></i><i class="far fa-ban fa-stack-2x" style="color: red"></i></span><br />
<pre>[fa-stack fa-2x|<br />
:fas fa-swimmer fa-stack-1x:<br />
[color-red|:far fa-ban fa-stack-2x:]<br />
]<br />
</pre><br />
</blockquote><br />
==== Layered icons ====<br />
<br />
Layering is similar to stacking but with full control over the positioning and number of icons. Font Awesome provides [https://fontawesome.com/how-to-use/on-the-web/styling/layering many good examples].<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-play" data-fa-transform="rotate--90 grow-2"></i><i class="fas fa-sun fa-inverse" data-fa-transform="shrink-10 up-2"></i><i class="fas fa-moon fa-inverse" data-fa-transform="shrink-11 down-4.2 left-4"></i><i class="fas fa-star fa-inverse" data-fa-transform="shrink-11 down-4.2 right-3"></i></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-play data-fa-transform=&quot;rotate--90 grow-2&quot;:<br />
:fas fa-sun fa-inverse data-fa-transform=&quot;shrink-10 up-2&quot;:<br />
:fas fa-moon fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 left-4&quot;:<br />
:fas fa-star fa-inverse data-fa-transform=&quot;shrink-11 down-4.2 right-3&quot;:<br />
]<br />
</pre><br />
</blockquote><br />
==== Badges over icons ====<br />
<br />
Layered icons also provide a convenient mechanism for showing a counter or badge in the upper right corner of an icon.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="fas fa-exclamation-triangle"></i><span class="fa-layers-counter">3</span></span><br />
<pre>[fa-layers fa-3x|<br />
:fas fa-exclamation-triangle:<br />
[fa-layers-counter|<br />
3<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
Combine with webCoRE background color to change the badge color.<br />
<br />
<blockquote><span class="fa-layers fa-3x"><i class="far fa-comment"></i><span class="fa-layers-counter" style="background-color: royalblue">15</span></span><br />
<pre>[fa-layers fa-3x|<br />
:far fa-comment:<br />
[fa-layers-counter bg-royalblue|<br />
15<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
==== Custom text over icons ====<br />
<br />
Apply transforms to custom text<br />
<br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-certificate"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-11.5 rotate--30" style="font-weight:bold">NEW</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-certificate:<br />
[fa-layers-text fa-inverse b data-fa-transform=&quot;shrink-11.5 rotate--30&quot;|<br />
NEW<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
<blockquote><span class="fa-layers fa-2x"><i class="fas fa-calendar"></i><span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">12</span></span><br />
<pre>[fa-layers fa-2x|<br />
:fas fa-calendar:<br />
[fa-layers-text fa-inverse data-fa-transform=&quot;shrink-8 down-3&quot;|<br />
12<br />
]<br />
]<br />
</pre><br />
</blockquote><br />
=== Other supported features ===<br />
<br />
Please refer to the [https://fontawesome.com/how-to-use/on-the-web Font Awesome documentation] for additional features and examples. Use masking to &quot;cut out&quot; one icon from another, add borders, and use a fixed width for consistent alignment.<br />
<br />
=== Unsupported features ===<br />
<br />
webCoRE expressions do not support [https://fontawesome.com/how-to-use/on-the-web/styling/icons-in-a-list Icons in a list] since it requires the <code>ul</code> and <code>li</code> elements, but you can achieve the same visual effect with fixed-width icons on multiple lines.<br />
<br />
== Font Awesome 4 Deprecated ==<br />
<br />
Pistons that used icons from the previous version of Font Awesome will continue to work, though the icons may appear slightly different in Font Awesome 5. Please discontinue use of the <code>:fa fa-lock:</code> and shorthand <code>:fa-lock:</code> markup in favor of the Font Awesome 5 styles and icon names.<br />
<br />
The dashboard uses a shim published by the Font Awesome team that maps v4 icons to v5.<br />
<br />
== Font Awesome Pro license ==<br />
<br />
The dashboard and other official webcore.co sites are authorized to use our Font Awesome 5 Pro license. If you choose to run an independent copy of the webCoRE dashboard, only a limited set of Font Awesome icons will be available. Missing icons will be indicated by a placeholder:<br />
<br />
<i class="far fa-missing-icon fa-lg"></i><br />
<br />
When Font Awesome Pro cannot be loaded the dashboard will modify all icons embedded in the UI to work with the free version of Font Awesome 5. Icons specified in pistons are not modified so Font Awesome 5 Pro will not work without a Pro license. If you have purchased a Font Awesome Pro license, simply add your dashboard domain to the whitelist on your license to enable Pro icons – no code changes are required.<br />
<br />
Font Awesome Pro icons will load when the dashboard is run from localhost.</div>Ipatersonhttps://wiki.webcore.co/index.php?title=MediaWiki:Common.js&diff=814MediaWiki:Common.js2018-07-07T02:11:47Z<p>Ipaterson: FA 4 shims were not needed</p>
<hr />
<div>/* Any JavaScript here will be loaded for all users on every page load. */<br />
<br />
/*<br />
window.CHITIKA = { 'units' : [<br />
{"calltype":"async[2]","publisher":"ady624","width":160,"height":600,"sid":"Chitika Default"},<br />
{"calltype":"async[2]","publisher":"ady624","width":728,"height":90,"sid":"Chitika Default"}<br />
] };<br />
<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//cdn.chitika.net/getads.js';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
<br />
var infolinks_pid = 2996624;<br />
var infolinks_wsid = 0;<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//resources.infolinks.com/js/infolinks_main.js';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
*/<br />
/*<br />
<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=1c018b1f-0af0-4396-a510-867f9bdae50d';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
*/<br />
<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = 'https://pro.fontawesome.com/releases/v5.1.0/js/all.js';<br />
script.defer = true;<br />
document.head.appendChild(script);</div>Ipatersonhttps://wiki.webcore.co/index.php?title=MediaWiki:Common.js&diff=813MediaWiki:Common.js2018-07-07T01:32:29Z<p>Ipaterson: Added Font Awesome 5</p>
<hr />
<div>/* Any JavaScript here will be loaded for all users on every page load. */<br />
<br />
/*<br />
window.CHITIKA = { 'units' : [<br />
{"calltype":"async[2]","publisher":"ady624","width":160,"height":600,"sid":"Chitika Default"},<br />
{"calltype":"async[2]","publisher":"ady624","width":728,"height":90,"sid":"Chitika Default"}<br />
] };<br />
<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//cdn.chitika.net/getads.js';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
<br />
var infolinks_pid = 2996624;<br />
var infolinks_wsid = 0;<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//resources.infolinks.com/js/infolinks_main.js';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
*/<br />
/*<br />
<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=1c018b1f-0af0-4396-a510-867f9bdae50d';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
*/<br />
<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = 'https://pro.fontawesome.com/releases/v5.1.0/js/all.js';<br />
script.defer = true;<br />
document.head.appendChild(script);<br />
<br />
script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = 'https://pro.fontawesome.com/releases/v5.1.0/js/v4-shims.js';<br />
script.defer = true;<br />
document.head.appendChild(script);</div>Ipatersonhttps://wiki.webcore.co/index.php?title=MediaWiki:Common.js&diff=812MediaWiki:Common.js2018-07-07T00:58:43Z<p>Ipaterson: Added Font Awesome 5</p>
<hr />
<div>/* Any JavaScript here will be loaded for all users on every page load. */<br />
<br />
/*<br />
window.CHITIKA = { 'units' : [<br />
{"calltype":"async[2]","publisher":"ady624","width":160,"height":600,"sid":"Chitika Default"},<br />
{"calltype":"async[2]","publisher":"ady624","width":728,"height":90,"sid":"Chitika Default"}<br />
] };<br />
<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//cdn.chitika.net/getads.js';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
<br />
var infolinks_pid = 2996624;<br />
var infolinks_wsid = 0;<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//resources.infolinks.com/js/infolinks_main.js';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
*/<br />
/*<br />
<br />
var script = document.createElement('script');<br />
script.type = 'text/javascript';<br />
script.src = '//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=1c018b1f-0af0-4396-a510-867f9bdae50d';<br />
script.async = true;<br />
document.head.appendChild(script);<br />
*/<br />
<br />
mw.loader.load('//pro.fontawesome.com/releases/v5.1.0/js/all.js');<br />
mw.loader.load('//pro.fontawesome.com/releases/v5.1.0/js/v4-shims.js');</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Functions&diff=811Functions2018-06-27T12:24:03Z<p>Ipaterson: /* String functions */ Added urlEncode and json functions</p>
<hr />
<div><div style="float: left; clear: both; margin-right: 1em; margin-bottom: 1em;">__TOC__</div><br />
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions<br />
<br />
<br />
=[[Variable_data_types#String|String]] functions=<br />
<br />
==concat==<br />
:Syntax<br />
::<code>''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.<br />
<br />
==contains==<br />
:Syntax<br />
::<code>''boolean'' contains(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if the <code>needle</code> is found anywhere in the <code>haystack</code><br />
<br />
==endsWith==<br />
:Syntax<br />
::<code>''boolean'' endsWith(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if <code>haystack</code> ends with the <code>needle</code><br />
<br />
==format==<br />
[[File:Format.pdf|page=1|thumb|256px|A very nice article written by Professor Don Colton, at the Brigham Young University of Hawaii]]<br />
:Syntax<br />
::<code>''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])</code><br />
:Returns<br />
::Returns a string that is built based on the <code>formatString</code> with arguments replaced by their corresponding values. Follows the java syntax for <code>printf()</code>. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].<br />
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. <br />
:Example<br />
::<code>format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])</code> outputs <code>The temperature outside is 71.26 degrees Fahrenheit</code><br />
::The <code>%.2f</code> translates to "format as <code>f</code>loat and use <code>.2</code> decimal places.<br />
<br />
==indexOf==<br />
:Syntax<br />
::<code>''integer'' indexOf(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns the character index of the first occurrence of <code>needle</code> inside <code>haystack</code><br />
:Examples<br />
::<code>indexOf("hello world", 'l')</code> outputs <code>2</code><br />
<br />
==json==<br />
:Syntax<br />
::<code>''string'' json(''dynamic'' value[, "boolean" pretty])</code><br />
:Returns<br />
::Returns the JSON representation of the provided value. If the pretty parameter is true, indentation is added to improve human readability <br />
:Examples<br />
::<code>json(true)</code> outputs <code>"true"</code><br />
::<code>json(123)</code> outputs <code>"123"</code><br />
::<code>json('Nicole "Nikki" Sawyer')</code> outputs <code>""Nicole \"Nikki\" Sawyer""</code><br />
::<code>json(myStringList, true)</code> outputs with pretty formatting<br />
:::<code>"{<br/>&nbsp; "name": "Jaime",<br/>&nbsp; "present": true<br/>}"</code><br />
::<code>json(myDeviceList)</code> outputs <code>"[":97e051eb6fea489fa7cf1aaa4cb7c171:",":73d68350942e4555a8c47c36f558681e:"]"</code> since device variables are internally a list of device IDs<br />
::<code><nowiki>"\{"device": {json($currentEventDevice)}, "rooms": \[ {json(activeRoom)}, "Basement" \] \}"</nowiki></code> building JSON by hand in a webCoRE expression requires any <code>{}[]</code> characters in the JSON to be escaped with a backslash and all dynamic values must use the <code>json()</code> function to safely represent the value<br />
<br />
==lastIndexOf==<br />
:Syntax<br />
::<code>''integer'' lastIndexOf(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns the character index of the last occurrence of <code>needle</code> inside <code>haystack</code><br />
:Examples<br />
::<code>lastIndexOf("hello world", 'l')</code> outputs <code>9</code><br />
<br />
==left==<br />
:Syntax<br />
::<code>''string'' left(''string'' value, ''integer'' length)</code><br />
:Returns<br />
::Returns the first <code>length</code> characters in <code>value</code><br />
:Examples<br />
::<code>left("hello world", 2)</code> outputs <code>he</code><br />
<br />
==lower==<br />
:Syntax<br />
::<code>''string'' lower(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but with all lower case letters.<br />
:Examples<br />
::<code>lower("Hello World")</code> outputs <code>hello world</code><br />
<br />
==mid==<br />
:Syntax<br />
::<code>''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])</code><br />
:Arguments<br />
::<code>start</code> - provides the 0-based index of the first character to copy. If <code>start</code> is negative, the counting starts from the end of <code>value</code>.<br />
::<code>count</code> - provides the number of characters to copy from <code>value</code>. If not provided, all of the remaining characters from <code>value</code> are returned, starting with character number <code>start</code>. If <code>count</code> is negative, prior characters are returned.<br />
:Returns<br />
::Returns a substring of <code>value</code>, <code>count</code> characters long, starting at character number <code>start</code>. Note that the first character in any string has index 0.<br />
:Examples<br />
::<code>mid("Hello World", 2, 3)</code> outputs <code>llo</code><br />
::<code>mid("Hello World", 2)</code> outputs <code>llo World</code><br />
::<code>mid("Hello World", -5, 2)</code> outputs <code>Wo</code><br />
::<code>mid("Hello World", -1, -3)</code> outputs <code>orl</code><br />
<br />
==random==<br />
:Syntax<br />
::<code>''dynamic'' random([''integer'' range | ''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN]])</code><br />
:Arguments<br />
::<code>range</code> - an integer number representing a range<br />
::<code>value1</code>..<code>valueN</code> - any kind of arguments, one will be randomly returned<br />
:Returns<br />
::Returns a random decimal number between <code>0</code> and <code>1</code> if no arguments are provided, or a number between <code>0</code> and <code>range</code> (inclusive) if a single argument is provided, or a randomly selected argument if two or more arguments are provided.<br />
:Examples<br />
::<code>random()</code> outputs <code>0.483</code> (random decimal)<br />
::<code>random(20)</code> outputs <code>6</code> (random integer)<br />
::<code>random("Hello World", "Good morning", "Hello", "Hi")</code> outputs <code>Hello</code> (randomly selected value)<br />
:Tips<br />
::To output a random integer between 5 and 20 use <code>(5 + random(15))</code><br />
::To output a random integer between -5 and 20 use <code>(-5 + random(25))</code><br />
<br />
==replace==<br />
:Syntax<br />
::<code>''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])</code><br />
:Returns<br />
::Replaces all the occurrences of <code>needle</code> inside <code>haystack</code> with its respective <code>replacement</code>. Multiple pairs of <code>needle</code>/<code>replacement</code> can be provided in one function call.<br />
:Regular expressions<br />
::Needles support regular expressions when their value starts and ends with a <code>/</code>. For example, <code>'/(\s)/'</code> will match all spaces.<br />
:Examples<br />
::<code>replace("Hello World", 'World', 'Earth')</code> outputs <code>Hello Earth</code><br />
::<code>replace("Hello World", 'World', 'Earth', 'Hello', 'Hi')</code> outputs <code>Hi Earth</code><br />
::<code>replace("Hello World", 'World', 'Earth', 'Earth', 'Planet')</code> outputs <code>Hello Planet</code><br />
<br />
==right==<br />
:Syntax<br />
::<code>''string'' right(''string'' value, ''integer'' length)</code><br />
:Returns<br />
::Returns the last <code>length</code> characters in <code>value</code><br />
:Examples<br />
::<code>right("hello world", 4)</code> outputs <code>orld</code><br />
<br />
==startsWith==<br />
:Syntax<br />
::<code>''boolean'' startsWith(''string'' haystack, ''string'' needle)</code><br />
:Returns<br />
::Returns true if <code>haystack</code> starts with the <code>needle</code><br />
<br />
==string==<br />
:Syntax<br />
::<code>''string'' string(''dynamic'' value)</code><br />
:Returns<br />
::Returns <code>value</code> as a string.<br />
<br />
==substr==<br />
:Alias of <code>mid()</code><br />
<br />
==substring==<br />
:Alias of <code>mid()</code><br />
<br />
==title==<br />
:Syntax<br />
::<code>''string'' title(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but in its title case format (each word starts with a capitalized letter).<br />
:Examples<br />
::<code>lower("Hello there world")</code> outputs <code>Hello There World</code><br />
<br />
==upper==<br />
:Syntax<br />
::<code>''string'' upper(''string'' value)</code><br />
:Returns<br />
::Returns the <code>value</code> but with all upper case letters.<br />
:Examples<br />
::<code>upper("Hello World")</code> outputs <code>HELLO WORLD</code><br />
<br />
==text==<br />
:Alias of <code>string()</code><br />
<br />
==trim==<br />
:Syntax<br />
::<code>"string" trim("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with leading and trailing spaces removed<br />
:Examples<br />
::<code>trim(" Hello World ")</code> outputs <code>Hello World</code><br />
<br />
==trimLeft==<br />
:Syntax<br />
::<code>"string" trimLeft("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with leading spaces removed<br />
:Examples<br />
::<code>trimLeft(" Hello World ")</code> outputs <code>"Hello World "</code><br />
<br />
==ltrim==<br />
:Alias of <code>trimLeft()</code><br />
<br />
==trimRight==<br />
:Syntax<br />
::<code>"string" trimRight("string" value)</code><br />
:Returns<br />
::Returns the <code>value</code> with trailing spaces removed<br />
:Examples<br />
::<code>trimRight(" Hello World ")</code> outputs <code>" Hello World"</code><br />
<br />
==rtrim==<br />
:Alias of <code>trimRight()</code><br />
<br />
==urlEncode==<br />
:Syntax<br />
::<code>''string'' urlEncode(''dynamic'' value)</code><br />
:Returns<br />
::Returns a string with all characters other than <code>a-z A-Z 0-9 . - * _ +</code> converted to percent encoding for use in a URL<br />
:Examples<br />
::<code>urlEncode("John's iPhone 8+")</code> outputs <code>"John%27s%20iPhone%208+"</code><br />
::<code><nowiki>"http://webcore.co/sample?device={urlEncode($currentEventDevice)}&attribute={urlEncode($currentEventAttribute)}&value={urlEncode($currentEventValue)}"</nowiki></code> ensures that the generated URL is valid even if the event information includes spaces, & signs, or other problematic characters.<br />
<br />
==encodeURIComponent==<br />
:Alias of <code>urlEncode()</code><br />
<br />
=Numeric functions=<br />
<br />
==avg==<br />
:Syntax<br />
::<code>''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the mean average of all the values provided.<br />
<br />
==abs==<br />
:Syntax<br />
::<code>''decimal'' abs(''decimal'' value)</code><br />
:Returns<br />
::Returns the absolute value of the argument (e.g., remove negative sign for negative values).<br />
<br />
==ceil==<br />
:Syntax<br />
::<code>''integer'' ceil(''decimal'' value)</code><br />
:Returns<br />
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.<br />
:Examples<br />
::<code>ceil(5.6)</code> outputs <code>6</code><br />
::<code>ceil(-5.6)</code> outputs <code>-6</code><br />
<br />
==ceiling==<br />
:Alias of <code>ceil</code><br />
<br />
==decimal==<br />
:Syntax<br />
::<code>''decimal'' decimal(''dynamic'' value)</code><br />
:Returns<br />
::Converts <code>value</code> into a decimal. Returns <code>0</code> if <code>value</code> is not numeric.<br />
<br />
==float==<br />
:Alias of <code>decimal</code><br />
<br />
==floor==<br />
:Syntax<br />
::<code>''integer'' ceil(''decimal'' value)</code><br />
:Returns<br />
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.<br />
:Examples<br />
::<code>floor(5.6)</code> outputs <code>5</code><br />
::<code>floor(-5.6)</code> outputs <code>-5</code><br />
<br />
==max==<br />
:Syntax<br />
::<code>''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==median==<br />
:Syntax<br />
::<code>''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==min==<br />
:Syntax<br />
::<code>''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])</code><br />
:Returns<br />
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.<br />
<br />
==number==<br />
:Alias of <code>decimal</code><br />
<br />
==power==<br />
:Syntax<br />
::<code>''decimal'' power(''decimal'' value, ''decimal'' exponent)</code><br />
:Returns<br />
::Returns the <code>value</code> at the power of <code>exponent</code><br />
<br />
==round==<br />
:Syntax<br />
::<code>''decimal'' round(''decimal'' value[, ''integer'' precision = 0])</code><br />
:Arguments<br />
::<code>precision</code> - the number of decimal places to be retained. If not provided, defaults to <code>0</code><br />
:Returns<br />
::Returns the rounded <code>value</code> with <code>precision</code> decimal places.<br />
<br />
==sqr==<br />
:Syntax<br />
::<code>''decimal'' sqr(''decimal'' value)</code><br />
:Returns<br />
::Returns the squared <code>value</code>, equivalent to <code>value</code> multiplied by itself.<br />
<br />
==sqrt==<br />
:Syntax<br />
::<code>''decimal'' sqrt(''decimal'' value)</code><br />
:Returns<br />
::Returns the square root of <code>value</code>.<br />
<br />
==stdev==<br />
:Syntax<br />
::<code>''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the standard deviation of all the values provided.<br />
<br />
==sum==<br />
:Syntax<br />
::<code>''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the sum of sum of all the values provided.<br />
<br />
==variance==<br />
:Syntax<br />
::<code>''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])</code><br />
:Returns<br />
::Returns the variance of all the values provided.<br />
<br />
=[[Variable_data_types#Boolean|Boolean]] functions=<br />
<br />
==bool==<br />
:Syntax<br />
::<code>bool(''dynamic'' value)</code><br />
:Returns<br />
::Returns the truth value of the input. Accepts anything as input and will return true if <code>value</code> is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime<br />
<br />
==boolean==<br />
:This is an alias of [[Functions#bool|bool]]<br />
<br />
==eq==<br />
:Syntax<br />
::<code>eq(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is equivalent to <code>value2</code><br />
<br />
==ge==<br />
:Syntax<br />
::<code>ge(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is greater than or equal to <code>value2</code><br />
<br />
==gt==<br />
:Syntax<br />
::<code>gt(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is greater than <code>value2</code><br />
<br />
==isBetween==<br />
:Syntax<br />
::<code>isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)</code><br />
:Returns<br />
::Returns true if <code>value</code> is greater then or equal to <code>startValue</code> and less than or equal to <code>endValue</code><br />
<br />
==isEmpty==<br />
:Syntax<br />
::<code>isEmpty(''dynamic'' value)</code><br />
:Returns<br />
::Returns true if <code>value</code> is not set, an empty string, or zero<br />
<br />
==le==<br />
:Syntax<br />
::<code>le(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is less than or equal to <code>value2</code><br />
<br />
==lt==<br />
:Syntax<br />
::<code>lt(''dynamic'' value1, ''dynamic'' value2)</code><br />
:Returns<br />
::Returns true if <code>value1</code> is less than <code>value2</code><br />
<br />
==not==<br />
:Syntax<br />
::<code>not(''dynamic'' value)</code><br />
:Returns<br />
::Returns the negated truth state of <code>value</code>. This is the logical negation of <code>[[Functions#bool|bool]](''dynamic'' value)</code>.<br />
<br />
=[[Variable_data_types#Date_and_Time|Date and time]] functions=<br />
<br />
==addDays==<br />
:Syntax<br />
::<code>addDays(''datetime'' value, ''integer'' days)</code><br />
:Returns<br />
::Returns a datetime that is <code>days</code> days after the <code>value</code>. For negative values of <code>days</code>, it returns a datetime that is <code>days</code> days before <code>value</code>.<br />
<br />
==addHours==<br />
:Syntax<br />
::<code>addHours(''datetime'' value, ''integer'' hours)</code><br />
:Returns<br />
::Returns a datetime that is <code>hours</code> hours after the <code>value</code>. For negative values of <code>hours</code>, it returns a datetime that is <code>hours</code> hours before <code>value</code>.<br />
<br />
==addMinutes==<br />
:Syntax<br />
::<code>addMinutes(''datetime'' value, ''integer'' minutes)</code><br />
:Returns<br />
::Returns a datetime that is <code>minutes</code> minutes after the <code>value</code>. For negative values of <code>minutes</code>, it returns a datetime that is <code>minutes</code> minutes before <code>value</code>.<br />
<br />
==addSeconds==<br />
:Syntax<br />
::<code>addSeconds(''datetime'' value, ''integer'' seconds)</code><br />
:Returns<br />
::Returns a datetime that is <code>seconds</code> seconds after the <code>value</code>. For negative values of <code>seconds</code>, it returns a datetime that is <code>seconds</code> seconds before <code>value</code>.<br />
<br />
==addWeeks==<br />
:Syntax<br />
::<code>addWeeks(''datetime'' value, ''integer'' weeks)</code><br />
:Returns<br />
::Returns a datetime that is <code>weeks</code> weeks after the <code>value</code>. For negative values of <code>weeks</code>, it returns a datetime that is <code>weeks</code> weeks before <code>value</code>.<br />
<br />
==date==<br />
:Syntax<br />
::<code>date(''datetime'' value)</code><br />
:Returns<br />
::Returns the date portion of <code>value</code> by stripping off time information.<br />
<br />
==datetime==<br />
:Syntax<br />
::<code>''datetime'' datetime(''dynamic'' value)</code><br />
:Returns<br />
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.<br />
<br />
<br />
==formatDuration==<br />
:Syntax<br />
::<code>''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])</code><br />
:Arguments<br />
::<code>friendly</code> - <code>false</code> makes the output compact, in the form of <code>0d 00:00:00.000</code>, while <code>true</code> makes the output more human friendly, in the form of <code> 0 days, 0 hours, 0 minutes, and 0 seconds</code>. Defaults to <code>false</code>.<br />
::<code>granularity</code> - represents the smallest time unit to be output. One of <code>d</code> for days, <code>h</code> for hours, <code>m</code> for minutes, <code>s</code> for seconds, or <code>ms</code> for milliseconds. Any time unit below the selected granularity will not be output. Defaults to <code>s</code><br />
::<code>showAdverbs</code> - only affects the friendly output, when <code>true</code> the words <code>in</code> (for future durations - positive input) or <code>ago</code> (for past durations - negative input) are prepended or appended respectively to the output<br />
:Returns<br />
::Returns a string that represents the duration in a human readable format<br />
:Examples<br />
::<code>formatDuration(12029)</code> will output <code>00:00:12</code><br />
::<code>formatDuration(68493, true)</code> will output <code>1 minute and 8 seconds</code><br />
::<code>formatDuration(68493, false, 'ms')</code> will output <code>00:01:08</code><br />
::<code>formatDuration(68493, true, 'm', true)</code> will output <code>in 1 minute</code><br />
<br />
==formatDateTime==<br />
:Syntax<br />
:Arguments<br />
:Examples<br />
:Reference - https://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html<br />
<br />
==time==<br />
:Syntax<br />
::<code>''time'' time(''datetime'' value)</code><br />
:Returns<br />
::Returns the time portion of <code>value</code> by stripping off date information.<br />
<br />
=Weather related functions=<br />
<br />
==celsius==<br />
:Syntax<br />
::<code>''decimal'' celsius(''decimal'' value)</code><br />
:Returns<br />
::Converts a temperature value from Fahrenheit to Celsius.<br />
<br />
==dewPoint==<br />
:Syntax<br />
::<code>''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])</code><br />
:Parameters<br />
::<code>scale</code> - optional, one of <code>C</code> or <code>F</code>, corresponding to the temperature range used for <code>temperature</code>. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.<br />
:Returns<br />
::Returns the due temperature for a given temperature and relative humidity<br />
<br />
==fahrenheit==<br />
:Syntax<br />
::<code>''decimal'' fahrenheit(''decimal'' value)</code><br />
:Returns<br />
::Converts a temperature value from Celsius to Fahrenheit.<br />
<br />
<br />
<br />
= [[Variable_data_types#Dynamic|Dynamic]] =<br />
;if(condition, valueIfTrue, valueIfFalse)<br />
:evaluates a boolean and returns value1 if true, or value2 otherwise<br />
;least(values)<br />
:returns the value that is least found a series of numeric values<br />
;most(values)<br />
:returns the value that is most found a series of numeric values<br />
;previousValue([device;attribute])<br />
:returns the previous value of the attribute<br />
<br />
= [[Variable_data_types#Number_.28Integer.29|Integers]] =<br />
;age([device﹕attribute])<br />
:returns the number of milliseconds an attribute had the current value<br />
;count(values)<br />
:calculates the number of true/non-zero/non-empty items in a series of numeric values<br />
;int()<br />
://todo<br />
;integer(decimal or string)<br />
:converts a decimal value to it's integer value<br />
;newer([device﹕attribute],[...], [device﹕attribute], threshold)<br />
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds<br />
;older([device﹕attribute],[...], [device﹕attribute], threshold)<br />
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds<br />
;previousAge([device﹕attribute])<br />
:returns the number of milliseconds an attribute had the previous value<br />
<br />
= [[Variable_data_types#Time|Time]] =<br />
;time(value)<br />
:returns the value as a time type<br />
;addSeconds(dateTime, seconds)<br />
:adds seconds to time, returns the value as a time type<br />
;addMinutes(dateTime, minutes)<br />
:adds minutes to time, returns the value as a time type<br />
;addHours(dateTime, hours)<br />
:adds hours to time, returns the value as a time type<br />
;addDays(dateTime, days)<br />
:adds days to time, returns the value as a time type<br />
;addWeeks(dateTime, weeks)<br />
:adds weeks to time, returns the value as a time type</div>Ipatersonhttps://wiki.webcore.co/index.php?title=MediaWiki:Sidebar&diff=674MediaWiki:Sidebar2017-12-13T01:40:25Z<p>Ipaterson: I'm bad at following directions and inverted the menu links and text</p>
<hr />
<div><br />
* navigation<br />
** mainpage|mainpage-description<br />
** recentchanges-url|recentchanges<br />
** randompage-url|randompage<br />
** helppage|help<br />
* webCoRE<br />
** https://dashboard.webcore.co/|Dashboard<br />
** https://community.webcore.co/|Community forum<br />
* SEARCH<br />
* TOOLBOX<br />
* LANGUAGES</div>Ipatersonhttps://wiki.webcore.co/index.php?title=MediaWiki:Sidebar&diff=673MediaWiki:Sidebar2017-12-13T01:39:26Z<p>Ipaterson: Added links to the dashboard and forum</p>
<hr />
<div><br />
* navigation<br />
** mainpage|mainpage-description<br />
** recentchanges-url|recentchanges<br />
** randompage-url|randompage<br />
** helppage|help<br />
* webCoRE<br />
** Dashboard|https://dashboard.webcore.co/<br />
** Community forum|https://community.webcore.co/<br />
* SEARCH<br />
* TOOLBOX<br />
* LANGUAGES</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Execution_Method&diff=668Execution Method2017-11-15T21:33:19Z<p>Ipaterson: /* Sychronous */ Spelling</p>
<hr />
<div><br />
=Synchronous=<br />
<br />
Statements are normally executed one after another. Each statement ''waits'' on the previous statement to complete, before it starts to execute. If the previous statement includes a ''Wait'' task, all the remaining tasks in the previous statement, and any statement after that, will be delayed. This is known as ''synchronous'', because everything happens in ''sync'', or, in other words, always happening in the same order. Synchronous execution is the default execution of most statements.<br />
<br />
{{warning|The ''every'' statement, also known as a ''timer'', is an exception to the default rule, because, due to its nature, it always runs asynchronously - see below for more details}}<br />
<br />
=Asynchronous=<br />
<br />
In contrast, this allows multiple statements to run ''out of sync''. An asynchronous statement can start a wait period that would delay all the remaining tasks, but the next statements will start executing immediately, without waiting for the asynchronous statement to finish. This means that things can now happen out of order, or ''out of sync''.<br />
<br />
//todo: examples</div>Ipatersonhttps://wiki.webcore.co/index.php?title=webCoRE&diff=667webCoRE2017-11-12T12:40:26Z<p>Ipaterson: /* Creating your first piston */ Embedded Creating your first piston page</p>
<hr />
<div><youtube>jgXA_rv2-_8</youtube><br />
<br />
<div style="float: left; clear: both; margin-right: 2em; margin-top: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
= General =<br />
The ''web Community's own Rule Engine'' (or for short, webCoRE) is a general rule engine for SmartThings. It works by allowing users to create scripts that are interpreted and executed by the SmartThings SmartApp, allowing for complex decisions. webCoRE is currently a work in progress. webCoRE reached the first Beta milestone on April 29, 2017. <br />
<br />
Currently webCoRE is in the Second Beta milestone as of June 7th, 2017. Lots of bugs have been squashed and several new features have been implemented. <br />
<br />
Please review the [[webCoRE todo]] list for a loose road map.<br />
<br />
=Definitions=<br />
{{:Glossary}}<br />
<br />
= Getting started =<br />
A few steps need to be completed before you can use webCoRE. First, webCoRE needs to be installed in your SmartThings account, then automations need to be configured. These are called [[Piston|pistons]] and will be detailed later. So let's start by installing webCoRE, please follow the steps below. <br />
<br />
Please be sure to read through all the instructions. If you are still getting stuck then check the troubleshooting sections. Should you still have problems then please feel free to ask for some help on the SmartThings Forums. Be sure to find the latest webCoRE help post.<br />
<br />
=Installing webCoRE=<br />
These instructions will guide you through installing webCoRE via GitHub integration or manually all the way to adding devices and authorizing your browser for use. Be sure to follow all the steps as proper order is crucial when installing for the first time.<br />
<br />
==GitHub Installation (preferred method)==<br />
# Login to the [http://ide.smartthings.com SmartThings IDE].<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''Settings''' button at the top of the page.<br />
#:[[File:Settings.jpg]]<br />
# Click the '''Add new repository''' link at the bottom of the pop up.<br />
# Enter <code>ady624</code> in the '''Owner''' column.<br />
# Enter <code>webCoRE</code> in the '''Name''' column.<br />
# Enter <code>master</code> in the '''Branch''' column.<br />
# Click '''Save''' (do not hit the Enter key, it will exit the form without saving).<br />
#:[[File:Githubrepo.jpg|frameless|400px]]<br />
# Click '''Update From Repo'''.<br />
# Select '''webCoRE (master)''' from the list.<br />
#:[[File:Update.jpg]]<br />
# Check "webCore.groovy" from the '''New (only in GitHub)''' box. {{Warning |Do not update all at once}}<br />
#:[[File:Githubinstall_webcoreonly.png]]<br />
# Check the '''Publish''' checkbox at the bottom of the pop up.<br />
#:[[File:Ide_update.png]]<br />
# Click the '''Execute Update''' button.<br />
#:[[File:Ide_update-new.png]]<br />
# Click again on '''Update From Repo'''.<br />
# Select '''webCoRE (master)''' from the list.<br />
#:[[File:Update.jpg]]<br />
# Check "webCoRE Piston.groovy", "webCoRE Storage.groovy"and "webCoRE Dashboard.groovy" from the '''New (only in GitHub)''' box.<br />
#:[[File:Githubinstall_allchecked.png]]<br />
# Check the '''Publish''' checkbox at the bottom of the pop up.<br />
#:[[File:Ide_update.png]]<br />
# Click the '''Execute Update''' button.<br />
#:[[File:Ide_update-new.png]]<br />
<br />
<br />
<br />
==Manual Install==<br />
<br />
<br />
=== webCoRE Smart App ===<br />
<br />
# Login to the [http://developer.smartthings.com SmartThings web UI].<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore.src/webcore.groovy webCore.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save'''.<br />
# Click '''Publish'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Piston Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-piston.src/webcore-piston.groovy webCoRE-piston.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Storage Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-storage.src/webcore-storage.groovy webCoRE-storage.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Dashboard Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-dashboard.src/webcore-dashboard.groovy webCoRE-dashboard.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
<br />
<br />
==Enabling OAuth for webCoRE==<br />
# Navigate to the '''My SmartApps''' page if you are not already there.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the edit button to the left of '''ady624 : webCoRE''', it looks like a rounded square with a pencil in it.<br />
#:[[File:Editwebcore.jpg]]<br />
# Scroll down and click on '''OAuth'''.<br />
# Click the '''Enable OAuth in SmartApp''' button.<br />
# Click the '''Update''' button at the bottom of the page.<br />
#:[[File:Oauth.jpg|frameless|600px]]<br />
<br />
<br />
<br />
==Installing webCoRE==<br />
# Open the SmartThings app on your mobile device.<br />
# Tap the '''Marketplace''' icon at the bottom of the screen. If you are in a Room or Device within the app you will need to go back to '''My Home'''.<br />
# Tap the '''SmartApps''' header at the top of the page.<br />
# Scroll down and tap '''My Apps'''.<br />
# Scroll down until you find '''webCoRE''' and tap it. Do not tap '''webCoRE Piston'''. If you can't find '''webCore''' you likely skipped some steps above.<br />
# Tap '''Next'''.<br />
# Here you can change the name from '''webCoRE''' to anything you desire then tap '''Next'''. (''Recommend leaving it unless you are working with multiple instances.'')<br />
# Choose a password and expiration length then tap '''Next'''.<br />
# Scroll through the list and select all of the devices you want webCoRE to have access to. If you do not do this, you will not be able to use those devices in webCoRE. This must also be done again when adding new devices to your SmartThings Account. webCoRE will not automatically import them.<br />
# Tap '''Next'''.<br />
# Tap '''Done'''.<br />
<br />
<br />
<br />
==Opening the new dashboard from your phone==<br />
# From within the SmartThings app, tap the Automations icon at the bottom of the screen and select the SmartApps section.<br />
# Scroll down and tap the name of the webCoRE instance you are trying to access. This is typically webCoRE, unless you edited the name during the installation process.<br />
# Tap Dashboard.<br />
# You will be prompted to enter the security password, the same password you created when you installed webCoRE.<br />
<br />
<br />
<br />
==Using webCoRE from another browser==<br />
You cannot bookmark the URL you launched from the SmartThing app. In order to use webCoRE on another device you must follow these instructions.<br />
<br />
# From within the SmartThings app, tap the '''Automations''' icon at the bottom of the screen and select the '''SmartApps''' section.<br />
# Scroll down and tap the name of the webCoRE instance you are trying to access. This is typically '''webCoRE''', unless you edited the name during the installation process.<br />
# Tap '''Register a browser''', a page will appear providing you with a registration code. The code expires in 3 minutes and can only be used once.<br />
#: [[File:Register-browser.png|Register a Browser]] [[File:Register-browser-code.png|Register a Browser]]<br />
# On your other device, open the browser and visit <i>[https://webcore.co/re webcore.co/re]</i><br />
# Enter the code and click '''Register'''.<br />
# You will be prompted to enter the security password, the same password you created when you installed webCoRE.<br />
<br />
<br />
<br />
= Updating webCoRE =<br />
[[file:UpdateAlert.png]]<BR><br />
When you see the alert that there is a new version available or that your smartapps are not the same version then you will need to update the webCoRE code. This has a few benefits besides being on the latest and greatest version. It is best to keep webCoRE up to date because bugs are constantly getting squashed and new features added with each version. This will make troubleshooting easier when you are running into issues and seeking help. Lastly SmartThings keeps the most used SmartApps in their cache which means quicker response times on your pistons. <br />
<br />
For those of you with gitHub integration this is a quick and painless process. If you manually installed then it is a similar process as before. Either way updating only takes a few minutes of your time. <br />
<br />
== GitHub ==<br />
#Log into the SmartThings IDE<br />
#Select My SmartApps<br />
#*You will see all the webCoRE SmartApps listed in a purple color<br />
#Click update from Repo<br />
#Select webCoRE(Master)<br />
#*In the Obsolete column you will see the 4 webCoRE SmartApps<br />
#Select all 4 checkboxes<br />
#Click the publish checkbox<br />
#Click Execute Update<br />
<br />
== Manual Update == <br />
This requires a little bit more work than gitHub integration but still will only take a few moments. Visit the links below and copy and paste the new raw code over the obsolete code then publish and execute update.<br />
<br />
<br />
{| class="wikitable"<br />
|+ Link to Raw gitHub code<br />
|-<br />
! webCoRE<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore.src/webcore.groovy<br />
|-<br />
! webCoRE Dashboard<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-dashboard.src/webcore-dashboard.groovy<br />
|-<br />
! webCoRE Piston<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-piston.src/webcore-piston.groovy<br />
|-<br />
! webCoRE Storage<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-storage.src/webcore-storage.groovy<br />
|}<br />
<br />
== Update Complete ==<br />
That is all you have to do. Your webCoRE instance's are now up to date. However if you have multiple locations(hubs) then you will need to do this for each location(hub).<br />
<br />
=Troubleshooting=<br />
Here are some common troubleshooting things to try if you are having issues with the following categories<br />
<br />
==Installation==<br />
[[File:500error.png|frameless|400px]]<br><br />
<br />
If you receive this error it may be because you installed and published both "webCore.groovy" and other SmartApps at the same time. Please do them in order per the instructions. Be sure to install/publish "webCore.groovy" first then the others after (See steps 11-16). You can do the other SmartApps at the same time after "webCore.groovy" has been installed and published.<br />
<br />
<br />
==General==<br />
Endless Spinning Square<br />
#Open The SmartThings App<br />
#Go into settings<br />
#Click the map location<br />
#Move the pin on the map around<br />
#Position on your actual location<br />
#save actual location<br />
#Save the settings<br />
<br />
<br />
= Creating your first piston =<br />
{{:Creating your first piston}}<br />
<br />
=Sample Pistons=<br />
This section has some user contributed sample pistons. You can import any of these pistons using the import code displayed at the top of the piston.<br />
# [[Samples]]<br />
<br />
= Understanding the basics =<br />
webCoRE is comprised of the three main components listed below.<br />
<br />
== The webCoRE child SmartApp (''webCoRE Piston'') ==<br />
The webCoRE child SmartApp is also known as a [[Piston|piston]]. It is responsible for executing the automation script that the user creates and does the heavy lifting in the whole webCoRE ecosystem. It is directly managed by the webCoRE parent SmartApp, which can create, maintain, and delete a Piston.<br />
<br />
== The webCoRE parent SmartApp (''webCoRE'') ==<br />
The wabCoRE parent SmartApp is the component responsible for managing the child SmartApp instances and their relationship with the Dashboard. It is the middle man that allows adding new Pistons, maintaining them, or deleting them. It is also responsible with the security of the whole ecosystem, allowing password secured access from the Dashboard.<br />
<br />
== The [[Dashboard|dashboard]] ==<br />
The Dashboard is an [https://en.wikipedia.org/wiki/HTML HTML] interface for webCoRE that allows users to manage their webCoRE installation. It is the central hub to controlling webCoRE, allowing the user to create, modify, test, and delete Pistons.<br />
<br />
=Anatomy of a webCoRE Piston=<br />
::''Main article [[Piston]]''<br />
A piston is a script that contains a collection of elements, arranged so that the logic and flow of the piston perform tasks in a desired sequence. It is broken down into several sections, each having its own important role.<br />
<br />
//todo: most details below need to be moved into the main article<br />
<br />
==The ''settings'' section==<br />
This menu is accessed from the piston editor. In the upper right hand corner select options and then enable <code>Show piston settings</code><br />
<br />
<br />
[[file:pistonoptions.png]]<br />
<br />
These settings allows configuration of how certain aspects of the piston function. <br />
<br />
[[file:pistonsettings.png|frameless|500px]]<br />
<br />
*'''Name''' - Change the name of a piston.<br />
*'''Description''' - Give a description of what the piston does.<br />
*'''Automatic piston state''' - Change whether the piston handles it state or make it manual and you can control the piston's state.<br />
*'''Piston execution parallelism''' - //todo<br />
*'''Condition traversal optimizations''' - //todo<br />
*'''Event subscriptions''' - Allow event subscriptions or turn them off if you would like to make the piston a follow up style piston. If you disable this then you must have some other means for the piston to be fired.<br />
*'''Command execution delay''' - A delay in milliseconds for commands to be executed piston wide.<br />
<br />
==The ''define'' section==<br />
This menu is accessed from the piston editor. In the upper right hand corner select options and then enable <code>Show variables</code><br />
<br />
<br />
[[file:pistonoptions.png]]<br />
<br />
A very powerful feature of webCoRE is the ability to use [[Variable|variables]]. Think of variables as temporary pockets where you can store information and are able to later retrieve and use this information for any purpose. This information can be used either during the current piston run, or at a later time, when another event occurs.<br />
<br />
[[file:pistondefine.png|frameless|500px]]<br />
<br />
*'''Type''' - You can select from the different [[Variable_data_types|Variable Data Types]] for you variable.<br />
*'''Name''' - This is the empty box next to the type. Enter a name for your variable.<br />
*'''Initial value''' - This is defaulted to <code>Nothing selected</code>. If you decide to give it an initial value then that value will be used at each piston run regardless of what is stored in later piston runs.<br />
*'''Description''' - Give a description of what the variable is used for.<br />
<br />
==The ''execute'' section==<br />
This section describes the piston's logic flow. This is the starting point of most executions. Whenever a device event happens, the piston starts its execution here. To get started click on <code>Add a new statement</code><br />
<br />
[[file:executesimple.png|frameless|500px]]<br />
<br />
<br />
These are you 3 basic building blocks with their description listed below them. There are several more options to choose from aside from these three. In order to gain access to these you will again have to visit that trusty options menu in the top right hand corner and select <code>Show advanced statments</code><br />
<br />
[[file:pistonoptions.png]]<br />
<br />
<br />
After you do this and you click on <code>Add a new statement</code> you will now have access to all the available statement options.<br />
<br />
[[file:executeadvanced.png|frameless|500px]]<br />
<br />
=Misc Pages=<br />
==[[webCoRE Logging]]==<br />
==[[Functions]]==<br />
==[[Expressions]]==<br />
==[[Case_Traversal_Policy|Case Traversal Policy]]==<br />
==[[Execution_Method|Execution Method]]==<br />
==[[Piston_State|Piston State]]==<br />
==[[Task_Scheduling_Policy|Task Scheduling Policy]]==<br />
==[[Weather | Weather]]==<br />
==[[NFL | NFL API]]==<br />
<br />
<br />
<seo keywords="webCoRE,dashboard,smart home,automation,SmartThings,rule engine,zigbee,z-wave,smart device" description="The official wiki for webCoRE, the Web-enabled Community's own Rule Engine SmartApp"></seo></div>Ipatersonhttps://wiki.webcore.co/index.php?title=Creating_your_first_piston&diff=666Creating your first piston2017-11-12T12:37:05Z<p>Ipaterson: Copied from homepage</p>
<hr />
<div>Now that you have webCoRE installed and up to date, lets go ahead and walk through the steps to make a simple piston that will turn on a light switch when motion is active. From the dashboard.webcore.co main page just follow these easy steps.<br />
<br />
#We are going to click on '''Add a new piston''' in the upper left corner of the screen <br />
#:[[file:Addnewpiston.png]]<br />
#A dialog box will open and we want to choose '''Create a blank piston'''<br />
#:[[file:Createblank.png|500px]]<br />
#*Which will then open this dialog box<br />
#:[[file:Blankpiston.png|400px]] <br />
#Now simply fill in the Author (that is you!) and we will name this '''My First Piston - Motion Lights'''. We will also enable Automatic Backup by clicking on the no to change it to yes<br />
#:[[file:Blankpistonedited.png|400px]]<br />
#After clicking create we are brought to the Piston Editor/Script View. Click on '''Add a new statement'''<br />
#:[[file:Addstatement.png|600px]]<br />
#Click on '''Add an if'''<br />
#:[[file:Addanif.png|400px]]<br />
#Click on '''Add a condition'''<br />
#:[[file:addcondition.png|400px]]<br />
#Now we are going to select a motion sensor<br />
#The default is '''Physical Device(s)''', now click the middle box that says '''Nothing Selected''' and choose a motion sensor then select '''motion''' as the attribute<br />
#For the comparison select '''changes to''' under the '''Triggers''' category<br />
#Finally select '''active''' if not already selected and click '''Add'''<br />
#:[[file:Adddevice.png|400px]]<br />
#Now that we have our trigger, lets add an action by clicking on '''Add a new statement''' below the '''then'''<br />
#:[[file:Newcondition.png|600px]]<br />
#This time we want to do something so select '''Add an action'''<br />
#:[[file:Addaction.png|400px]]<br />
#Here you can search for the device to limit the drop down or scroll down to find it. Select the '''Switch/bulb''' you want to control<br />
#:[[file:Selectdevice.png|400px]]<br />
#Now we are going to select the command we want to use. Find '''Set Level...''' in the list and choose it.<br />
#:[[file:Addtask.png|400px]]<br />
#Before we add this task we want to set the level to '''100''' then click add<br />
#:[[file:Addtasksetlevel.png|400px]]<br />
#We have our simple motion lights piston all set up. Go ahead and finalize it by clicking save in the upper right corner.<br />
#:[[file:Finished.png|600px]]<br />
#This brings us to the overview page. This shows a vast amount of information about this individual piston. <br />
#:[[file:Myfirstpistonoverview.png|600px]]<br />
<br />
All that is left to do now is test your piston by walking past your motion sensor. Your light should turn on to 100% brightness. However due to the simplicity of this example there is no control to turn it off. But this was just a simple overview of creating a piston. Hope this helps get you started!</div>Ipatersonhttps://wiki.webcore.co/index.php?title=Variable&diff=665Variable2017-11-12T12:24:50Z<p>Ipaterson: Described superglobals, global update behavior, initial value</p>
<hr />
<div>A ''variable'' is a container for data that can be referenced or modified at a later time. Common uses of variables include<br />
<br />
* Tracking a value for use in the future <br />
* Communicating or tracking state between pistons<br />
* Avoiding repetitive code by storing data that needs to be used in multiple places in a piston<br />
<br />
<br />
==Variable scopes==<br />
===Local Variables===<br />
Local variables are owned by an individual piston. They are unique to each piston and are not shared, so multiple pistons can safely define local variables with the same name. <br />
<br />
The ''Show variables'' option in the piston editor enables a <code>define</code> block where variables are added. Local variables can have an ''initial value'' that is set every time the piston runs. If omitted, any value set to the variable will carry over for use in future executions of the piston.<br />
<br />
===Global Variables===<br />
Global variables are variables that are common to all pistons. They always start with the @ symbol and are available to all pistons in the same webCoRE instance.<br />
<br />
Any change made to a global variable by any piston is available for the next run of all other pistons within the same webCoRE instance. When a piston runs, a snapshot is taken of the global variables to ensure that they do not change unexpectedly while the piston is executing. For this reason, global variables cannot be used to "pass back a result" from the Execute piston action to its caller.<br />
<br />
===Superglobal Variables===<br />
Users with more than one webCoRE instance at a single location can share superglobal variables between those webCoRE instances. Use the @@ prefix to create a superglobal variable.<br />
<br />
==System Variables==<br />
System variables are local read-only variables that provide information about the environment and always have a $ prefix. They cannot be written to and their values are not necessarily constant (the same) during the whole piston run.<br />
<br />
==Variable Data Types==<br />
webCoRE supports a variety of data types, please review the [[Variable data types|variable data types]].</div>Ipatersonhttps://wiki.webcore.co/index.php?title=webCoRE&diff=664webCoRE2017-11-12T11:55:23Z<p>Ipaterson: /* Definitions */ Embedded Glossary page to replace the Definitions section</p>
<hr />
<div><youtube>jgXA_rv2-_8</youtube><br />
<br />
<div style="float: left; clear: both; margin-right: 2em; margin-top: 1em; margin-bottom: 1em;">__TOC__</div><br />
<br />
= General =<br />
The ''web Community's own Rule Engine'' (or for short, webCoRE) is a general rule engine for SmartThings. It works by allowing users to create scripts that are interpreted and executed by the SmartThings SmartApp, allowing for complex decisions. webCoRE is currently a work in progress. webCoRE reached the first Beta milestone on April 29, 2017. <br />
<br />
Currently webCoRE is in the Second Beta milestone as of June 7th, 2017. Lots of bugs have been squashed and several new features have been implemented. <br />
<br />
Please review the [[webCoRE todo]] list for a loose road map.<br />
<br />
=Definitions=<br />
{{:Glossary}}<br />
<br />
= Getting started =<br />
A few steps need to be completed before you can use webCoRE. First, webCoRE needs to be installed in your SmartThings account, then automations need to be configured. These are called [[Piston|pistons]] and will be detailed later. So let's start by installing webCoRE, please follow the steps below. <br />
<br />
Please be sure to read through all the instructions. If you are still getting stuck then check the troubleshooting sections. Should you still have problems then please feel free to ask for some help on the SmartThings Forums. Be sure to find the latest webCoRE help post.<br />
<br />
=Installing webCoRE=<br />
These instructions will guide you through installing webCoRE via GitHub integration or manually all the way to adding devices and authorizing your browser for use. Be sure to follow all the steps as proper order is crucial when installing for the first time.<br />
<br />
==GitHub Installation (preferred method)==<br />
# Login to the [http://ide.smartthings.com SmartThings IDE].<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''Settings''' button at the top of the page.<br />
#:[[File:Settings.jpg]]<br />
# Click the '''Add new repository''' link at the bottom of the pop up.<br />
# Enter <code>ady624</code> in the '''Owner''' column.<br />
# Enter <code>webCoRE</code> in the '''Name''' column.<br />
# Enter <code>master</code> in the '''Branch''' column.<br />
# Click '''Save''' (do not hit the Enter key, it will exit the form without saving).<br />
#:[[File:Githubrepo.jpg|frameless|400px]]<br />
# Click '''Update From Repo'''.<br />
# Select '''webCoRE (master)''' from the list.<br />
#:[[File:Update.jpg]]<br />
# Check "webCore.groovy" from the '''New (only in GitHub)''' box. {{Warning |Do not update all at once}}<br />
#:[[File:Githubinstall_webcoreonly.png]]<br />
# Check the '''Publish''' checkbox at the bottom of the pop up.<br />
#:[[File:Ide_update.png]]<br />
# Click the '''Execute Update''' button.<br />
#:[[File:Ide_update-new.png]]<br />
# Click again on '''Update From Repo'''.<br />
# Select '''webCoRE (master)''' from the list.<br />
#:[[File:Update.jpg]]<br />
# Check "webCoRE Piston.groovy", "webCoRE Storage.groovy"and "webCoRE Dashboard.groovy" from the '''New (only in GitHub)''' box.<br />
#:[[File:Githubinstall_allchecked.png]]<br />
# Check the '''Publish''' checkbox at the bottom of the pop up.<br />
#:[[File:Ide_update.png]]<br />
# Click the '''Execute Update''' button.<br />
#:[[File:Ide_update-new.png]]<br />
<br />
<br />
<br />
==Manual Install==<br />
<br />
<br />
=== webCoRE Smart App ===<br />
<br />
# Login to the [http://developer.smartthings.com SmartThings web UI].<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore.src/webcore.groovy webCore.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save'''.<br />
# Click '''Publish'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Piston Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-piston.src/webcore-piston.groovy webCoRE-piston.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Storage Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-storage.src/webcore-storage.groovy webCoRE-storage.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
=== webCoRE Dashboard Smart App ===<br />
<br />
# Click on '''My SmartApps'''.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the '''New SmartApp''' button.<br />
#:[[File:Newsmartapp.jpg]]<br />
# Select the '''From Code''' tab.<br />
#:[[File:Fromcode.jpg]]<br />
# Copy all of the code from the [https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-dashboard.src/webcore-dashboard.groovy webCoRE-dashboard.groovy] file into the box.<br />
# Click '''Create'''.<br />
#:[[File:Createcode.jpg|frameless|400px]]<br />
# Click '''Save''' and wait for the loading circle to disappear.<br />
# Click '''Publish''' and choose '''For Me'''.<br />
#:[[File:Savepublish.jpg]]<br />
<br />
<br />
<br />
==Enabling OAuth for webCoRE==<br />
# Navigate to the '''My SmartApps''' page if you are not already there.<br />
#:[[File:Mysmartapps.jpg]]<br />
# Click the edit button to the left of '''ady624 : webCoRE''', it looks like a rounded square with a pencil in it.<br />
#:[[File:Editwebcore.jpg]]<br />
# Scroll down and click on '''OAuth'''.<br />
# Click the '''Enable OAuth in SmartApp''' button.<br />
# Click the '''Update''' button at the bottom of the page.<br />
#:[[File:Oauth.jpg|frameless|600px]]<br />
<br />
<br />
<br />
==Installing webCoRE==<br />
# Open the SmartThings app on your mobile device.<br />
# Tap the '''Marketplace''' icon at the bottom of the screen. If you are in a Room or Device within the app you will need to go back to '''My Home'''.<br />
# Tap the '''SmartApps''' header at the top of the page.<br />
# Scroll down and tap '''My Apps'''.<br />
# Scroll down until you find '''webCoRE''' and tap it. Do not tap '''webCoRE Piston'''. If you can't find '''webCore''' you likely skipped some steps above.<br />
# Tap '''Next'''.<br />
# Here you can change the name from '''webCoRE''' to anything you desire then tap '''Next'''. (''Recommend leaving it unless you are working with multiple instances.'')<br />
# Choose a password and expiration length then tap '''Next'''.<br />
# Scroll through the list and select all of the devices you want webCoRE to have access to. If you do not do this, you will not be able to use those devices in webCoRE. This must also be done again when adding new devices to your SmartThings Account. webCoRE will not automatically import them.<br />
# Tap '''Next'''.<br />
# Tap '''Done'''.<br />
<br />
<br />
<br />
==Opening the new dashboard from your phone==<br />
# From within the SmartThings app, tap the Automations icon at the bottom of the screen and select the SmartApps section.<br />
# Scroll down and tap the name of the webCoRE instance you are trying to access. This is typically webCoRE, unless you edited the name during the installation process.<br />
# Tap Dashboard.<br />
# You will be prompted to enter the security password, the same password you created when you installed webCoRE.<br />
<br />
<br />
<br />
==Using webCoRE from another browser==<br />
You cannot bookmark the URL you launched from the SmartThing app. In order to use webCoRE on another device you must follow these instructions.<br />
<br />
# From within the SmartThings app, tap the '''Automations''' icon at the bottom of the screen and select the '''SmartApps''' section.<br />
# Scroll down and tap the name of the webCoRE instance you are trying to access. This is typically '''webCoRE''', unless you edited the name during the installation process.<br />
# Tap '''Register a browser''', a page will appear providing you with a registration code. The code expires in 3 minutes and can only be used once.<br />
#: [[File:Register-browser.png|Register a Browser]] [[File:Register-browser-code.png|Register a Browser]]<br />
# On your other device, open the browser and visit <i>[https://webcore.co/re webcore.co/re]</i><br />
# Enter the code and click '''Register'''.<br />
# You will be prompted to enter the security password, the same password you created when you installed webCoRE.<br />
<br />
<br />
<br />
= Updating webCoRE =<br />
[[file:UpdateAlert.png]]<BR><br />
When you see the alert that there is a new version available or that your smartapps are not the same version then you will need to update the webCoRE code. This has a few benefits besides being on the latest and greatest version. It is best to keep webCoRE up to date because bugs are constantly getting squashed and new features added with each version. This will make troubleshooting easier when you are running into issues and seeking help. Lastly SmartThings keeps the most used SmartApps in their cache which means quicker response times on your pistons. <br />
<br />
For those of you with gitHub integration this is a quick and painless process. If you manually installed then it is a similar process as before. Either way updating only takes a few minutes of your time. <br />
<br />
== GitHub ==<br />
#Log into the SmartThings IDE<br />
#Select My SmartApps<br />
#*You will see all the webCoRE SmartApps listed in a purple color<br />
#Click update from Repo<br />
#Select webCoRE(Master)<br />
#*In the Obsolete column you will see the 4 webCoRE SmartApps<br />
#Select all 4 checkboxes<br />
#Click the publish checkbox<br />
#Click Execute Update<br />
<br />
== Manual Update == <br />
This requires a little bit more work than gitHub integration but still will only take a few moments. Visit the links below and copy and paste the new raw code over the obsolete code then publish and execute update.<br />
<br />
<br />
{| class="wikitable"<br />
|+ Link to Raw gitHub code<br />
|-<br />
! webCoRE<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore.src/webcore.groovy<br />
|-<br />
! webCoRE Dashboard<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-dashboard.src/webcore-dashboard.groovy<br />
|-<br />
! webCoRE Piston<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-piston.src/webcore-piston.groovy<br />
|-<br />
! webCoRE Storage<br />
| https://raw.githubusercontent.com/ady624/webCoRE/master/smartapps/ady624/webcore-storage.src/webcore-storage.groovy<br />
|}<br />
<br />
== Update Complete ==<br />
That is all you have to do. Your webCoRE instance's are now up to date. However if you have multiple locations(hubs) then you will need to do this for each location(hub).<br />
<br />
=Troubleshooting=<br />
Here are some common troubleshooting things to try if you are having issues with the following categories<br />
<br />
==Installation==<br />
[[File:500error.png|frameless|400px]]<br><br />
<br />
If you receive this error it may be because you installed and published both "webCore.groovy" and other SmartApps at the same time. Please do them in order per the instructions. Be sure to install/publish "webCore.groovy" first then the others after (See steps 11-16). You can do the other SmartApps at the same time after "webCore.groovy" has been installed and published.<br />
<br />
<br />
==General==<br />
Endless Spinning Square<br />
#Open The SmartThings App<br />
#Go into settings<br />
#Click the map location<br />
#Move the pin on the map around<br />
#Position on your actual location<br />
#save actual location<br />
#Save the settings<br />
<br />
<br />
= Creating your first piston =<br />
<br />
Now that you have webCoRE installed and up to date, lets go ahead and walk through the steps to make a simple piston that will turn on a light switch when motion is active. From the dashboard.webcore.co main page just follow these easy steps.<br />
<br />
#We are going to click on '''Add a new piston''' in the upper left corner of the screen <br />
#:[[file:Addnewpiston.png]]<br />
#A dialog box will open and we want to choose '''Create a blank piston'''<br />
#:[[file:Createblank.png|500px]]<br />
#*Which will then open this dialog box<br />
#:[[file:Blankpiston.png|400px]] <br />
#Now simply fill in the Author (that is you!) and we will name this '''My First Piston - Motion Lights'''. We will also enable Automatic Backup by clicking on the no to change it to yes<br />
#:[[file:Blankpistonedited.png|400px]]<br />
#After clicking create we are brought to the Piston Editor/Script View. Click on '''Add a new statement'''<br />
#:[[file:Addstatement.png|600px]]<br />
#Click on '''Add an if'''<br />
#:[[file:Addanif.png|400px]]<br />
#Click on '''Add a condition'''<br />
#:[[file:addcondition.png|400px]]<br />
#Now we are going to select a motion sensor<br />
#The default is '''Physical Device(s)''', now click the middle box that says '''Nothing Selected''' and choose a motion sensor then select '''motion''' as the attribute<br />
#For the comparison select '''changes to''' under the '''Triggers''' category<br />
#Finally select '''active''' if not already selected and click '''Add'''<br />
#:[[file:Adddevice.png|400px]]<br />
#Now that we have our trigger, lets add an action by clicking on '''Add a new statement''' below the '''then'''<br />
#:[[file:Newcondition.png|600px]]<br />
#This time we want to do something so select '''Add an action'''<br />
#:[[file:Addaction.png|400px]]<br />
#Here you can search for the device to limit the drop down or scroll down to find it. Select the '''Switch/bulb''' you want to control<br />
#:[[file:Selectdevice.png|400px]]<br />
#Now we are going to select the command we want to use. Find '''Set Level...''' in the list and choose it.<br />
#:[[file:Addtask.png|400px]]<br />
#Before we add this task we want to set the level to '''100''' then click add<br />
#:[[file:Addtasksetlevel.png|400px]]<br />
#We have our simple motion lights piston all set up. Go ahead and finalize it by clicking save in the upper right corner.<br />
#:[[file:Finished.png|600px]]<br />
#This brings us to the overview page. This shows a vast amount of information about this individual piston. <br />
#:[[file:Myfirstpistonoverview.png|600px]]<br />
<br />
All that is left to do now is test your piston by walking past your motion sensor. Your light should turn on to 100% brightness. However due to the simplicity of this example there is no control to turn it off. But this was just a simple overview of creating a piston. Hope this helps get you started!<br />
<br />
=Sample Pistons=<br />
This section has some user contributed sample pistons. You can import any of these pistons using the import code displayed at the top of the piston.<br />
# [[Samples]]<br />
<br />
= Understanding the basics =<br />
webCoRE is comprised of the three main components listed below.<br />
<br />
== The webCoRE child SmartApp (''webCoRE Piston'') ==<br />
The webCoRE child SmartApp is also known as a [[Piston|piston]]. It is responsible for executing the automation script that the user creates and does the heavy lifting in the whole webCoRE ecosystem. It is directly managed by the webCoRE parent SmartApp, which can create, maintain, and delete a Piston.<br />
<br />
== The webCoRE parent SmartApp (''webCoRE'') ==<br />
The wabCoRE parent SmartApp is the component responsible for managing the child SmartApp instances and their relationship with the Dashboard. It is the middle man that allows adding new Pistons, maintaining them, or deleting them. It is also responsible with the security of the whole ecosystem, allowing password secured access from the Dashboard.<br />
<br />
== The [[Dashboard|dashboard]] ==<br />
The Dashboard is an [https://en.wikipedia.org/wiki/HTML HTML] interface for webCoRE that allows users to manage their webCoRE installation. It is the central hub to controlling webCoRE, allowing the user to create, modify, test, and delete Pistons.<br />
<br />
=Anatomy of a webCoRE Piston=<br />
::''Main article [[Piston]]''<br />
A piston is a script that contains a collection of elements, arranged so that the logic and flow of the piston perform tasks in a desired sequence. It is broken down into several sections, each having its own important role.<br />
<br />
//todo: most details below need to be moved into the main article<br />
<br />
==The ''settings'' section==<br />
This menu is accessed from the piston editor. In the upper right hand corner select options and then enable <code>Show piston settings</code><br />
<br />
<br />
[[file:pistonoptions.png]]<br />
<br />
These settings allows configuration of how certain aspects of the piston function. <br />
<br />
[[file:pistonsettings.png|frameless|500px]]<br />
<br />
*'''Name''' - Change the name of a piston.<br />
*'''Description''' - Give a description of what the piston does.<br />
*'''Automatic piston state''' - Change whether the piston handles it state or make it manual and you can control the piston's state.<br />
*'''Piston execution parallelism''' - //todo<br />
*'''Condition traversal optimizations''' - //todo<br />
*'''Event subscriptions''' - Allow event subscriptions or turn them off if you would like to make the piston a follow up style piston. If you disable this then you must have some other means for the piston to be fired.<br />
*'''Command execution delay''' - A delay in milliseconds for commands to be executed piston wide.<br />
<br />
==The ''define'' section==<br />
This menu is accessed from the piston editor. In the upper right hand corner select options and then enable <code>Show variables</code><br />
<br />
<br />
[[file:pistonoptions.png]]<br />
<br />
A very powerful feature of webCoRE is the ability to use [[Variable|variables]]. Think of variables as temporary pockets where you can store information and are able to later retrieve and use this information for any purpose. This information can be used either during the current piston run, or at a later time, when another event occurs.<br />
<br />
[[file:pistondefine.png|frameless|500px]]<br />
<br />
*'''Type''' - You can select from the different [[Variable_data_types|Variable Data Types]] for you variable.<br />
*'''Name''' - This is the empty box next to the type. Enter a name for your variable.<br />
*'''Initial value''' - This is defaulted to <code>Nothing selected</code>. If you decide to give it an initial value then that value will be used at each piston run regardless of what is stored in later piston runs.<br />
*'''Description''' - Give a description of what the variable is used for.<br />
<br />
==The ''execute'' section==<br />
This section describes the piston's logic flow. This is the starting point of most executions. Whenever a device event happens, the piston starts its execution here. To get started click on <code>Add a new statement</code><br />
<br />
[[file:executesimple.png|frameless|500px]]<br />
<br />
<br />
These are you 3 basic building blocks with their description listed below them. There are several more options to choose from aside from these three. In order to gain access to these you will again have to visit that trusty options menu in the top right hand corner and select <code>Show advanced statments</code><br />
<br />
[[file:pistonoptions.png]]<br />
<br />
<br />
After you do this and you click on <code>Add a new statement</code> you will now have access to all the available statement options.<br />
<br />
[[file:executeadvanced.png|frameless|500px]]<br />
<br />
=Misc Pages=<br />
==[[webCoRE Logging]]==<br />
==[[Functions]]==<br />
==[[Expressions]]==<br />
==[[Case_Traversal_Policy|Case Traversal Policy]]==<br />
==[[Execution_Method|Execution Method]]==<br />
==[[Piston_State|Piston State]]==<br />
==[[Task_Scheduling_Policy|Task Scheduling Policy]]==<br />
==[[Weather | Weather]]==<br />
==[[NFL | NFL API]]==<br />
<br />
<br />
<seo keywords="webCoRE,dashboard,smart home,automation,SmartThings,rule engine,zigbee,z-wave,smart device" description="The official wiki for webCoRE, the Web-enabled Community's own Rule Engine SmartApp"></seo></div>Ipatersonhttps://wiki.webcore.co/index.php?title=Glossary&diff=663Glossary2017-11-12T11:53:09Z<p>Ipaterson: Moved from the homepage for permalinking</p>
<hr />
<div>*'''Piston''': These are your rules inside of webCoRE.<br />
*'''Instance''': Each installation of webCoRE is considered a seperate instance. You may have only 1 or several.<br />
*'''Variable''': A container of information that is local to a piston.<br />
*'''Global Variable''': A container of information that is accessible by all pistons in the same instance.<br />
*'''Super Global Variable''': A container of information that is accessible across locations.<br />
*'''Location''': SmartThings hubs are considered a location.<br />
*'''Dashboard (beta)''': Currently does nothing besides display your devices all in one page.<br />
*'''Fuel Stream (beta)''': Displays logged data in pretty graphs. <br />
*'''Blank Piston''': Create a new piston from scratch.<br />
*'''Duplicate Piston''': Create a carbon copy of another piston from any of your instances.<br />
*'''Template Piston''': There is currently no templates, so this method has yet to be implemented.<br />
*'''Restore Piston''': Allows you to import a piston from other users backup bin code.<br />
*'''Import Piston''': Allows you to import a backup of your pistons.<br />
*'''Backup Bin Code''': This is an alphanumeric code that can be used to import pistons from other users.</div>Ipaterson