Jump to content
C4 Forums | Control4

Programming a Delay


Elvis

Recommended Posts

Seems like I remember putting a Delay in code in Composer is a bad idea. Like a Delay of 15 minutes -- going to freeze up the controller?

Was considering using this in a motion event to delay turning the lights off. If I should avoid the Delay in code, what's the approved solution?

Link to comment
Share on other sites


1 minute ago, Elvis said:

Seems like I remember putting a Delay in code in Composer is a bad idea. Like a Delay of 15 minutes -- going to freeze up the controller?

Was considering using this in a motion event to delay turning the lights off. If I should avoid the Delay in code, what's the approved solution?

The alternative is to start (or restart) a 15-minute timer and then turn the lights off when the timer expires. 

Link to comment
Share on other sites

  • 3 weeks later...

Another problem with a long delay like 15 seconds is also that it'll delay EVERYTHING behind it in programming whether you want it to or not.

A 15 minute delay isn't going to lock up a controller as such - but it may 'hold' programming that is triggered after the delay is triggered.

Honestly, delays are there really just to purposely slow a system down (ie add a 250ms delay between turning on multiple TV/zones to ensure the system doesn't get ahead of itself (it's physical output controllers) before moving on to change inputs on all of these and set channels etc). The only time I sue anything more than the MS setting is on the occasional room off for projectors (if I can't edit the driver to do this).

Link to comment
Share on other sites

2 hours ago, Cyknight said:

A 15 minute delay isn't going to lock up a controller as such - but it may 'hold' programming that is triggered after the delay is triggered.

It will only hold up programming in the same event.  If the event triggers again, I don't recall what happens, whether all the programming waits on the first delay or if it all executes up to the delay a second time.  I don't particularly want to test it...   :)

If you do a 15 minute trigger on a particular event (let's say a motion sensor sensed motion), and you have other programming on a different event (say, a custom button triggered by a remote, or a *different* motion sensor sensing motion, etc.), it will execute normally.

RyanE

Link to comment
Share on other sites

7 hours ago, RyanE said:

It will only hold up programming in the same event.

Yes that is what I meant - I've 'cleaned up' a lot of programming where things were along the line of

turn light on

delay 15 seconds

turn light off

select cable box in room

 

Where it was NOT the intend to wait 15 seconds for the cable box to turn on

 

And yes I'm aware this is a matter of order of programming 😉

Link to comment
Share on other sites

11 hours ago, Cyknight said:

And yes I'm aware this is a matter of order of programming 😉

I was not responding for you...  I was clarifying for those who would not understand.  I assumed you already knew how it worked...  :)

The blanket statement could have been read as it delaying all ComposerPro programming, although this, of course, would make delays virtually useless.

Thanks.

RyanE

Link to comment
Share on other sites

On 3/14/2023 at 12:07 PM, Matt Lowe said:

I also don't think anyone has stated it but delays should not be used for motion automation. They will not achieve the correct results you should use a timer or the appropriate driver. 

Agreed, can't restart it if continues to sense motion with a delay.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.