Jump to content

Help with this code, causing lights to flicker


slm800

Recommended Posts

Posted

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
Posted

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

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.5k
×
×
  • Create New...