Thank you and thank you.
Is it possible to have condition like "If weather is cloudy then offset -30 minutes else offset 0 minutes"
Great news, thanks to you all, the Piston did fire at offset = 0 minutes as the weather was clear today. But the fade is still not working. I am not sure why, but the logs are not printing even though i have the logging set to Full. Looks like the piston is repeatedly sending set color temp instead of level.
Is there a simple way to add more options than ‘cloudy’ without duplicating the entire line and using ‘||’ (or’s)?
For example, ‘cloudy’ or ‘rain’ or ‘overcast’… etc…
I’m afraid not… you have to duplicate and use ||'s outside of the contains() function
contains(lower($weather.conditions.current_observation.weather),‘cloudy’)||contains(lower($weather.conditions.current_observation.weather),‘rain’)||contains(lower($weather.conditions.current_observation.weather),‘overcast’)
I agree it would certainly be nice to use logical operators within the contains() function, i.e.:
contains(lower($weather.conditions.current_observation.weather),‘cloudy’||‘rain’||‘overcast’)
Or in this case, might be simpler to just negate it. If it’s not clear, then it must be some type of cloudy/rainy, etc.
!contains(lower($weather.conditions.current_observation.weather),‘clear’)
ah, man . Does WU publish a list of all possible conditions?
I said “clear” because I checked the value yesterday when the weather here was sunny (and clear), it returned “clear” not ‘sunny’… But who knows what value they may throw in there.
Ta da. You can use a regular expression as the second argument to the matches
function. If not sure what a regular expression is, this example is easy enough to follow for this simple case… just be careful if you’re matching anything with “special characters”
matches('it is cloudy', '/cloudy|rain|overcast/')
I did some more digging on this…
Within the Smartthings App, you can download ‘AccuWeather Connect’ that shows up as a ‘Thing’ and device in webCoRE. I noticed there’s an attribute called ‘cloudCover’ that updates itself.
I think what is trying to be accomplished here is that if there’s ‘X’ cloudcover, turn on the lights. I mean if you’re in Hawaii, it could be raining and sunny out.
Doing a quick google search, it describes cloud cover that better helped me decide what percent to use: http://www.theweatherprediction.com/habyhints/189/
I liked the initial idea when I read this thread, however there were too many obstacles I found (like others have mentioned) and found this as a possible alternate solution in case anyone is interested.
That’s good information. I installed AccuWeather Connect and it works good… Pretty easy to evaluate cloudCover, it gives me a 0-100 scale. I was able to access the current value using [AccuWeather : cloudCover]
Thanks!
I have the oh so pleasure of going to the wonderful world of Bracknell a couple times a year for work … Somehow the sun was always out “for a couple days” the week before I arrive … but never while there LOL
This is the most complete list I have been able to gather up when querying WUnderground.
weather.conditions.current_observation.weather
Current Condition Phrases
Some conditions can be Light, Heavy or normal, which has no classifier. For example, Light Drizzle, Heavy Drizzle, and Drizzle are all possible conditions.
[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
Using the weather feature
Don’t know if it helps at all, but I’ve got this going on using the weather device in ST. It’s been a while since I added that so I don’t quite remember.
@allrak - can you share your cloud coverage piston? I have the Accuweather Smartapp installed but can’t get my piston to fire.
Mine runs on a timer every 10 minutes:
It writes to a fuel stream, as well as a global variable which is used in a few other pistons.
…and it draws a tile:
Using this code:
(The 71 in the hover text is WUndergrounds Cloud Coverage… Often quite different, but usually more accurate for my location)
Here is a visual comparison of Cloud Coverage when comparing
WUnderground (blue) and AccuWeather (red)
The code I used for WUnderground is actually a forecast for this hour:
(but you can see it changes almost every ten minutes)
Here’s one that uses cloud cover to turn on my deck lighting. You can ignore the “test” variable in the piston.