rlkoshak
(Rich Koshak)
4
I just wrote up a Design Pattern for this sort of situation. I do this all the time.
In your case it would look something like
Temperature1 → Temperature1_automode
Temperature2 → Temperature2_automode
Assuming you put the automode Items into a gAutomode group and the Temperatures are in a group called gTemp
gTemp.members.forEach[temp |
val auto = gAutomode.members.filter[am|am.name == temp.name+"_automode"].head
sendCommand(if(auto.state != OFF) temp.state, OFF)
]
1 Like