Jump to content

Issue with executing "then" statement


browneosu

Recommended Posts

Posted

So, I have had this issue for a while and I am hoping I am setting up the command wrong.  When I execute a "then" statement which has multiple modify insteon commands only the first command seems to execute unless I call a whole other program to run.  For instance, if I command in the then statement:

wait 10 seconds

turn off light A

wait 10 seconds

turn on light A

 

Only the first turn off command will be executed and it seems like the last two (wait and turn light on) do not run as part of the 'then' statement.  Does anyone know why this is happening or seen it happen on their system?  It has always bothered me something this simple fails.

 

thank you!

 

Posted

Your ‘If’ probably is testing ‘Light A’.

When you turn it off, then have the ‘Wait’ - the ‘If’ will get retriggered. Your ‘Else’ is likely then set executing.

  • Like 1
Posted

Thank you so much, you are correct!  I didn't even think about that.

One other question since you have been so helpful.....  What does "responding" mean under the "status" setting.  I thought it meant when light A was triggered (ie button pressed) to ON or OFF but I don't think that is the case.  Also, what is the difference between "status" and "control" when writing a program.  It seems that I really only ever use "status" on or off but I am sure I am missing out on capability.  Thanks again for all of your help!

Posted (edited)
21 minutes ago, browneosu said:

Thank you so much, you are correct!  I didn't even think about that.

One other question since you have been so helpful.....  What does "responding" mean under the "status" setting.  I thought it meant when light A was triggered (ie button pressed) to ON or OFF but I don't think that is the case.  Also, what is the difference between "status" and "control" when writing a program.  It seems that I really only ever use "status" on or off but I am sure I am missing out on capability.  Thanks again for all of your help!

Control is a signal generated by the pushbutton of a SwitchLinc (and other devices), while Status is the current level of the dimming electronics.

Control can detect an operation repeatedly while status can only detect an On or Off once until the status changes and then back again.

If
    control of X is switched 'On'
Then
    Turn on YYY device
    Wait 10 minutes
    Turn Off YYY device
Every time X is switched On (paddle tapped) the Wait 10 minutes will trigger when Then start over.

 

With status...
If
    status  of X is 'On'
Then
    Turn on YYY device
    Wait 10 minutes
    Turn Off YYY device
The trigger can never retrigger the Wait 10 minutes timer unless the status changes Off (or 0-99%)  and then to On again. But if  the status changes, the If section will re-evaluate and run the Else (it isn't 'On') , cancelling the Wait 10 minutes.

 

BTW: If you right click on a program in admin console, you can copy to clipboard and then paste it here.

Edited by larryllix
Posted (edited)

Control: 
-triggers a program when:  Someone physically acts upon the switch (for switches) and performed the precise statement listed.  ie control "on" means the on paddle was tapped.  Any other action to the switch is ignored.  Like press and hold the on (which is control dim up), or double tap on (which is fast on), or any action to the down button.
-the statement may be otherwise evaluated if something else triggers the program (like an additional if line) and the statement will always be false.  For example, control switched on will always be false if something besides someone physically tapping the on paddle triggered the program.  Usage is mostly confined to:

If
device x is switched on              (always false, except at the instant ISY receives the "on" statement from the switch)
and
device x is not switched off         (always true, except at the instant ISY receives the "off" statement from the switch)

The above is used to have the "then" run when a switch is tapped on, and the "else" run when tapped off.  

Status: 
-triggers a program when: The device status changed for any reason.  Regardless if it was acted upon directly or responded to something else.
-the statement may otherwise be evaluated if something else triggers the program (like an additional line in the "if") and will be true if indeed the status of the switch is as listed or false if otherwise.  ie, if status device x is off  will test as true if the device is off at the time the program triggers regardless of what triggered the program.  NOTE: It will also be true in the case that the triggering action culminated in that status.  ie "if status device x is off" will be true if the device began in any state beside off and became off.  In that case, the switch becoming off triggers the program and evaluates true.

Understand that a "control" condition is an instantaneous condition corresponding to the exact point in time that the ISY receives the message from the switch that it was tapped.  No two control statements are ever processed simultaneously.  If using the "not" then it is just the opposite, it is always true except for the instant ISY receives that command at which point it tests false.

Edited by apostolakisl
  • Like 1
Guest
This topic is now closed to further replies.

×
×
  • Create New...