Timer for Counting?

20 views
Skip to first unread message

HTS

unread,
Apr 27, 2019, 1:26:38 PM4/27/19
to ImSmart.tech
(1) Need- I would like to turn off lights 10 minutes after activitated BUT only during the hours of midnight and 7 am as those same lights are currently scheduled to stay on from Sundown to midnight.

I see a timer to delay actions.  I would like to set or create a variable timer (let's say 5 minutes) where it would perform another trigger x minutes after executing a previous trigger.

I am BRAND NEW to this code.  As Itype this I realize that perhaps all I need to do is run my Lights Off routine (trigger) immediately after my Lights On routine (trigger).  If I am mistaken, any guidance woud be appreciated.

(2) Will the below even work and execute at 12:05 or only at midnight with motion? I have another variable for 7AM that will turn off lights otherwise I guess I need a between two variable times or again I need better guidance.

First Trigger.jpeg


HTS

unread,
Apr 27, 2019, 1:44:06 PM4/27/19
to ImSmart.tech
As far as the time variable goes, I changed my variable for Midnight to a Toggle so it will become true at midnight and then triggered to false (via IFTTT) at 7AM in the morning.  Still hope I am doing this correctly.

ImSmart.tech

unread,
Apr 27, 2019, 3:02:38 PM4/27/19
to ImSmart.tech
Hi,

Yes that should do it. The toggle would be the easiest way to go.
You might want to "Reset timer", so that the timer restarts when you have motion again before 10 minutes.

Paul
Message has been deleted

ImSmart.tech

unread,
Apr 27, 2019, 3:32:35 PM4/27/19
to ImSmart.tech
Hi,

Do not post full personal URLs either from IFTTT or ImSmart as anyone with those URL could update your values and triggers things at your home.

To answer your question, depending on your motion sensor, you should not have to do anything. For example the SmartThings sensor goes automatically to "no motion" after a few seconds. With the Fibaro motion sensor you can set a time before "no motion" is triggered. So I don't think you should need action 3.

Paul

HTS

unread,
Apr 27, 2019, 4:01:34 PM4/27/19
to ImSmart.tech
Thanks, again, the motion comes from the Ring and hte Arlo camera's and I wasn't sure if I needed to create something to set condition back to false as most triggers are activated based upon a condition.

Thanks, for deleting my Post for security reasons....  Those were notes that I typed up for myself (while trying to figure things out) and forgot when I copied and pasted them in haste....

I can't wait to see how things work out, this sounds very promising and I look forward to learning more....

HTS

unread,
Apr 27, 2019, 5:52:48 PM4/27/19
to ImSmart.tech
I tested and am not sure about the variable resetting itself to FALSE. I created the motion variable boolean, started as FALSE and changed to TRUE upon motion. I keep checking the Variable and it stays TRUE and doesn't appear to reset. I have changed the value manually a few times to FALSE yet once triggered I have yet to see it return to that state once changed to TRUE.
20190427_174021.jpg

Paul Dubé

unread,
Apr 29, 2019, 9:10:27 PM4/29/19
to ImSmart.tech
You should not have to worry about the variable setting itself to FALSE. As long as you have something that will set the variable to TRUE (even if it's already TRUE) the trigger will be executed.
(Unless you check "Evaluate if different than last execution", in which case, if result is the same as last execution, actions are not executed.)

The logic is like this: a variable is set (a call made by IFTTT for example), then all triggers that use this variable are evaluated.
You may want to try the Simulator to see how the triggers react.

Reply all
Reply to author
Forward
0 new messages