Jump to content
C4 Forums | Control4

Programming Multiple Buttons on a Card Access Fob


Recommended Posts

Hi Everyone - question on programming using multiple presses to achieve a desired result.

The card access FOB has 5 buttons.  What if I wanted to program a 3-4 button sequential press to accomplish a task.  For instance, if button 2, 3, 4 and 5 are pressed in that order, the blinds in the bedroom will open.  I dont want someone to pick up the fob and hit a button and poof the blinds open, so to “hide” that function I want them to press 2, 3, 4 and 5 in sequential order.

I was thinking true/false variables since that is the extent of my programming skills 🙂. If Button 2 is pressed, Variable A is true.  If button 3 is pressed AND variable A is true, Variable B is true.  IF Button 3 is pressed and Variable  B is true, Variable C is true.  If Button 4 is pressed and Variable C is true, open the blinds....

would this work?  Would the variable states change fast enough to catch up with someone pressing those buttons fairly quick?

Is there a better way to achieve the desired results?

Link to comment
Share on other sites


Do you want to use a key fob just cus you have it? Or because it’s portable? String variable might be less work to program

Probably be much cleaner and easier to get the tabletop kit for the configurable keypad. 

Or a dot in there with the voice driver and tell the b*tch to open the blinds!

Link to comment
Share on other sites

10 minutes ago, knowitall said:

Do you want to use a key fob just cus you have it? Or because it’s portable? String variable might be less work to program

Probably be much cleaner and easier to get the tabletop kit for the configurable keypad. 

Or a dot in there with the voice driver and tell the b*tch to open the blinds!

Got card access already.  Curtains was just a generic task.  Will likely do something with garage doors opening, lights/music to turn on etc 

how do string intervals work?  I read the remedial C4 docs and it was talking about text for a string variable. No concept how that would work

Link to comment
Share on other sites

You could probably do this with just timers. For a 3 button sequence:

When button A is pressed, start Timer 1.

When button B is pressed, IF Timer 1 is still running - start Timer 2.

When button C is pressed, IF Timer 2 is still running - Open Bedroom Blinds

Link to comment
Share on other sites

4 hours ago, Crustyloafer said:

You could probably do this with just timers. For a 3 button sequence:

When button A is pressed, start Timer 1.

When button B is pressed, IF Timer 1 is still running - start Timer 2.

When button C is pressed, IF Timer 2 is still running - Open Bedroom Blinds

Thanks.  Same concept of using the true/false variable.  Any benefit to a timer or a variable?

Link to comment
Share on other sites

1 hour ago, Crustyloafer said:

Benefit of timer is correct sequence needs to be pressed within a time limit,  whereas with just variables the correct sequence could be done with any time gap between press making it slightly more likely to happen by accident.

thanks - resetting the timer puts it back to the original duration but also stops it from running?  if i set a timer for 30 seconds, and it gets down to 20 seconds and i put in a reset command, it goes back to 30 seconds but does not keep counting down, correct?

Link to comment
Share on other sites

17 minutes ago, eggzlot said:

thanks - resetting the timer puts it back to the original duration but also stops it from running?  if i set a timer for 30 seconds, and it gets down to 20 seconds and i put in a reset command, it goes back to 30 seconds but does not keep counting down, correct?

509335680_Screenshot2019-07-0317_20_49.thumb.png.a4c2eba8c85e128e77e0c82183919f0f.png

Link to comment
Share on other sites

Just now, Crustyloafer said:

Bear in mind this is for the new Timer Agent in OS3, the OS3 Agent isn't as flexible. 

oh ok, I am still behind on OS 2.  what is the best way to stop the timer and get it back to its original duration in a stop state?

Link to comment
Share on other sites

I just found this table - so I would have to do a "stop" command

but how do you get the timer back to its original state (30 seconds) without starting again?

Command Executed is...

And Timer is ...

Then Event

Effect on Timer
Start  Running None Restarts
Reset    Stop and Start Restarts
Stop   Stop

 Stops

 

Start Not Running Start Starts
Reset   Start Starts
Stop   Stop Stops
Link to comment
Share on other sites

Timer not running:
START starts the timer from 0, triggering any programming for START
STOP stops the timer triggering any programming for STOP
RESET starts the timer from 0, triggering any programming for START

Timer running:
START resets the timer to 0, start the timer but triggers NO programming events
STOP stops the timer triggering any programming for STOP
RESET starts the timer from 0, triggering any programming for START AND STOP

Link to comment
Share on other sites

Just now, Crustyloafer said:

Timer not running:
START starts the timer from 0, triggering any programming for START
STOP stops the timer triggering any programming for STOP
RESET starts the timer from 0, triggering any programming for START

