Only When Location Mode Is Home: Not Evaluating As I'd Expect


#1

Issue:

I’m trying to accomplish running one of my lights when I’m already home and it’s after sunset. For whatever reason it’s running when I’m not home. I’ve checked the Smartthings app and it indeed says I’m “Away” when this runs. Basically the group of rules #20-26 are firing.

Am I using rules #17 - 18 incorrectly?

If not and you need to see the logs for further information, I’ll have to turn them on and wait for it to run tomorrow. Thanks for any insight, I hope I’m just missing something very apparent here.


#2

Your piston will still run every day, but if you are not home all you’ll see in the logs is “piston aborted due to restrictions in place” or something along those lines.

The piston has to wake up and start processing in order to determine whether or not your SmartThings hub is in Home or any other mode. Lines 20 and 28 dictate that will occur daily at Sunset with an offset, and exactly at sunset.

To verify any further will require a capture of the logs.


#3

When you place a restriction on a TIMER, those are evaluated when the Timer WAS set. Not when the timer IS running. In other words, if your location mode WAS “Home” yesterday at Sunset, then the Timer would have been set to run the following day.

There are two ways to remedy this… I find the easiest is to remove the Restriction on the outside of the Timer and change it to a Condition on the inside of the Timer.

Every day at Sunset
If Location mode is Home
Then do whatever else you want to do…

Otherwise you have to put some logic in your piston to make it aware of Location mode changes. That can be done with an empty stub at the bottom. Something like:

If location mode changes
End if

Nothing needs to be in it at all…it just needs to be there so that the piston will execute and reevaluate the restriction on the Timer.

So take your pick…but if you do nothing then it will always behave how it WAS set the day before and not how it IS set on the current day.


#4

Interesting Mike…definitely not how I would have expected that to work. I’ll go ahead and make the change to see if that does it.

Thanks to both of you for responding!