Jump to content

Auto-Shutoff Lightswitch Group


klebel

Recommended Posts

Posted

Hi Guys,

 

I wrote a little program to monitor my front garage lights.  They get left on all the time.  There are two switched that I have added to a scene and made both controllers.  But since the ISY can't seem to monitor the status of a scene I had it monitor the two individual switches.  If the garage lights come on I just want them to turn off after 10 minutes.  What am I doing wrong below?

Garage Front Light Check - [ID 0014][Parent 0021][Run At Startup]

If
        (
             Control 'Garage - Front - 1' is switched On
          Or Control 'Garage - Front - 2' is switched On
        )
    And (
             Status  'Garage - Front - 1' is not Off
          Or Status  'Garage - Front - 2' is not Off
        )
 
Then
        Wait  10 minutes 
        Set Scene 'Switch Group Scenes / Front Garage Lights' Off
 
Else
   - No Actions - (To add one, press 'Action')
 

Thanks!

 

Kerry

 

Posted (edited)

Both sides of the "And" will not be True.

 

When the Program is triggered by receiving "Control" events the "Status" is Off.

 

When triggered by "Status" the "Control" events are false.

Edited by LeeG
Posted

Thanks for the super quick reply!  What do you suggest?  Should I just dump the status checks?

 

Kerry

Posted

Theoretically, once could turn on a light that is already on, so it is technically possible that this program could execute TRUE, but when one the lights are OFF and one turns them ON, this program will execute FALSE (not good).  This will be the case 99+% of the time in the real world.

 

Yes, eliminate the status checks is the step I would take.

Posted

Here is a set of (4) programs I use for a similar function in a multi-control situation. These further limit the total on time available to 60min. This can all be changed to suit your needs however. You would need to establish the variable too.

 

Barn Lights Check - This initiates the decrement program when the lights are turned on via Mobilinc or admin console.

If
        Status  'Barn / Barn Overhead Lights 1' is On
    And Status  'Barn / Barn Overhead Lights 2' is On
    And $Barn_Light_Minutes is 0
 
Then
        Wait  5 seconds
        Run Program 'Barn Lights Increment' (Then Path)
 
Else
   - No Actions - (To add one, press 'Action')
 

Barn Lights Decrement

If
        $Barn_Light_Minutes > 0
 
Then
        Wait  1 minute
        $Barn_Light_Minutes -= 1
        Wait  1 second
        Run Program 'Barn Lights Decrement' (If)
 
Else
        Set Scene 'Barn / Barn Lights' Off
        Wait  1 second
        $Barn_Light_Minutes  = 0
        $Barn_Light_Minutes Init To 0
        Stop program 'Barn Lights Decrement'
 

Barn Lights Increment

If
        (
             Control 'Barn / Barn Overhead Lights 1' is switched On
          Or Control 'Barn / Barn Overhead Lights 1' is switched Fast On
          Or Control 'Barn / Barn Overhead Lights 2' is switched On
          Or Control 'Barn / Barn Overhead Lights 2' is switched Fast On
        )
    And $Barn_Light_Minutes <= 30
 
Then
        Set Scene 'Barn / Barn Lights' On
        $Barn_Light_Minutes += 30
        Wait  1 second
        Run Program 'Barn Lights Decrement' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 

Barn Lights Off

If
        Control 'Barn / Barn Overhead Lights 1' is switched Off
     Or Control 'Barn / Barn Overhead Lights 1' is switched Fast Off
     Or Control 'Barn / Barn Overhead Lights 2' is switched Off
     Or Control 'Barn / Barn Overhead Lights 2' is switched Fast Off
     Or Status  'Barn / Barn Overhead Lights 1' is Off
 
Then
        Set Scene 'Barn / Barn Lights' Off
        Stop program 'Barn Lights Decrement'
        $Barn_Light_Minutes  = 0
        $Barn_Light_Minutes Init To 0
 
Else
   - No Actions - (To add one, press 'Action')
 


 
 

Posted (edited)

I use a different approach for my deck lights split into two sections around the outside decks of my house.
 
I can turn either light on and off or turn both on or off from either switch. Using your terminology.

 

Garage Front Light 1

If
        (
             Control 'Garage - Front - 1' is switched On
          Or Control 'Garage - Front - 2' is switched Fast On
        )
       And  Control 'Garage - Front - 1' is  NOT   switched Off
        And  Control 'Garage - Front - 2' is Not switched Fast Off

 

Then
        Set  'Front Garage Lights 1' On
        Wait  10 minutes
        Set  'Front Garage Lights 1' Off

Else
        Set  'Front Garage Lights 1' Off

 

 

 

Of course you would need to remove the scenes and create a reciprocal program for the other light 2

 

Garage Side Light 2

If
        (
             Control 'Garage - Front - 2' is switched On
          Or Control 'Garage - Front - 1' is switched Fast On
        )
      And  Control 'Garage - Front - 2' is NOT switched Off
      And Control 'Garage - Front - 1' is Not switched Fast Off
         )

Then
        Set  'Front Garage Lights 2' On
        Wait  10 minutes
        Set  'Front Garage Lights 2' Off

Else
        Set  'Front Garage Lights 2' Off
 

Edited by larryllix
Guest
This topic is now closed to further replies.

×
×
  • Create New...