Jump to content

Entry script question - 2420m + lighting?


RichTJ99

Recommended Posts

Hi,

 

I just finished two scripts. I am hoping for some feedback.

 

I am looking to make it so when my front door motion sensor goes off, it will make the Entry light (KPL) turn on for 5 minutes, then shut itself off.

 

If the Front porch light, or the Entry KPL light is on, it should do nothing.

 

Any ideas on how to make this more streamlined?

 

Thanks,

Rich

 

Front Door Timeout:

 

If
       Time is Last Run Time for 'Front Door Motion' +  5 minutes
   And Status  'Upstairs: Entry KPL' is On

Then
       Wait  5 seconds
       Set 'Upstairs: Entry KPL' Off

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

 

Front Door Motion:

 

If
       Control 'Motion: Front Door Motion' is switched On
   And Status  'Outside: Front Porch' is Off
   And Status  'Upstairs: Entry KPL' is Off

Then
       Set 'Upstairs: Entry KPL' On

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

 

 

Hrmmm, something isnt right...

Link to comment
  • 3 weeks later...

First, I presume that you have NOT linked the motion detector directly to your entry light (KPL), but are using the ISY to effect the desired light changes. (Otherwise, the motion detector will normally send an OFF command after a certain period of no motion.)

 

I think your code will have the following issue: Say you turn the entry light on manually. Later, when the motion detector senses motion, the Door Motion program runs, even though it doesn't do anything (the If clause is false since one of the lights is on). Nevertheless, this updates the Last Run Time for this program, which will then cause the Door Timeout program to run in 5 minutes, turning off the Entry light.

 

However, this can be fixed pretty easily. Even though the Door Motion program ran, its Status will be False (the If clause evaluated to false). So, just add another And Condition to your Door Timeout If clause: And Program Door Motion Is True. This will cause Door Timeout to run only if the Door Motion program actually turned on the entry light.

 

BTW, as you have it set up, if the porch light is on, the motion detector will do nothing.

Link to comment

Archived

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


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...