Jump to content

Simple programming question


rick.curl

Recommended Posts

I've got a bunch of programs and they're all running fine, but I'm trying to add one that should be simple but I can't get it to work.

Here's what I'm trying to do: On Mondays I leave the house at 5:30 AM, and on Tuesday, Wednesday, and Thursday I leave at 6:00.  If it's dark when I leave I would like the side yard light to be on for 15 minutes.  Here's what I've got at the moment:

If
   From    Sunset 
   To      Sunrise (next day)
   And     On Tue, Wed, Thu
           Time is 6:00:00AM
   Or      On Mon
           Time is 5:30:00AM
Then
     In Scene 'Outside / Side Yard'  Set 'Outside / Side Yard' 100% (on Level)
     Wait 15 minutes
     In Scene 'Outside / Side Yard'  Set 'Outside / Side Yard' 0% (on Level)
Else
   -No actions

I tried changing "Sunrise" to "same day" but it is still never running.  This has got to be something ridiculously simple that I'm overlooking.  What is it?

 

Thanks!

 

-Rick

Link to comment

I assume you are using the sunrise and sunset conditions as "dark", correct?

 

I suspect you have some logical priority issues here.  This can be corrected with a couple of parenthesis.  I also suspect your THEN clause is incorrect.  Rather than setting the responder levels, simply turn the scene on.

 

If
   From    Sunset 
  
To      Sunrise (next day)
   And

(

On Tue, Wed, Thu
           Time is 6:00:00AM
   Or   On Mon
           Time is 5:30:00AM

)

Then
     Set scene 'Outside / Side Yard'  ON
     Wait 15 minutes
    
Set Scene 'Outside / Side Yard'  OFF
Else
   -No actions

Link to comment

Try this. The parenthesis supercedes the AND which has a higher priority than the OR.

It should have worked on Mon at 5:30 regardless

 

If
   From    Sunset
   To      Sunrise (next day)
   And  (

           On Tue, Wed, Thu
           Time is 6:00:00AM
   Or      On Mon
           Time is 5:30:00AM

            )
Then
     In Scene 'Outside / Side Yard'  Set 'Outside / Side Yard' 100% (on Level)  <--- set scene ON not modify it
     Wait 15 minutes
     In Scene 'Outside / Side Yard'  Set 'Outside / Side Yard' 0% (on Level)    <---set scene Off, not modify it
Else
   -No actions

 

EDIT: OberKC is correct.I missed the then problem. Modifying scenes does not activate them.

Link to comment

Archived

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


×
×
  • Create New...