Jump to content

Help with program using multiple doors and time


danbutter

Recommended Posts

Posted

I have been trying to get this program to work for a bit and it seems to work for one door, but not the other.  Or maybe not both at the same time. I'm not the best with this type of logic.

So I'll post it here and hope someone better at this can see why it isn't working for me.

DwayLightAfter Sunset - [ID 0025][Parent 0001]

If
        From    Sunset  + 15 minutes
        To      Sunrise + 15 minutes (next day)
    And 'Outside / DetachGarageNorthDoor' Status is Open
     Or 'Outside / DetachGarageSouthDoor' Status is Open
 
Then
        Set 'Outside / DetachDrivewayLight' On
 
Else
        Wait  10 minutes and 20 seconds
        Set 'Outside / DetachDrivewayLight' Off
 


any thoughts?

 

Thanks for looking.

Posted

Use parentheses for the Or statements.

 

And (

         'Outside / DetachGarageNorthDoor' Status is Open
        Or 'Outside / DetachGarageSouthDoor' Status is Open
        )

Posted (edited)

Because AND has a higher order of operation than OR it is logically assumed you are doing this
 


If
    (
      From Sunset + 15 minutes
      To Sunrise + 15 minutes (next day)
    And
      'Outside / DetachGarageNorthDoor' Status is Open
    )
    Or
      'Outside / DetachGarageSouthDoor' Status is Open

Follow Stu's fix above

Edited by larryllix
Posted

Okay I finally had time to try this during daylight hours today and it seems to work ok.

I wasn't aware of the parentheses. It did take me a few tries to get them in the correct order, but it worked.

Thanks much for the help!

Guest
This topic is now closed to further replies.

×
×
  • Create New...