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.

Run command after loop

Featured Replies

Posted

I am interested in running a command after my repeat loop is complete.  For example I am running this:

then

  Repeat 4 times

    Set 'MainHouse / Bulb - Office' On

    Set 'MainHouse / Bulb - Foyer' On

    Wait 1 second

    Set 'MainHouse / Bulb - Office' Off

    Set 'MainHouse / Bulb - Foyer' Off

    Wait 1 second

 

but every so often one of the bulbs is left on.  I'd like to do something to the effect of (I recognize the brackets are not appropriate in this context...I put them here for demonstration)

  {Repeat 4 times

    Set 'MainHouse / Bulb - Office' On

    Set 'MainHouse / Bulb - Foyer' On

    Wait 1 second

    Set 'MainHouse / Bulb - Office' Off

    Set 'MainHouse / Bulb - Foyer' Off

    Wait 1 second}

  Set 'MainHouse / Bulb - Office' Off

  Set 'MainHouse / Bulb - Foyer' Off

 
I know I can run commands before the loop.  
 
I'm going to wrap the loop into a separate program and try that, but hate cluttering the folder. Should I just get over that?

After the commands you want to loop, put a 'Repeat 1 time' command. Commands after that won't repeat.

Edited by MWareman

Hitting an Insteon Network with repeated commands sometimes bogs it down and the ISY/PLM transmit buffers may overflow and forget/miss things.

 

Try a longer wait time in your loop for an experiment.

 

This sounds like you have some flakey comms and that will increase the Insteon traffic congestion even more with repeated tries.

 

Yu could also try putting the devices into one scene and flash it on and off. It causes less Insteon traffic. I use with 20 devices in it (whole house) and it works much better for flashing. Two second delays work better though.

Edited by larryllix

  • Author

I actually wrapped it up in the program and it looks like this.  In the end this really is a better organization and if I want to clean up clutter I can move sub-routines (of sorts) to a folder.  So far this seems to work fine.  I may also inject some additional pause as advised by larryllix.  The comm does have to travel from one box to a sub panel box to get to the bulb in question (yes, I have a phase coupler) which may add to some flakiness.  Would injecting the pause between the on's and off's help that any?

 

FlickerForDrivewayMotion program:

if 

  Control 'Mainhouse / MotionSensorDriveway / Sensor-Sensor' is switched On

then

  Run Program 'BulbsFlicker' (Then Path)

  Run Program 'BulbsTurnOff' (Then Path)

 

BulbsFlicker program:

then

  Repeat 4 times

    Set 'MainHouse / Bulb - Office' On

    Set 'MainHouse / Bulb - Foyer' On

    Wait 1 second

    Set 'MainHouse / Bulb - Office' Off

    Set 'MainHouse / Bulb - Foyer' Off

    Wait 1 second

 

BulbsTurnOff program:

then

  Set 'MainHouse / Bulb - Office' Off

  Set 'MainHouse / Bulb - Foyer' Off

I actually wrapped it up in the program and it looks like this. In the end this really is a better organization and if I want to clean up clutter I can move sub-routines (of sorts) to a folder. So far this seems to work fine. I may also inject some additional pause as advised by larryllix. The comm does have to travel from one box to a sub panel box to get to the bulb in question (yes, I have a phase coupler) which may add to some flakiness. Would injecting the pause between the on's and off's help that any?

 

FlickerForDrivewayMotion program:

if

Control 'Mainhouse / MotionSensorDriveway / Sensor-Sensor' is switched On

then

Run Program 'BulbsFlicker' (Then Path)

Run Program 'BulbsTurnOff' (Then Path)

 

BulbsFlicker program:

then

Repeat 4 times

Set 'MainHouse / Bulb - Office' On

Set 'MainHouse / Bulb - Foyer' On

Wait 1 second

Set 'MainHouse / Bulb - Office' Off

Set 'MainHouse / Bulb - Foyer' Off

Wait 1 second

 

BulbsTurnOff program:

then

Set 'MainHouse / Bulb - Office' Off

Set 'MainHouse / Bulb - Foyer' Off

Your main program calls the flicker program and then immediately calls a program to turn them off while Flicker is running. You have no control on which program ISY will execute first.

 

Put your program lines from both program back into the DrivewayMotion program and addd a "Repeat 1 times" as per MWareman, if you want another Off insurance. Increase at least one Wait to 3 seconds. I like make the Off time 3 seconds and the On time 1 second so it looks more attention getting.

Edited by larryllix

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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.