Like many folks in here, I’ve been missing Vacation Lighting since the switch to Edge. I didn’t have time to figure out how to create a custom Edge driver/routine/app, so dug into SharpTools a bit more.
I have a solution that is a bit kludgy, but it seems to work and honestly, I think it provides more randomness (in a good way) than what I had with Vacation Lighting Director (albeit with more setup).
- Control start/stop times based on your SmartThings modes
- Randomize when lights turn on/off
- Randomize which lights turn on/off
- Randomize how many lights turn on/off
- A little more complex setup than a SmartApp
- Have to pay for SharpTools subscription (~$30/year) to support the custom variables
Anyhoo, wanted to share my SharpTools setup here for others…
Create following variables:
- $switchRandomLights - boolean (true/false), default value doesn’t matter, this will be used as a toggle to execute rules, toggle lights
- $diningRoomLights - variable to control dining room light, boolean (true/false), default value doesn’t matter
- $livingRoomLights - ie one variable per light you want to include
- $kitchenOverheadLights - etc
- $kitchenIslandLights - etc
- $officeLights - etc
- $masterBedroomLights - etc
Variables are the key for randomizing things in SharpTools. Below, we’ll use the pickRandom() function in an expression, but that only works in an “Action” flow and against variables. Maybe one day we can use expressions in an If/Else condition directly (feature request SharpTools!?), but until then we need the variable.
Create rule to start vacation lighting when mode changes to Away (or whatever mode you want):
- Trigger = Event Trigger, Mode, changes to “Away Evening”
- Flow = Action, Set Variable, $switchRandomLights = True
Create rule to control how often you change the lights.
Idea here is that this rule will:
- trigger when the $switchRandomLights changes to true
- set $switchRandomLights back to false (so can trigger again later)
- pause for a random period of time (you set min/max window)
- toggle $switchRandomLights on again
NOTE: I added a check that it only runs if Mode is still “Away Evening”, so it stops executing when I come home, mode changes, etc.
Create a rule to determine which lights to turn on/off.
Idea here is this rule will:
- trigger when $switchRandomLights toggles to True
- one flow will use “random” function to set a light’s variable to true/false
- second flow will then turn corresponding device (light) on/off based on value
- each light will require two flows - one for the random function, one for the if/else to turn light on/off
- could put all these in a single rule, or split them out into individual rules - personal preference
- I put all in one long rule so I could view logs of lights turning on/off in once place
So far so good, fingers crossed. Took a bit to figure out and setup, but I like that (a) I can randomize how often lights change, and (b) I can randomize how many lights are on at any given time. We’ll see how reliably it works over time.
Let me know if you have a better way to do this!