[Tasker Tips & Tricks] alray:
What system are you using to control your light? I know how to do it using Z-wave and Vera + HomeBuddy + Tasker, its pretty easy to use tasker to trigger Automated Scene in Vera

You can use the method posted above to set your local weather in a variable then use this variable and either the "State --> Phone ---> Cell Near" or "Location(GPS)" condition to trigger a task that will send and intent to Homebuddy to start a Vera scene (homebuddy is an app to control your Vera scenes). So if your are connected to your local tower (or your GPS position is home) + your local weather is bad = send an intent to homebuddy that will turn on the lights.

Edit:

Here is how you do it using a Vera z-wave hub (Vera lite/2/3):

-Log in your Vera account, go to the Automation menu and create a new scene that will simply turn on the desired lights. Take note of your scene number.

-Make an account (free) at weatherunderground.com to get a user key: www.wunderground.com/weather/api/ once registered take note of your key

-Download HomeBuddy on your phone (yes I know the app is old and did not get any updated for a while but its working good to make Tasker talk to your Vera hub)

-Launch homebuddy and setup your Vera serial number, Username and Password

-Then go in Tasker and create a new task (I have named mine "Get Weather") and add the following actions in your task:

Action #1

HTTP Get

Server:Port: api.wunderground.com

Path: /api/your_key/conditions/q/your_location.xml

*replace "your_key" by your weatherunderground.com key and "your_location" by your gps location. You can use Google Maps to find your GPS location. e.g: New York is 40.690917,-74.047185. By default there is a space between your latitude and longitude values when you copy it from google maps, you need to remove it. Lets say you are at New York and your key is abcdef123456789 then the Path will be: /api/abcdef123456789/conditions/q/40.690917,-74.047185.xml

This will set your %HTTPD variable to this value:

<response>
<version>0.1</version>
<termsofService>
http://www.wunderground.com/weather/api/d/terms.html
</termsofService>
<features>
<feature>conditions</feature>
</features>
[B][COLOR="Red"]<current_observation>[/COLOR][/B]
<image>
<url>http://icons.wxug.com/graphics/wu2/logo_130x80.png</url>
<title>Weather Underground</title>
<link>http://www.wunderground.com</link>
</image>
<display_location>
<full>Jersey City, NJ</full>
<city>Jersey City</city>
<state>NJ</state>
<state_name>New Jersey</state_name>
<country>US</country>
<country_iso3166>US</country_iso3166>
<zip>07303</zip>
<magic>1</magic>
<wmo>99999</wmo>
<latitude>40.690917</latitude>
<longitude>-74.047185</longitude>
<elevation>3.00000000</elevation>
</display_location>
<observation_location>
<full>NJWxNet, Jersey City, New Jersey</full>
<city>NJWxNet, Jersey City</city>
<state>New Jersey</state>
<country>US</country>
<country_iso3166>US</country_iso3166>
<latitude>40.708744</latitude>
<longitude>-74.053070</longitude>
<elevation>6 ft</elevation>
</observation_location>
<estimated></estimated>
<station_id>MNJ12</station_id>
<observation_time>Last Updated on January 16, 2:25 AM EST</observation_time>
<observation_time_rfc822>Sat, 16 Jan 2016 02:25:00 -0500</observation_time_rfc822>
<observation_epoch>1452929100</observation_epoch>
<local_time_rfc822>Sat, 16 Jan 2016 03:01:09 -0500</local_time_rfc822>
<local_epoch>1452931269</local_epoch>
<local_tz_short>EST</local_tz_short>
<local_tz_long>America/New_York</local_tz_long>
<local_tz_offset>-0500</local_tz_offset>
[B][COLOR="DarkOrange"]<weather>[/COLOR][/B][B][COLOR="SeaGreen"]Overcast[/COLOR][/B][B][COLOR="darkorange"]</weather>[/COLOR][/B]
<temperature_string>44 F (6.7 C)</temperature_string>
<temp_f>44</temp_f>
<temp_c>6.7</temp_c>
<relative_humidity>96%</relative_humidity>
<wind_string>From the NNE at 5 MPH Gusting to 11.0 MPH</wind_string>
<wind_dir>NNE</wind_dir>
<wind_degrees>32</wind_degrees>
<wind_mph>5</wind_mph>
<wind_gust_mph>11.0</wind_gust_mph>
<wind_kph>8.0</wind_kph>
<wind_gust_kph>17.7</wind_gust_kph>
<pressure_mb>996</pressure_mb>
<pressure_in>29.41</pressure_in>
<pressure_trend>+</pressure_trend>
<dewpoint_string>43 F (6 C)</dewpoint_string>
<dewpoint_f>43</dewpoint_f>
<dewpoint_c>6</dewpoint_c>
<heat_index_string>NA</heat_index_string>
<heat_index_f>NA</heat_index_f>
<heat_index_c>NA</heat_index_c>
<windchill_string>41 F (5 C)</windchill_string>
<windchill_f>41</windchill_f>
<windchill_c>5</windchill_c>
<feelslike_string>41 F (5 C)</feelslike_string>
<feelslike_f>41</feelslike_f>
<feelslike_c>5</feelslike_c>
<visibility_mi>10.0</visibility_mi>
<visibility_km>16.1</visibility_km>
<solarradiation/>
<UV>0</UV>
<precip_1hr_string>0.00 in ( 0 mm)</precip_1hr_string>
<precip_1hr_in>0.00</precip_1hr_in>
<precip_1hr_metric>0</precip_1hr_metric>
<precip_today_string>in ( mm)</precip_today_string>
<precip_today_in/>
<precip_today_metric/>
<icon>cloudy</icon>
<icon_url>http://icons.wxug.com/i/c/k/nt_cloudy.gif</icon_url>
<forecast_url>http://www.wunderground.com/US/NJ/Jersey_City.html</forecast_url>
<history_url>
http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=MNJ12
</history_url>
<ob_url>
http://www.wunderground.com/cgi-bin/findweather/getForecast?query=40.708744,-74.053070
</ob_url>
[B][COLOR="red"]</current_observation>[/COLOR][/B]
</response>

