Question about time


#1

This is my first post. I have had SmartThings hub for several months now, but I never realized the power of pistons. So, I created my first piston today. It was super easy to create it using the dashboard so a big THANK YOU to WebCore.

The piston is working as expected. But I have one question.

I am using a time comparison:
If Time is between sunset and 11:30:00 PM then do certain actions.

If Time is between 11:31:00 PM and 12:00:00 then do some other actions.

As can be seen in the second statement, I can check only for 11:31:00 PM. This leaves a one minute gap. Is there a way I can check for 11:30:01 PM leaving only a one second gap? Is there any better way of doing time comparisons?

Thanks,
Arun


#3

Just use the same cutoff time for both statements.

If time is between sunset and 11:30:00 then do xxx
If time is between 11:30:00 and 12:00 then do yyy

No gap, and 11:29:59.999 will satisfy your first requirement. 11:30:00.000 and later (seconds or fractions of a second) will satisfy your 2nd requirement.


#4

Thank you.