I’m sure I’m missing something obvious, but I can’t control the lights from a SmartApp I’m writing. The command = “on” and I get the debug message with the correct name. Even with the .on() that I added directly it won’t turn on the light. I also tried applying it to all the lights, nothing works. Any help would be greatly appreciated.
void updateSwitches() {
def command = params.command
def name = params.name
if (command) {
switches.each {
it.on()
if (it.displayName == name) {
log.debug "sent command: Name: $name"
it."$command"()
}
}
switches."$command"()
}
}