The information we need (the actual weather condition) is inside the <weather> and </weather> tags which are inside the <current_observation> and </current_observation> tags. We'll need to split everything so we end up having a variable that is simply the current weather But first we need to create another variable to replace %HTTPD because it can be overwritten by any other task using this variable.

Action #2

Variable Set

Name: %weather

To: %HTTPD

So now we can work with our own %weather variable instead of %HTTPD

Action #3

Variable Split

Name: %weather

Splitter: <current_observation>

This will create a new Variable named %weather2 which will be equal to the information present after the <current_observation>

<image>
<url>http://icons.wxug.com/graphics/wu2/logo_130x80.png</url>
<title>Weather Underground</title>
<link>http://www.wunderground.com</link>
</image>
<display_location>
<full>Jersey City, NJ</full>
<city>Jersey City</city>
<state>NJ</state>
<state_name>New Jersey</state_name>
<country>US</country>
<country_iso3166>US</country_iso3166>
<zip>07303</zip>
<magic>1</magic>
<wmo>99999</wmo>
<latitude>40.690917</latitude>
<longitude>-74.047185</longitude>
<elevation>3.00000000</elevation>
</display_location>
<observation_location>
<full>NJWxNet, Jersey City, New Jersey</full>
<city>NJWxNet, Jersey City</city>
<state>New Jersey</state>
<country>US</country>
<country_iso3166>US</country_iso3166>
<latitude>40.708744</latitude>
<longitude>-74.053070</longitude>
<elevation>6 ft</elevation>
</observation_location>
<estimated></estimated>
<station_id>MNJ12</station_id>
<observation_time>Last Updated on January 16, 2:25 AM EST</observation_time>
<observation_time_rfc822>Sat, 16 Jan 2016 02:25:00 -0500</observation_time_rfc822>
<observation_epoch>1452929100</observation_epoch>
<local_time_rfc822>Sat, 16 Jan 2016 03:01:09 -0500</local_time_rfc822>
<local_epoch>1452931269</local_epoch>
<local_tz_short>EST</local_tz_short>
<local_tz_long>America/New_York</local_tz_long>
<local_tz_offset>-0500</local_tz_offset>
[B][COLOR="DarkOrange"]<weather>[/COLOR][/B][B][COLOR="SeaGreen"]Overcast[/COLOR][/B][B][COLOR="darkorange"]</weather>[/COLOR][/B]
<temperature_string>44 F (6.7 C)</temperature_string>
<temp_f>44</temp_f>
<temp_c>6.7</temp_c>
<relative_humidity>96%</relative_humidity>
<wind_string>From the NNE at 5 MPH Gusting to 11.0 MPH</wind_string>
<wind_dir>NNE</wind_dir>
<wind_degrees>32</wind_degrees>
<wind_mph>5</wind_mph>
<wind_gust_mph>11.0</wind_gust_mph>
<wind_kph>8.0</wind_kph>
<wind_gust_kph>17.7</wind_gust_kph>
<pressure_mb>996</pressure_mb>
<pressure_in>29.41</pressure_in>
<pressure_trend>+</pressure_trend>
<dewpoint_string>43 F (6 C)</dewpoint_string>
<dewpoint_f>43</dewpoint_f>
<dewpoint_c>6</dewpoint_c>
<heat_index_string>NA</heat_index_string>
<heat_index_f>NA</heat_index_f>
<heat_index_c>NA</heat_index_c>
<windchill_string>41 F (5 C)</windchill_string>
<windchill_f>41</windchill_f>
<windchill_c>5</windchill_c>
<feelslike_string>41 F (5 C)</feelslike_string>
<feelslike_f>41</feelslike_f>
<feelslike_c>5</feelslike_c>
<visibility_mi>10.0</visibility_mi>
<visibility_km>16.1</visibility_km>
<solarradiation/>
<UV>0</UV>
<precip_1hr_string>0.00 in ( 0 mm)</precip_1hr_string>
<precip_1hr_in>0.00</precip_1hr_in>
<precip_1hr_metric>0</precip_1hr_metric>
<precip_today_string>in ( mm)</precip_today_string>
<precip_today_in/>
<precip_today_metric/>
<icon>cloudy</icon>
<icon_url>http://icons.wxug.com/i/c/k/nt_cloudy.gif</icon_url>
<forecast_url>http://www.wunderground.com/US/NJ/Jersey_City.html</forecast_url>
<history_url>
http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=MNJ12
</history_url>
<ob_url>
http://www.wunderground.com/cgi-bin/findweather/getForecast?query=40.708744,-74.053070
</ob_url>
[B][COLOR="red"]</current_observation>[/COLOR][/B]

