the 5 second wait is useful in that when you press the button, it transitions from off to on between each of the 4 states (0,1,2,3). the kepad will light from "off" to "on" on the first press. The program then clears the light back to "off" giving you feedback that the 5 second wait is counting down. press the button again, the light goes on, program turns the light off, letting you know to press again. third press, light goes on, at this point you're in the s3_body code, so you can leave the light on letting you know that it took. note in s3_body I set a state variable, I use this elsewhere to trigger code to "activate" whatever I intended the 3 presses to do.
the programs are as follows:
(note, i renamed them to shorten them up but you can easily follow the flow)
=========================================
s0_body
=========================================
If
- No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
Run Program 'S1_body' (Else Path)
Run Program 'S2_body' (Else Path)
Run Program 'S3_body' (Else Path)
Else
- No Actions - (To add one, press 'Action')
=========================================
s1_cond
=========================================
If
Program 'S0_body' is True
And Control 'Key_g' is switched On
Then
Run Program 'S1_body' (Then Path)
Else
- No Actions - (To add one, press 'Action')
=========================================
s1_body
=========================================
If
- No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
Run Program 'S0_body' (Else Path)
Run Program 'S2_body' (Else Path)
Run Program 'S3_body' (Else Path)
Set Scene 'Key_g' Off
$State_1 = 0
Wait 5 seconds
Run Program 'S0_body' (Then Path)
Else
- No Actions - (To add one, press 'Action')
=========================================
s2_cond
=========================================
If
Program 'S1_body' is True
And Control 'Key_g' is switched On
Then
Run Program 'S2_body' (Then Path)
Else
- No Actions - (To add one, press 'Action')
=========================================
s2_body
=========================================
If
- No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
Run Program 'S0_body' (Else Path)
Run Program 'S1_body' (Else Path)
Run Program 'S3_body' (Else Path)
Set Scene 'Key_g' Off
Wait 5 seconds
Run Program 'S0_body' (Then Path)
Else
- No Actions - (To add one, press 'Action')
=========================================
s3_cond
=========================================
If
Program 'S2_body' is True
And Control 'Key_g' is switched On
Then
Run Program 'S3_body' (Then Path)
Else
- No Actions - (To add one, press 'Action')
=========================================
s3_body
=========================================
If
- No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
Run Program 'S0_body' (Else Path)
Run Program 'S1_body' (Else Path)
Run Program 'S2_body' (Else Path)
Set Scene 'Key_g' On
$State_1 = 1
Run Program 'S0_body' (Then Path)
Else
- No Actions - (To add one, press 'Action')