I’m just starting to work with groups with rules, in order to reduce the volume of replicated code as well as the total number of rules.
I found the following code snippet while researching this topic. Here the door name is used to create another related item name “timer”. Close to what I want to do but not exactly.
// if(door.state == OPEN) sendCommand(door.name+"_Timer", "ON")
// else postUpdate(door.name+"_Timer", "OFF")
I need / want to do something similar to the above, but inside of a logical statement…like the following code snippet. Can this be done? If yes, what is the correct syntax? Also, is there somewhere this is documented, as I would like to study and bookmark. TIA.
while ( ((i=i+1) < 10) && (mbr+"_DownPower".state == ON) ) {
Thread::sleep(1 * 250)
}
In the likely event that I have lost my mind, alternate approaches would be appreciated.