ahwman Posted June 8, 2015 Posted June 8, 2015 I have two very similar programs which I created to turn my TV and sound bar on. They both use a variable set by a geofence. The first program turns my TV on/off when I come and go. The second program simply turns my TV on at 9:00AM every morning assuming I'm home. For some reason, the program which is set to trigger at 9:00 am always executes upon rebooting my ISY (assuming I'm within the geofence - 1 means home) or say after a power failure, yet the other launches only when the variable changes accordingly. I have attached screenshots of the programs, any ideas?
apostolakisl Posted June 8, 2015 Posted June 8, 2015 Is $iphone a state variable or integer? What is the init value? What is causing the variable to change value (programs/rest commands?). Is the program "run at startup" feature enabled?
ahwman Posted June 8, 2015 Author Posted June 8, 2015 $iphone is a state variable. The init value is 1. Changes are reported to the ISY via MobiLinc's iPhone geofence feature. 1 means within geofence, 0 means outside of geofence. If you notice both programs utilize the exact same variable in the if statement. The only difference is the second program incorporates an additional if statement based on time of day. So I would think the variable cancels out but for some reason the ISY upon rebooting is executing the program which incorporates the condition based on time of day. Just seems odd...
larryllix Posted June 8, 2015 Posted June 8, 2015 (edited) $iphone is a state variable. The init value is 1. Changes are reported to the ISY via MobiLinc's iPhone geofence feature. 1 means within geofence, 0 means outside of geofence. If you notice both programs utilize the exact same variable in the if statement. The only difference is the second program incorporates an additional if statement based on time of day. So I would think the variable cancels out but for some reason the ISY upon rebooting is executing the program which incorporates the condition based on time of day. Just seems odd... It would seem upon booting up the init value sets the value that your iPhone is home. In your program you probably use the iPhone=home to stop TV turning on when you are not home. If that program is enabled it will trigger the Then clause and turn on your TV. Usually with this problem you would have the first program call a second program with the time frame or state variable in it. The second program would be disabled so that it doesn't get triggered by lines you intended to be a condition only. Copy and paste your program here and people will help you fix it.. Right click on program and select copy to clipboard) Edited June 8, 2015 by larryllix
apostolakisl Posted June 8, 2015 Posted June 8, 2015 It is probably that you have "catch up programs at reboot" checked on your configuration page of ISY. You can change that to the grace period and select a period of time, so it only goes back say 15 minutes, or an hour, or whatever.
ahwman Posted June 8, 2015 Author Posted June 8, 2015 It is probably that you have "catch up programs at reboot" checked on your configuration page of ISY. You can change that to the grace period and select a period of time, so it only goes back say 15 minutes, or an hour, or whatever. Yep, unchecking this did the trick! Thanks so much for the suggestion as I completely forgot about it...
Recommended Posts