Timer running:
START resets the timer to 0, start the timer but triggers NO programming events
STOP stops the timer triggering any programming for STOP
RESET starts the timer from 0, triggering any programming for START AND STOP

thanks

I have it as stop for now.  I'll test to see if i run this cycle 2-3x that it will reset after i stop and it starts again.  we'll see.  ill mess with it and watch what happens in Composer HE

Link to comment
Share on other sites

  • 2 weeks later...
On 7/3/2019 at 12:38 PM, Crustyloafer said:

Timer not running:
START starts the timer from 0, triggering any programming for START
STOP stops the timer triggering any programming for STOP
RESET starts the timer from 0, triggering any programming for START

Timer running:
START resets the timer to 0, start the timer but triggers NO programming events
STOP stops the timer triggering any programming for STOP
RESET starts the timer from 0, triggering any programming for START AND STOP

I have my programming below - for security reasons I blanked out which button on the FOB etc is involved

Given this programming, I'd say about 75% of the time the lights/alarm/door unlock but maybe 25-30% of the time the garage door opens.  Needless to say, it should be 100%.  I am only doing this on my wife's remote and every time I've been in the car/used the remote the inside door, lights and alarm all went off, but the garage door was hit or miss at best, so I got a feeling it may be higher on the 75% that the other things work but I know first hand that pesky garage door is well below the 50% threshold of working.

Untitled 2.jpg

Link to comment
Share on other sites

my 2 cents at this. 

i would do a timer and a string variable.

reset timer on first button

add a number or letter to the string like 1 or the number corresponding to the button.

next button

change the variable to both numbers in that the order is the variable is equal to the first number. so itll end up 12

etc until you get to the last button if variable is equal to 1234 etc execute programming

 

Link to comment
Share on other sites

7 hours ago, eggzlot said:

I have my programming below - for security reasons I blanked out which button on the FOB etc is involved

Given this programming, I'd say about 75% of the time the lights/alarm/door unlock but maybe 25-30% of the time the garage door opens.  Needless to say, it should be 100%.  I am only doing this on my wife's remote and every time I've been in the car/used the remote the inside door, lights and alarm all went off, but the garage door was hit or miss at best, so I got a feeling it may be higher on the 75% that the other things work but I know first hand that pesky garage door is well below the 50% threshold of working.

Untitled 2.jpg

The reason  it works intermittently is probably because you have used a second IF command after the first one, when in fact you should have used an ELSE command.

With your programming, if the button press sequence is done correctly then it actually checks if the timer is running twice, once at the start and then it runs the sequence including opening the garage door and then a second time after that sequence has completed. Depending on how long your timers are for, there is a possibility that if the final timer is still running and the last button is pressed correctly that same timer will have expired by the end of the sequence and so when it gets to the second IF command and it checks if the timer is NOT running then that also is true and so it then sends the toggle command to the garage door not long after it has just told it to open.

If you use and ELSE command instead of the second IF command it will only ever check the status of the timer once, if it is running it will perform the sequence and then skip past anything nested under the ELSE command, if the timer has expired it will skip straight to whatever is nested under the ELSE command.

Link to comment
Share on other sites

5 hours ago, Crustyloafer said:

The reason  it works intermittently is probably because you have used a second IF command after the first one, when in fact you should have used an ELSE command.

With your programming, if the button press sequence is done correctly then it actually checks if the timer is running twice, once at the start and then it runs the sequence including opening the garage door and then a second time after that sequence has completed. Depending on how long your timers are for, there is a possibility that if the final timer is still running and the last button is pressed correctly that same timer will have expired by the end of the sequence and so when it gets to the second IF command and it checks if the timer is NOT running then that also is true and so it then sends the toggle command to the garage door not long after it has just told it to open.

If you use and ELSE command instead of the second IF command it will only ever check the status of the timer once, if it is running it will perform the sequence and then skip past anything nested under the ELSE command, if the timer has expired it will skip straight to whatever is nested under the ELSE command.

the timers are 10 seconds each.  its just pressing 3 buttons, does not take 10 seconds at all

Is that "Else" something in OS 3?  I have not seen it before, I am on 2.10.4 and playing around in HE I did not see how to do that.  What I figured out though is that regardless if the timer is running, I want that garage door to open.  if the timer is running, then do the alarm/door lock/lights, etc.  Would this do the trick ya think?  I can put a 250mm pause between the toggle and the IF statement?

 

 

garage2.jpg

Link to comment
Share on other sites

Just put a stop command at the end of your first sequence that does the alarm/door lock/lights, etc., that way if that sequence is run then it will stop at end and not try to toggle the garage door again. Only if it skips past doing the alarm/door lock/lights, etc sequence will it carry out the second IF statement and toggle the garage door. 

PS: Why do you want to toggle the door, would it not be better to have a button for open and another for close?

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.