Not sure if there is a video, but this may get you going until Josh has a moment to respond.
The basic idea is to get the current month in a variable. Once you’re done that, you can use that as a condition in your rule to run it only during the months you choose. You are going to do that by coding a HTTP Get which will return the current month and will be stored in a variable.
1 - Create a variable named ‘month’ for example
2 - Create a rule that runs once a day at some arbitrary time, best in the morning if in the US or Canada.
3 - In the Flow section of the rule, create an Action, HTTP, GET. Put the URL https://lab.sharptools.dev/date in the URL field. (You can add a timezone for granularity, but it shouldn’t matter if you have the rule run in the morning.)
4 - That GET URL will return the month, among other data. You then need to tell the rule to store the month value returned in your variable.
5 - Action, Set Variable and choose your ‘month’ variable. Source:Variable, Context Variables Tab, Response, HTTP, Response Data, Put ‘M’ in the Input Data Key.
When this rule runs, it will obtain the month and place the month as a numerical value into your variable. Go to the variables section where you created the variable and you’ll see the value populated. If you’re doing this in September, the value will be 9. You can now use the ‘month’ variable in your rule in an IF statement to determine whether or not your rule should run based on the value of the ‘month’ variable.
If you have a SmartWeather device which uses the same data source, you can pull the data off that device fairly easily.
…it’s not clear if the SmartWeather device will continue to exist after the Groovy shutdown though. It’s a cloud integration that uses the same TWC source, but the DTH itself is Groovy, so I’m not sure if they will handle it in a special way with the shutdown.
As an alternative, you can setup an Open Weather Map account and can query the data. It’s a few steps to get setup, but once you have the concept down, it provides a lot of functionality:
I’m pulling from The Weather Channel. I am going to try the steps that @Bry sent me for the Month and see if I can get the forecast for “Tomorrow”. It is not a SmartWeather device. Seems to be the same concept. There was a reason I had to pull at 11:50 PM, but I currently can’t recall why. I believe it may have been a time zone issue.
Do you think I can set a variable using data from The Weather Channel?
Not without an API call. WebCoRE was running as a Groovy SmartApp, so it could access the TWC data from the SmartThings Groovy API directly. Of course Groovy is on it’s way out…
The SmartWeather device is using the same data source – I can’t remember exactly what data it exposes, but if that device had the required attributes, you could use it. (Other hubs have a variety of different weather ‘devices’, but for whatever reason, there weren’t a lot of different weather devices created by the community in the SmartThings ecosystem)
Otherwise, if you don’t have a weather device available, making an API call as linked above would be the way to do it today.
If there’s something you feel is missing, feel free to post and we’ll help out!
With SmartThings killing off Groovy, sometimes it’s going to mean doing things slightly different than before. We’re listening to feedback though and where we see strong demand for things, we’ll build them in as first-class features where it’s reasonable. Of course, there’s lots of people coming over from WebCoRE, so we’re prioritizing based on which feature requests receive the most community interest!