Jump to content
C4 Forums | Control4

Trying to use a delay to distinguish actions, not working right


jbs

Recommended Posts

I have been using regular dimmers throughout the house to program other actions, particularly when you press the bottom of a light that is off, or the top of a light that is on (making use of that otherwise pointless press). The problem is they get occasionally pressed by accident, causing things like the whole house to light up, or go dark. I'd like to still employ the functionality, but make it slightly more complex to activate, such as by requiring 2 presses in quick succession.

To do so, I programmed this, with the idea that if you pressed the bottom twice within 5 seconds, the second press would activate the "if true" statement before the first press had reached the 5 second mark and turned the variable back to false:

delaypress1hv8.gif

. . . but it did not work. What I'm guessing is that perhaps the system remains in the delay 5 seconds command and does not go back to the start based on the second press. Can anyone confirm if that's true?

Next I tried a combination to make a press of more than 5 seconds execute the desired behavior by programming this for a bottom press:

delaypress2no3.gif

and this for a bottom release:

delaypress4dl7.gif

This does seem to do the trick, a short press won't do anything (and will return the variable to FALSE) but a longer press will execute the lighting scene. I suspect as always that there's a more elegant solution to do something like this, any suggestions or tips out there?

--Jason

Link to comment
Share on other sites


I have not tested your particular code but I have tested code in the past to see if the system remains in a delay loop and remains there for the whole 5 seconds before moving on to the next line of code. It does not for the code I tested (although I was using a longer delay of 15 seconds). I also have a HC-1000 so everything moves quite quickly. Maybe that is what makes the difference though I doubt it.

Ideliver

Link to comment
Share on other sites

Jason,

My experience seems to concur with yours. During the delay, it doesn't seem that the macro restarts after an additional push of the button, and seems to stay in the macro until all code has been executed for that button push. I tried something very similar with garage door control but had to use a loop instead.

Link to comment
Share on other sites

  • 3 months later...

I'm trying to do this on a 3 button keypad we have in the master bedroom. Button 1 currently turns everything off in the house at the end of the day when we go to sleep. I'm trying to put this delay in so that if the kids hit the button or it's accidentally pressed the whole house doesn't go off. I followed your programming and can't seem to get it to work. Any thoughts? Thanks!

Link to comment
Share on other sites

you are correct, it will remain in the "delay" for the 5 seconds before it evaluates the next line...You usually have to make smaller increments and have it check those to have a "timer" so to speak....The next version of composer will have more functional "timer" agent.

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.