Jump to content

Help with program using multiple doors and time


danbutter

Recommended Posts

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.

Link to comment

Use parentheses for the Or statements.

 

And (

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

Link to comment

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

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...