Now we need to split it again

Action #4

Variable Split

Name: %weather2

Splitter: <weather>

Now you'll have the %weather22 variable which will be equal to the information present after the <weather> tag:

[B][COLOR="SeaGreen"]Overcast[/COLOR][/B][B][COLOR="darkorange"]</weather>[/COLOR][/B]
<temperature_string>44 F (6.7 C)</temperature_string>
<temp_f>44</temp_f>
<temp_c>6.7</temp_c>
<relative_humidity>96%</relative_humidity>
<wind_string>From the NNE at 5 MPH Gusting to 11.0 MPH</wind_string>
<wind_dir>NNE</wind_dir>
<wind_degrees>32</wind_degrees>
<wind_mph>5</wind_mph>
<wind_gust_mph>11.0</wind_gust_mph>
<wind_kph>8.0</wind_kph>
<wind_gust_kph>17.7</wind_gust_kph>
<pressure_mb>996</pressure_mb>
<pressure_in>29.41</pressure_in>
<pressure_trend>+</pressure_trend>
<dewpoint_string>43 F (6 C)</dewpoint_string>
<dewpoint_f>43</dewpoint_f>
<dewpoint_c>6</dewpoint_c>
<heat_index_string>NA</heat_index_string>
<heat_index_f>NA</heat_index_f>
<heat_index_c>NA</heat_index_c>
<windchill_string>41 F (5 C)</windchill_string>
<windchill_f>41</windchill_f>
<windchill_c>5</windchill_c>
<feelslike_string>41 F (5 C)</feelslike_string>
<feelslike_f>41</feelslike_f>
<feelslike_c>5</feelslike_c>
<visibility_mi>10.0</visibility_mi>
<visibility_km>16.1</visibility_km>
<solarradiation/>
<UV>0</UV>
<precip_1hr_string>0.00 in ( 0 mm)</precip_1hr_string>
<precip_1hr_in>0.00</precip_1hr_in>
<precip_1hr_metric>0</precip_1hr_metric>
<precip_today_string>in ( mm)</precip_today_string>
<precip_today_in/>
<precip_today_metric/>
<icon>cloudy</icon>
<icon_url>http://icons.wxug.com/i/c/k/nt_cloudy.gif</icon_url>
<forecast_url>http://www.wunderground.com/US/NJ/Jersey_City.html</forecast_url>
<history_url>
http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=MNJ12
</history_url>
<ob_url>
http://www.wunderground.com/cgi-bin/findweather/getForecast?query=40.708744,-74.053070
</ob_url>
[B][COLOR="red"]</current_observation>[/COLOR][/B]

