Jump to content
C4 Forums | Control4

Tigger Lights when Alarm is in trouble


Recommended Posts


Find the action "when alarm state changes" then add the loop "While alarm state is 'trouble'..." to the script. Then indented under it put Toggle Exterior Lights, and whatever you want your delay to be.

Here's an example:

 

When alarm state changes...

   While alarm state is "trouble"...

      Toggle Exterior Lights

      Delay 1500 milliseconds

 

That means while your alarm is in trouble, every second and a half your lights will turn on or off.

You can also do a flashing lighting scene, or a repeating timer.

Link to comment
Share on other sites

Please avoid using WHILE statements.

Use a timer instead, whatever interval you want, repeating

WHEN security is in alarm
-reset timer

WHEN security is in alarm cleard
-stop timer

WHEN timer expires
Toggle light (or lighting scene)

 

If you want it in any trouble, use the above stated option, though some drivers have a direct option for trouble and trouble cleared (ie new Superbus driver)

Link to comment
Share on other sites

 

4 minutes ago, Cyknight said:

Please avoid using WHILE statements.

I've only beven a Control4 Programmer for about 6 months, but before that I played with it for about 18 months. Why shouldn't you use WHILE statements?

Link to comment
Share on other sites

WHILE statements have a risk of creating infinite loops for one, but even at best they are more process intensive, cause slowdown on other parts in the system and what can happen here specifically is that the toggle will continue for some time after the trouble or alarm state has been cleared.

In general WHILE statements on programming should just be avoided - a (repeating) timer will do the exact same thing with less (virtually no) risk in almost any circumstance.

Add to that the fact that using a timer allows you to dynamically change the interval (ie when fire alarm goes of, set interval to 100 ms so as to have it flash much faster indicating a REAL issue vs a mere 'trouble' due to a supervisory) AND can be triggered from multiple locations (try adding a while like you had, then add the same programming to WHEN fire alarm goes off - make a backup first!)

To top that off - WHILE statements aren't even available in HE. If not for a select few specific cases and legacy support, I suspect C4 would remove the option from PRO as well. Don't take this is the wrong way - heck it may not apply to you for all I know, but only a very small percentage of control4 dealer/programmers should touch WHILE statements at all - and those know better than to use it.

Use the timer agent.

Link to comment
Share on other sites

1 hour ago, Cyknight said:

Add to that the fact that using a timer allows you to dynamically change the interval (ie when fire alarm goes of, set interval to 100 ms so as to have it flash much faster indicating a REAL issue vs a mere 'trouble' due to a supervisory) AND can be triggered from multiple locations.

I didn't know you could program the interval to change. I'll have to play with that. Thanks for the advice.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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