Jump to content

Motion Sensing Garage Lights


pelle8

Recommended Posts

Posted

I have this program that doesn't seem to be working correctly. I want to be able to turn the garage lights on for motion anytime, when the garage door is closed. But, during the day, don't turn on the lights when the garage door is open. The logic seems to work fine at night, but it doesn't seem to work correctly during the day. The lights don't seem to turn off during the day after motion turns them on. Any thoughts or suggestions on this would be great. Thanks, John P.

 

If
       (
            Control 'GarageMotionSensor-Sensor' is switched On
        And Status  'IOLinc-GarageDoor-Sensor' is On
        And From    Sunrise +  1 hour 
            To      Sunset  -  1 hour  (same day)
       )
    Or (
            Control 'GarageMotionSensor-Sensor' is switched On
        And From    Sunset  -  1 hour 
            To      Sunrise +  1 hour  (next day)
       )

Then
       Set 'GarageLight' On
       Wait  2 minutes 
       Set 'GarageLight' Off

Else
  - No Actions - (To add one, press 'Action')


Posted

I am not sure what to do with the else statement that is suggested, but I think my issue is that the sensor status generates an event which causes the if clause to be re-evaluated. What if I use an integer variable for the sensor status (set by another program) so that an event isn't generated in this program when the garage door is opened after the lights turn on due to motion. If a program in the else area of my original program would be better, then any suggested text would be great. Thanks, John P.

Posted

Try splitting this into two programs as follows:

If
       (
            Control 'GarageMotionSensor-Sensor' is switched On
        And Status  'IOLinc-GarageDoor-Sensor' is On
        And From    Sunrise +  1 hour
            To      Sunset  -  1 hour  (same day)
       )
    Or (
            Control 'GarageMotionSensor-Sensor' is switched On
        And From    Sunset  -  1 hour
            To      Sunrise +  1 hour  (next day)
       )
Then
     Run Program GlightTimer (Then Path)

Else
  - No Actions - (To add one, press 'Action')

 

Program GlightTimer

If

Then
       Set 'GarageLight' On
       Wait  2 minutes
       Set 'GarageLight' Off

Else
  - No Actions - (To add one, press 'Action')

 

Hope this helps.

 

-Xathros

Posted

Thanks for the reply. Will your suggestion also cause the lights to stay on if motion is detected during the 2 minute wait? Also, how is this different than what is in my original program? I understand that the second one won't run by itself, but any event in the first one that evaluates true will cause the second program to run, which seems the same as what I currently have. I am sure I am missing something basic here, but I am new to the ISY. Thanks, John P.

Posted

Yes. The timer will restart every time the 2nd program is called even if it is already running. This is different because the first program can now evaluate false and not terminate the countdown in the then clause since the timer is now in a separate program.

 

-Xathros

Posted

Anytime.

 

Happy to help.

 

-Xathros

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.5k
×
×
  • Create New...