rschneid Posted November 15, 2013 Posted November 15, 2013 I am executing toggle events via voice and would like a check on the way I am doing it. I am using three programs to control the toggling. It is working reliably . Is my use of disables and waits sensible? I can't remember how I got to this point and I am wondering if there is a better way. MASTER PROGRAM - the only one that I call directly (typically from SIRI -> ProxyServer -> Ruby -> ISY99) If Status 'Fire-Relay' is Off Then Run Program 'fireOn' (Then Path) Else Run Program 'fireOff' (Then Path) TURNS IT ON - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Disable Program 'fire' Set 'Fire-Relay' On Wait 5 seconds Enable Program 'fire' Else - No Actions - (To add one, press 'Action') TURNS IT OFF If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Disable Program 'fire' Set 'Fire-Relay' Off Wait 5 seconds Enable Program 'fire' Else - No Actions - (To add one, press 'Action')
Xathros Posted November 15, 2013 Posted November 15, 2013 Since your triggering the master program manually, you might as well just leave it disabled. No need to disable/re-enable. How about this instead: MASTER PROGRAM (DISABLED ALWAYS) - the only one that I call directly (typically from SIRI -> ProxyServer -> Ruby -> ISY99) If Status 'Fire-Relay' is Off Then Run Program 'fireOn' (Then Path) Else Run Program 'fireOn' (Else Path) TURNS IT ON/OFF (ALWAYS DISABLED) If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Set 'Fire-Relay' On Else Set 'Fire-Relay' Off -Xathros
rschneid Posted November 15, 2013 Author Posted November 15, 2013 Thank you. Much cleaner!!! Converting everything over. Not sure why I was doing that. Its way faster to program this way. Rihc S.
Xathros Posted November 15, 2013 Posted November 15, 2013 Actually, now that I look at it again, you only need the master program: FireToggle (ALWAYS DISABLED) If Status 'Fire-Relay' is Off Then Set 'Fire-Relay' On (Then Path) Else Set 'Fire-Relay' On (Else Path) -Xathros
apostolakisl Posted November 15, 2013 Posted November 15, 2013 Since your triggering the master program manually, you might as well just leave it disabled. No need to disable/re-enable. How about this instead: MASTER PROGRAM (DISABLED ALWAYS) - the only one that I call directly (typically from SIRI -> ProxyServer -> Ruby -> ISY99) If Status 'Fire-Relay' is Off Then Run Program 'fireOn' (Then Path) Else Run Program 'fireOn' (Else Path) TURNS IT ON/OFF (ALWAYS DISABLED) If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Set 'Fire-Relay' On Else Set 'Fire-Relay' Off -Xathros While it is fine to disable the second program, it isn't necessary. A disabled program blocks the "if" section from self triggering. When the "if" is empty, it can't self trigger anyway. But I do agree, it is better to merge the programs into 1 anyway.
Recommended Posts