Help me set master switch on and off all smartthing?


(Chanon Boonsuk) #1

I need set master switch on and off all device . I have code but I test master switch device delay slowly I need device on and off 1 sec ? :cry:

preferences {
section(“When this switch is turned on, off or dimmed”) {
input “master”, “capability.switch”, title: “Where?”
}
section(“Turn on or off all of these switches as well”) {
input “switches”, “capability.switch”, multiple: true, required: false
}
section(“And turn off but not on all of these switches”) {
input “offSwitches”, “capability.switch”, multiple: true, required: false
}
section(“And turn on but not off all of these switches”) {
input “onSwitches”, “capability.switch”, multiple: true, required: false
}
section(“And Dim these switches”) {
input “dimSwitches”, “capability.switchLevel”, multiple: true, required: false
}
}

def installed()
{
subscribe(master, “switch.on”, onHandler)
subscribe(master, “switch.off”, offHandler)
subscribe(master, “level”, dimHandler)
}

def updated()
{
unsubscribe()
subscribe(master, “switch.on”, onHandler)
subscribe(master, “switch.off”, offHandler)
subscribe(master, “level”, dimHandler)
}


#2

Dimmers will not go on or off in 1 sec, it will do it in their own config that for some(if not all) is unchangeable. I have a couple of old RP200 dimmers that they are slow but Cree bulbs are faster.