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.

Security lights program

Featured Replies

Posted

I am having an issue with this program. Everything after the first "wait" works sporadically. Foyer goes off about half of the time - front house lights never turn off. Is there a better way to write this?

 

 

 

 

 

Front Security  - [iD 0030][Parent 0001]
If
        From    12:00:00AM
        To      Sunrise (same day)
    And Control 'Front House Security-S' is switched On
 
Then
        Set Scene 'Front House Lights' On
        Set Scene 'Dining Room' On
        Set Scene 'Foyer' On
        Wait  5 minutes
        Set Scene 'Dining Room' Off
        Wait  5 minutes
        Set Scene 'Foyer' Off
        Wait  5 minutes
        Set 'Front House Lights' Off
 
Else
   - No Actions - (To add one, press 'Action')
 
 

 

 

I am having an issue with this program. Everything after the first "wait" works sporadically. Foyer goes off about half of the time - front house lights never turn off. Is there a better way to write this?

 

 

 

 

 

Front Security  - [iD 0030][Parent 0001]
If

        From    12:00:00AM

        To      Sunrise (same day)

    And Control 'Front House Security-S' is switched On

 

Then

        Set Scene 'Front House Lights' On

        Set Scene 'Dining Room' On

        Set Scene 'Foyer' On

        Wait  5 minutes

        Set Scene 'Dining Room' Off

        Wait  5 minutes

        Set Scene 'Foyer' Off

        Wait  5 minutes

        Set 'Front House Lights' Off

 

Else

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

 

 

 

What type of device is "Front House Security-S", and once it's turned on does it stay on?

 

Every time a parameter in the IF statement changes the THEN clause will start over.

You program, if "Front House Security-S" remains on during the specified times, will run twice, once at 12:00AM and once at Sunrise.

It can only run True when the

  • And Control 'Front House Security-S' is switched On

is triggered.

 

Any other time it is Fase and with AND logic, the whole If section logic statement can otherwise never  be True.

Edited by larryllix

Anytime you have problems with statements after a "Wait" not running, suspect the issue raised above.

 

The quick and dirty workaround is to move all the actions into a separate program.

Front Security Switch - [ID 0030][Parent 0001]
If
    From 12:00:00AM
    To Sunrise (same day)
    And Control 'Front House Security-S' is switched On

Then
     Run Program 'Front Security' (Then path)
Else
     Run Program 'Front Security' (Else path)
The second program, below, has no conditions, so it will only run when it is called explicitly, in this case, by the first program:

Front Security - [ID 0031][Parent 0001]
If 
     - No Conditions -

Then
    Set Scene 'Front House Lights' On
    Set Scene 'Dining Room' On
    Set Scene 'Foyer' On
    Run Program 'Front Security' (Else path)

Else
    Wait 5 minutes
    Set Scene 'Dining Room' Off
    Wait 5 minutes
    Set Scene 'Foyer' Off
    Wait 5 minutes
    Set 'Front House Lights' Off
Because the second program has no conditions, there is nothing to be reevaluated after the wait, it will always run all the way to end.

Edited by KeviNH

  • Author

What type of device is "Front House Security-S", and once it's turned on does it stay on?

 

Every time a parameter in the IF statement changes the THEN clause will start over.

 

It is a motion sensor

  • Author

I think the 2 programs is the answer. But let me make sure my statement "And Control 'Front House Security-S' is switched On" is correct. This is a MS. Any issues with that? It seems to turn everything on fine - It is just the turning off that is the problem.

I think the 2 programs is the answer. But let me make sure my statement "And Control 'Front House Security-S' is switched On" is correct. This is a MS. Any issues with that? It seems to turn everything on fine - It is just the turning off that is the problem.

Yes, you're good.

 

For testing out programs like this one, try making the sensor trigger a noise or notification, for example:

Front Security Switch - [ID 0030][Parent 0001]
If
     Control 'Front House Security-S' is switched On

Then
     Run Program 'Front Security' (If path)
     Set Scene 'Dining Room' Beep 

The "Beep" line will cause any beep-enabled controller (e.g. a lightswitch) in the scene to emit a single chirp.   I like to use a notification which writes a timestamped line to a logfile for this kind of execution tracking.

 

 

The second program, below, is disabled (You'll need to right click on the program and select 'Disable') and has the time range as the conditions, so when 'If' is called by the first program, it will only run if the time condition is true. 

NOTE:   Disable this program!!!
Front Security - [ID 0031][Parent 0001] 
If   
     From 12:00:00AM
     To Sunrise (same day)

Then
    Set Scene 'Front House Lights' On
    Set Scene 'Dining Room' On
    Set Scene 'Foyer' On
    Wait 5 minutes
    Set Scene 'Dining Room' Off
    Wait 5 minutes
    Set Scene 'Foyer' Off
    Wait 5 minutes
    Set 'Front House Lights' Off

Else
    - No Actions -

With the above, anytime the motion sensor is triggered, you will get a beep, but only when it is triggered at night will it turn the lights on, then off.

Edited by KeviNH

  • Author

Great idea - Thanks Kevin!

Great idea - Thanks Kevin!

If your device is a motion detector, retriggering your program, a second program will be called and retrigger the same as one program did, cancelling further program lines from executing. A trigger, whether from being called by another program, or an internal If section trigger event line, makes no difference.

 

Two programs will not help that problem.

 

You need to have an MS that doesn't retrriger on motion until the the Waits are all done, or a disable the first program from the second to lock out further action until done, and then re-enable the first program again.

  • Author

Let me play with this. But even if it retriggers, wouldnt that just reset the wait? Looking at the logs, this thing triggers earlier in the night (morning) like 1 am. Then I wake up in the morning and they are still on. Except the dining room light.

Let me play with this. But even if it retriggers, wouldnt that just reset the wait? Looking at the logs, this thing triggers earlier in the night (morning) like 1 am. Then I wake up in the morning and they are still on. Except the dining room light.

Yeah, Last trigger it should complete with any amounts of retriggering.

 

I suspect you have somethng in your scene Offs that isn't working. Test them manually from the admin console.

 

That program time schedule cannot run anything except Else, ANDed with a control/switched line. A control/switched line is never True to other conditions, only when it triggers itself.

Another thought. Some Insteon MSes send erroneous On signals when their batteries are getting low.

 

It's just possible this may be an issue here.

Another thought. Some Insteon MSes send erroneous On signals when their batteries are getting low.

 

It's just possible this may be an issue here.

Another good reason to add a "Beep", notification, or log to the first program, as shown above.

 

Yeah, Last trigger it should complete with any amounts of retriggering.

 

I suspect you have somethng in your scene Offs that isn't working. Test them manually from the admin console.

 

That program time schedule cannot run anything except Else, ANDed with a control/switched line. A control/switched line is never True to other conditions, only when it triggers itself.

 

With the original single program, conditions are re-evaluated (including at the end of each Wait).  Program will stop early if the conditions are false, which is why statements after the wait sometimes do not execute.

 

Go with the two program solution, so "Last trigger it should complete with any amounts of retriggering".

Edited by KeviNH

I'd create a single scene with all devices that you want on as a responder. That way you lessen the chance of something potentially getting missed when each scene is activated

Another option is to set a variable in the first program at the same time the MS is triggered, and then have the second program run when the variable is set.

 

Once the 2nd program completes you can have it set the variable back to 0.

  • Author

Thanks for all the suggestions - I have it working properly now.

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.