Jump to content

Program Question


GaryK4

Recommended Posts

Currently, I use IFTTT and my own REST programs to handle voice control. Now I am testing Google Home with the portal. Scenes don't have feedback, so you may have to trigger it twice to get the desired results. 
I created a test program to control the media room lights. I only want the program to run once, then stop / exit. I put a stop program command at the end of the then & else, but that does not work. It just keeps running. While testing, I use the stop menu command and that does not stop it either. I have to disable an re-enable the program.

What am I doing wrong?

I am on version 4.8

 

Capture.JPG

Link to comment

It is not getting to the Stop program command.  When you change the device (center ceiling) it causes the program to re-trigger the 'if' evaluation and run 'Then' or 'Else' accordingly.  You have created an infinite loop.

As far as why the stop menu command is not working, I can only guess.  The last insteon command to change the light has probably already been sent out by the PLM when you issue the stop.  But the light then responds to the command after the program has stopped (due to communications or queue delays) and that starts the program up again.

Link to comment
1 hour ago, GaryK4 said:

Wow, I am not used to a language doing this. I will have to figure out a workaround.

 

ISY is a self-triggering event driven language. When you manipulate an element's status within a program you usually suffer a repetitive oscillation in the program when the same program's "If" section detects the change.

"Stop" only stops the current execution but the If section retriggers it and it starts again. You may have trouble getting control of your ISY if you run this program.

Link to comment
3 hours ago, gzahar said:

It is not getting to the Stop program command.  When you change the device (center ceiling) it causes the program to re-trigger the 'if' evaluation and run 'Then' or 'Else' accordingly.  You have created an infinite loop.

That's not entirely true. It will go through all of the commands in the Then branch or Else branch every time the status changes. The "re-trigger" of a program (specifically the program halting mid-stream and re-evaluating the conditions - called "reentry") can only occur when the program hits a WAIT or REPEAT command. You are correct that, since the program changes the status of the Center Ceiling, that the program will run in a loop continuously, but each individual run won't be interrupted when the status changes.

As far as the OP, I think what may be missing here is logic as to what you are trying to do. What do you want to trigger the program, a voice command from Google? If that's the case, take the condition out all together. Tell Google to "Turn On TV Mode" and the ISY will run the Then branch of the program. Tell Google to "Turn Off TV Mode" and the ISY will run the Else branch. The condition is not needed.

Link to comment
That's not entirely true. It will go through all of the commands in the Then branch or Else branch every time the status changes. The "re-trigger" of a program (specifically the program halting mid-stream and re-evaluating the conditions - called "reentry") can only occur when the program hits a WAIT or REPEAT command. You are correct that, since the program changes the status of the Center Ceiling, that the program will run in a loop continuously, but each individual run won't be interrupted when the status changes.
As far as the OP, I think what may be missing here is logic as to what you are trying to do. What do you want to trigger the program, a voice command from Google? If that's the case, take the condition out all together. Tell Google to "Turn On TV Mode" and the ISY will run the Then branch of the program. Tell Google to "Turn Off TV Mode" and the ISY will run the Else branch. The condition is not needed.

Good catch. Forgot about that. It must be inherent delay in the status changing that restarts the program. Or it’s queuing up the status change?
Link to comment
1 hour ago, Goose66 said:

That's not entirely true. It will go through all of the commands in the Then branch or Else branch every time the status changes. The "re-trigger" of a program (specifically the program halting mid-stream and re-evaluating the conditions - called "reentry") can only occur when the program hits a WAIT or REPEAT command. You are correct that, since the program changes the status of the Center Ceiling, that the program will run in a loop continuously, but each individual run won't be interrupted when the status changes.

As far as the OP, I think what may be missing here is logic as to what you are trying to do. What do you want to trigger the program, a voice command from Google? If that's the case, take the condition out all together. Tell Google to "Turn On TV Mode" and the ISY will run the Then branch of the program. Tell Google to "Turn Off TV Mode" and the ISY will run the Else branch. The condition is not needed.

Goose66,
That is exactly what I was trying to do. I was experimenting with variable, multi-programs and pulling my hair out (which I can't afford) ? Your solution is way too simple.
It works great! I did not know that you could have a null if statement. I am still fuzzy on the reentry handling, but I will save that for another day.

Thanks alot!

Link to comment

Archived

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


×
×
  • Create New...