Jump to content

Run command after loop


x046866x

Recommended Posts

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?
Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

Archived

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


  • Recently Browsing

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

    • There are no registered users currently online
  • Forum Statistics

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