brianp6621 Posted June 29, 2015 Posted June 29, 2015 I am trying to create programs that activate when I leave my home. Mobilinc has nice support for this in that it creates a variable for my phone on the ISY that changes when I leave. However I am finding that my program that evaluates the state of that variable runs constantly. The result is that my program does exactly what I want (turn off certain lights) when I leave, but if someone still in the house turn them on, or I do remotely, they get shut back off since the variable state on the ISY still shows that I am not home. Is there a way to have the program only execute upon leaving the house and not the entire time I am gone? Brian
oberkc Posted June 29, 2015 Posted June 29, 2015 I don't believe programs "runs constantly". If a program shuts of your lights, it is likely because one or mor e of the program conditions gets triggered by something. Perhaps you should post your program. Yes, there is a way to do what you want.
brianp6621 Posted June 29, 2015 Author Posted June 29, 2015 (edited) I'm sure the program is being reevaluated as the states of the lights are changing. How do I avoid that? GPS - [iD 0006][Parent 0001]If $Brian's_128GB_iPhone_6_Home is 0 And $Heather's_iPhone6_Home is 0 And ( Status 'Chess Board Lights' is On Or Status 'Patio Lights' is On ) Then Set Scene 'Exterior / All outdoor lights' Off Else - No Actions - (To add one, press 'Action') Edit... Duh I think it just occurred to me. Don't check the states of the lights in the IF, just force a scene off command. That way it accomplishes what I want, and the program should re-evaluate as there is not state change to trigger the IF. This should work, right? I just confirmed from work, that if I make this change, the lights no longer turn back off if I remotely turn them on, so the program isn't revaluating on the light trigger. Now I just need to make sure they still shut off on their own when I leave, however there is no reason to suspect they won't. What if I DID want to actually check the state of something when leaving and prevent a later change in state from causing the program to re-evaluate. How would I accomplish that? Edited June 29, 2015 by brianp6621
oberkc Posted June 29, 2015 Posted June 29, 2015 Yes, you correctly identified the cause and solution. These lights should turn off when both variables are 0. If you wanted to check state of something, one way would be to break this into two programs, where the first calls the second, the second is disabled (will not self trigger), and checks state before performing action.
Recommended Posts