Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Entry script question - 2420m + lighting?

Featured Replies

Posted

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...

  • 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.

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.