Reason why I can't control lights via SmartApp?

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 =

    if (command) {
        switches.each {
            if (it.displayName == name) {
                log.debug "sent command: Name: $name"

Several of my SmartApps that control lights are no longer working (just noticed today). Right now, it appears that there may be some kind of bug in the SmartThings backend.

Platform problems today resulted in many devices being unavailable. This is being tracked in the known issue section of the community created wiki:,_Harmony,_IFTTT,_SmartTiles)

There was also a post to the official status page. You can subscribe to that page for updates, although it’s not always very detailed.