slm800 Posted August 15, 2016 Posted August 15, 2016 I have, what I thought was a very simple code as follows to turn my porch light on at a certain time if I was home and at a different time if I was not home, however whenever the light comes on, this code is causing the then, else to stay in a continuous loop making the light go on and off constantly. I also tried to remove the else statement as I have a different program to turn the light off if it's not within these time allowances and the light is on, but that didn't seem to work either. Can someone please advise as to what is wrong with my code here and help me understand and advise how to fix it? Thanks; Turn Light On If ( $iPhone_New Geofence is 0 And From 11:00:00PM To 7:00:00AM (next day) ) Or ( $iPhone_New Geofence is 1 And From 7:45:00PM To 1:00:00AM (next day) ) And Status 'Porch Light' is not on Then Set 'Porch Light' On Else Set 'Porch Light' Off Turn Light Off If $iPhone_New Geofence is 1 And Status 'Porch Light' is On And From 1:01:00AM To 7:44:00PM (same day) Then Set 'Porch Light' Off
paulbates Posted August 15, 2016 Posted August 15, 2016 Hi, I would try removing this statement: And Status 'Porch Light' is not on Also, how does the iphone geofece get set? Is that another program, if so please show it as well Paul
slm800 Posted August 15, 2016 Author Posted August 15, 2016 I use Mobilinc Location Controller to set the geofence.
Recommended Posts