Now we need to split one last time to wipe evertyhing after the </weather> tag to keep only the "Overcast" value:

Action #5

Variable Split

Name: %weather22

Splitter: </weather>

Now you'll have the %weather221 variable which will be equal to the information present before the </weather> tag:

[COLOR="SeaGreen"][B]Overcast[/B][/COLOR]

Now we can save this value in another variable so its safe:

Action #6

Variable Set

Name: %CURRENTWEATHER

To: %weather221

so in this example %CURRENTWEATHER = Overcast

Action #7

If

Condition: %CURRENTWEATHER doesn't match Clear

(If weather isn't clear ---> bad weather)

Action #8

Send Intent

Action: android.intent.action.VIEW

Data: homebuddy://activate?vera=<your_vera_serial_number>&<your_scene_number>

Target: Activity

replace your_vera_serial_number and your_scene_number by the correct value (don't forget to remove the <> symbols)

Action #9

End If

Now you're done. If the weather isn't clear, tasker will send an intent to homebuddy which will then send the command to your Vera to trigger the scene you have made to turn on your lights.

Now you only need to create a Profile that triggers this task based on your location either with the Cell Near function or Location function. You could also trigger the Task when our phone is connected to your home wifi (specific SSID) so the Task only runs when you are near your door (if you get wifi at the door).

Finally you might think I forgot about that "turn on the lights" at sunset thing... No need to use Tasker for that (even if that could be done). There is a simple Vera app to detect sunset and sunrise which you can use to trigger the same scene. Its called "Day or Night"

That's it, hope it will help some of you. :good:

For reference, the weather conditions that can be present between the <weather> and </weather> tags are

[Light/Heavy] Drizzle
[Light/Heavy] Rain
[Light/Heavy] Snow
[Light/Heavy] Snow Grains
[Light/Heavy] Ice Crystals
[Light/Heavy] Ice Pellets
[Light/Heavy] Hail
[Light/Heavy] Mist
[Light/Heavy] Fog
[Light/Heavy] Fog Patches
[Light/Heavy] Smoke
[Light/Heavy] Volcanic Ash
[Light/Heavy] Widespread Dust
[Light/Heavy] Sand
[Light/Heavy] Haze
[Light/Heavy] Spray
[Light/Heavy] Dust Whirls
[Light/Heavy] Sandstorm
[Light/Heavy] Low Drifting Snow
[Light/Heavy] Low Drifting Widespread Dust
[Light/Heavy] Low Drifting Sand
[Light/Heavy] Blowing Snow
[Light/Heavy] Blowing Widespread Dust
[Light/Heavy] Blowing Sand
[Light/Heavy] Rain Mist
[Light/Heavy] Rain Showers
[Light/Heavy] Snow Showers
[Light/Heavy] Snow Blowing Snow Mist
[Light/Heavy] Ice Pellet Showers
[Light/Heavy] Hail Showers
[Light/Heavy] Small Hail Showers
[Light/Heavy] Thunderstorm
[Light/Heavy] Thunderstorms and Rain
[Light/Heavy] Thunderstorms and Snow
[Light/Heavy] Thunderstorms and Ice Pellets
[Light/Heavy] Thunderstorms with Hail
[Light/Heavy] Thunderstorms with Small Hail
[Light/Heavy] Freezing Drizzle
[Light/Heavy] Freezing Rain
[Light/Heavy] Freezing Fog
Patches of Fog
Shallow Fog
Partial Fog
Overcast
Clear
Partly Cloudy
Mostly Cloudy
Scattered Clouds
Small Hail
Squalls
Funnel Cloud
Unknown Precipitation
Unknown

So you might want to add some more values than only "Clear" at action #7 cause there are other weather values where its still sunny enough outside and you don't need to turn on the lights...

You could also use AutoVera instead of homebuddy to make the bridge between your Vera and Tasker (its a tasker plugin). The advantage of using hommebuddy is that its free, not AutoVera