Indigo maximizes performance and reliability by running actions in parallel to the greatest extent possible. This works for the vast majority of cases. Unfortunately, it can also result in non-deterministic execution with irreproducible results. Consider the following actions in a action group:
set value of variable_1 to X
set value of variable_2 to Y
run action group that depends on variable_1 and variable_2
I have found that the third action in the list will sometimes run before the first. I know it is against everything Indigo is hoping to accomplish, to allow serialized execution. However, I wish I could have a checkbox on the action group to "Execute sequentially".
Of course, I can put all of the above into a python script. If I do that however, I am no longer dealing with clearly named variables, but variable numbers. This isn't maintainable, as I have to look up each number in the variable list to understand the code a month from now. It also loses the elegance that Indigo offers.
I can also introduce delays. That could work, but the minimum delay provided is 1 second... a bit too slow for responsive lighting.
-------
Warning, wonky details follow
If you want to know the specifics of what I'm trying to accomplish, take a peak at the attached screen capture. To make a very large lighting installation maintainable:
- I have lighting levels for each type of device and time of day in a folder in the variables table.
- A schedule sets global brightness variables to the appropriate values from the table four times a day.
- The attached action fires when you walk into a room (motion sensor), or touch an Insteon dimmer switch
- It sets room brightness variables from the global values
- A guard-variable is set true, allowing an action group to run and apply those lighting levels
The intent is a dynamic scene, appropriate to the time of day. During the day, I want most lights to be very bright, and at night, more gentle lighting is preferred. I get a scene appropriate to time of day just by walking into a room or pawing at a dimmer switch... no hunting for a button required.
This works fine, but I quickly discovered that actions run in parallel. I originally carried out all the actions in this one action group. I then tried using a guard variable (1_SDY_fureScene) for barrier synchronization, but of course, all the variable assignments are executed in parallel.
All this was discussed quite some time ago in the following thread:
viewtopic.php?f=152&t=15946