I am new on Sharptools, but having a lot of fun so far.
So I was setting up a rule to turn on my light an hour before sunset. As soon as they are switched on, I want them to start fading from 100% to 60% over a period of 60 minutes and I want this to only happen when my phone is registered as being home.
I can easily make a different rule that says that when I come home after sunset the lights just turn on at 60% except for when there is already a scene running or lights turned on (girlfriend already home and having lights on).
All of the above I can manage on my own. The thing I run into is how to make a rule for the time between these two rules.
I can use a trigger for when I come home, but I can’t set in the flow a time period between, for example, 59 minutes before sunset to 45 minutes to sunset. In the flow I can set between times, but they are static times and don’t follow sunset. I don’t want to have my light turn on at 100% 5 minutes before sunset and I don’t want them to turn on at 5pm in the summer.
Is there a way to resolve this issue. (Not looking for minute to minute sollutions, but different settings for every 15 minutes is fine by me).
@Dutch_Drifter, welcome to the community. You can create another rule and update a TRUE/FALSE variable’s value as shown in the screenshot below. (You can name the variable whatever you want.)
Then in your light automation rule, you’ll check if this variable is true or not to decide if you want to turn to fade the light, or turn it to 100% or 60% directly based on you need, since this variable should only be true between 59 minutes before the sunset and 45 minutes before the sunset.
So I am trying to wrap my head around it. This is a variable I can implement in my rule?
So I would leave my one hour before sunset triggered rule as is.
Make a new rule that triggers when I arrive home and then checks what part of the hour before sunset it is by using that variable.
Or does this only check once every 15 minutes?
Yes, you can create Variables in SharpTools and use them in both Dashboards and Rule Engine. See more details in the article below.
Can you post your rule just so I can make sure I understand it 100% and provides the correct feedback?
That’s right, if I understand your needs correctly. Use the arrival as the rule trigger, and an IF condition in the Flow to check the variable and take actions accordingly. The variable will only be true during 59 minutes before the sunset to 45 minutes before the sunset.
That’s correct, and you may use a TEXT or NUMBER variable instead of multiple TRUE/FALSE variables to track the time periods before the sunset to keep things easier.
“That’s correct, and you may use a TEXT or NUMBER variable instead of multiple TRUE/FALSE variables to track the time periods before the sunset to keep things easier.”
Didn’t quite get this untill I was finished. I have a load of different variables now wich I could have reduced to one.
This goes on trough every 15 minutes to sunset. After that it stays at 60% when i come home up untill sunrise.
I had to make a virtual switch in smartthings to report back if any light in the room is on. If one or more are it doesn’t switch the other lights on. When the lights switch on due to this rule, the virtual switch will also switch on. Will this be a problem?
I didn’t have to program the light to turn on. Adjusting the level turns the lights on automatically. Is this true for all smartlights?
Not necessarily. Most lights automatically come on when their level is adjusted, but it’s not technically required so I wouldn’t be surprised if there’s some light out there that doesn’t come on.
I don’t see why it would be an issue as long as that grouping works.
I’ve noticed other community members using rules to group the status of lights into a variable. That way they can add the variable to their dashboard to easily the status of a group of lights. Sounds like the same concept you’ve applied with a virtual switch.
"I’ve noticed other community members using rules to group the status of lights into a variable. That way they can add the variable to their dashboard to easily the status of a group of lights. Sounds like the same concept you’ve applied with a virtual switch.”
I couldn’t figure out how to do that. I just now noticed I can probably see the lights on or off status by using the switch option changing to on on on the lights.