After reading the above, I feel I have really complicated things in my programing. Even though the following works, any advice would be welcome.
My overall goals are slightly more involved though: I have 2 garage doors and if either or both are open, I have one button (KP4) on three different Keypads light up. If any of those buttons are subsequently pressed, then I FLASH lights in the garage and nearby for 30 seconds as a warning, then proceed to shut the open door or both as needed. If it fails the first time, it will flash the lights again and try a second time. If it fails the second time, then I set off two separate Chimes inside the house and cause the keypad lights to blink to alert me that it failed.
As a result i have quite a few programs and just one scene to light the KP4s. Can this be simplified? (even though it seems to work well). I may not fully understand the power of controllers/responders in scenes and instead relying on way too much programming.
Thanks!
Programing starts by monitoring garage door status:
Garage Door1 Status:
If Status 'Garage Door 1 Sensor' is Off
Then
$GarageDoor1 = 1
Set Scene 'Keypad light Scenes / KP4 Garage Indicator' On
Else
$GarageDoor1 = 0
Garage Door2 Status
If Status 'Garage Door 2 Sensor' is Off
Then
$GarageDoor2 = 1
Set Scene 'Keypad light Scenes / KP4 Garage Indicator' On
Else
$GarageDoor2 = 0
Then based on Status, it will turn on the KP4 light on three keypads:
Check Light Key pad On
If (
$GarageDoor1 is 1
Or $GarageDoor2 is 1
)
Or (
(
$GarageDoor2 is 1
Or $GarageDoor1 is 1
)
And (
Control 'Entryway KP4' is switched Off
Or Status 'Entryway KP4' is Off
Or Control 'Great Room KP4' is switched Off
Or Status 'Great Room KP4' is Off
Or Control 'Mstr Bed KP4' is switched Off
Or Status 'Mstr Bed KP4' is Off
)
)
Then
Wait 3 minutes and 1 second
Set Scene 'Keypad light Scenes / Entryway Keypad / Entryway KP4 LED' 100%
Else
- No Actions - (To add one, press 'Action')
Likewise, if the doors are shut, it checks to ensure the lights on KP4 are off (i.e. someone presses it on by accident)
Check Light Key pad off
If (
Control 'Great Room KP4' is switched On
Or Control 'Great Room KP4' is switched Fast On
Or Status 'Great Room KP4' is not Off
Or Control 'Entryway KP4' is switched On
Or Control 'Entryway KP4' is switched Fast On
Or Status 'Entryway KP4' is not Off
Or Control 'Mstr Bed KP4' is switched On
Or Control 'Mstr Bed KP4' is switched Fast On
Or Status 'Mstr Bed KP4' is not Off
)
And (
$GarageDoor1 is 0
And $GarageDoor2 is 0
)
Then
Wait 3 seconds
Set Scene 'Keypad light Scenes / KP4 Garage Indicator' Off
Else
- No Actions - (To add one, press 'Action')
So now, assuming door 1 is open, the KP4s are lit, then any press of any of the KP4's will shut garage 1 by first running warning light, shutting, if failed, will run it again, if fails a second time, runs Garage Door Failed to Shut:
Garage Door 1 Shut
If $GarageDoor1 is 1
And $GarageDoor2 is 0
And (
Control 'Entryway KP4' is switched Off
Or Control 'Great Room KP4' is switched Off
Or Control 'Mstr Bed KP4' is switched Off
)
Then
Run Program 'Garage Warning lights' (Then Path)
Wait 30 seconds
Set 'Garage Door 1 Relay' 100%
Wait 30 seconds
Run Program 'Garage Warning lights' (Then Path)
Wait 30 seconds
Set 'Garage Door 1 Relay' 100%
Wait 45 seconds
Run Program 'Garage Door failed to shut' (If)
Else
- No Actions - (To add one, press 'Action')
There is a similar program for Garage 2.
Garage Door 2 Shut
If $GarageDoor2 is 1
And $GarageDoor1 is 0
And (
Control 'Entryway KP4' is switched Off
Or Control 'Great Room KP4' is switched Off
Or Control 'Mstr Bed KP4' is switched Off
)
Then
Run Program 'Garage Warning lights' (Then Path)
Wait 30 seconds
Set 'Garage Door 2 Relay' 100%
Wait 30 seconds
Run Program 'Garage Warning lights' (Then Path)
Wait 30 seconds
Set 'Garage Door 2 Relay' 100%
Wait 45 seconds
Run Program 'Garage Door failed to shut' (If)
Else
- No Actions - (To add one, press 'Action')
And lastly a similar program if both garage doors are open which :
Garage Door 1 + 2 Shut
If $GarageDoor1 is 1
And $GarageDoor2 is 1
And (
Control 'Entryway KP4' is switched Off
Or Control 'Great Room KP4' is switched Off
Or Control 'Mstr Bed KP4' is switched Off
)
Then
Run Program 'Garage Warning lights' (Then Path)
Wait 30 seconds
Set 'Garage Door 1 Relay' 100%
Set 'Garage Door 2 Relay' 100%
Run Program 'Garage Delay' (Then Path)
Else
- No Actions - (To add one, press 'Action')
However, in case of two doors going down, it has to check independently if they both succeeded or not to try determine if a second try for just that door is needed, which is done through the following:
Garage Door Delay:
If - No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
Wait 30 seconds
Run Program 'Garage Door 1 Shut 2nd try' (If)
Run Program 'Garage Door 2 Shut 2nd try' (If)
Else
- No Actions - (To add one, press 'Action')
Disabled program, only callable from above:
Garage Door 1 Shut 2nd try:
If $GarageDoor1 is 1
And $GarageDoor2 is 0
Then
Run Program 'Garage Warning lights' (Then Path)
Wait 30 seconds
Set 'Garage Door 1 Relay' 100%
Wait 45 seconds
Run Program 'Garage Door failed to shut' (If)
Else
- No Actions - (To add one, press 'Action')
Leave disabled
Disabled program, only callable from above:Garage Door 2 Shut 2nd try:
If
$GarageDoor2 is 1
And $GarageDoor1 is 0
Then
Run Program 'Garage Warning lights' (Then Path)
Wait 30 seconds
Set 'Garage Door 2 Relay' 100%
Wait 45 seconds
Run Program 'Garage Door failed to shut' (If)
Else
- No Actions - (To add one, press 'Action')
Leave disabled
The Warning lights program is:
Garage Warning Lights:
If - No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
Disable Program 'Outside Garage lights on at sunset'
Repeat 3 times
Set 'Outside Garage Front Lights' Fast On
Set 'Garage light Kennel switch' Fast On
Wait 2 seconds
Set 'Outside Garage Front Lights' Fast Off
Set 'Garage light Kennel switch' Fast Off
Wait 2 seconds
Repeat 1 times
Enable Program 'Outside Garage lights on at sunset'
Run Program 'Outside Garage lights on at sunset' (If)
Else
- No Actions - (To add one, press 'Action')
So if failure in any of the above door shutting routines occurs then i set off the alarms and blink kp4 by calling this disabled program. I also disable the other shutting programs for safety. This program becomes enabled, and essentially waits for me to get the doors shut by solving the problem in the garage. Once they are shut, it becomes false and resets all the other programs to run normally, and re-disables itself.
Garage Door Failed to Shut
If
$GarageDoor1 is 1
Or $GarageDoor2 is 1
Then
Enable Program 'Garage Door failed to shut'
Disable Program 'Garage Door 2 Shut '
Disable Program 'Garage Door 1 Shut'
Disable Program 'Garage Door 1 +2 Shut'
Run Program 'X10 Relay On C3' (Then Path)
Run Program 'X10 Chime C1' (Then Path)
Repeat 20 times
Set Scene 'Keypad light Scenes / KP4 Garage Indicator' Off
Wait 3 seconds
Set Scene 'Keypad light Scenes / KP4 Garage Indicator' On
Else
Set Scene 'Keypad light Scenes / KP4 Garage Indicator' Off
Enable Program 'Garage Door 1 Shut'
Enable Program 'Garage Door 1 +2 Shut'
Enable Program 'Garage Door 2 Shut '
Disable Program 'Garage Door failed to shut'
Keep this program disabled.
X10 Relay C3 is a Chime
Lastly, to make it all work, i need to ensure that once a relay is turned on, I turn it back off. This may be because of how i have the relays set.
Garage door 1 relay off
If Status 'Garage Door 1 Relay' is On
Then
Wait 10 seconds
Set 'Garage Door 1 Relay' Off
Else
- No Actions - (To add one, press 'Action')
Same program for door 2
Garage door 2 relay off:
If Status 'Garage Door 2 Relay' is On
Then
Wait 10 seconds
Set 'Garage Door 2 Relay' Off
Else
- No Actions - (To add one, press 'Action')