tiles(scale: 2) {
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
attributeState "panic", label:'${name}', action:"alarm.off", icon:"st.security.alarm.alarm", backgroundColor:"#e86d13", nextState:"resetting"
attributeState "resetting", label:'${name}', icon:"st.security.alarm.clear", backgroundColor:"#e86d13"
}
tileAttribute ("device.level", key: "SLIDER_CONTROL") {
attributeState "level", action:"switch level.setLevel"
}
}
standardTile("refresh", "device.switch", width: 2, height: 2, decoration: "flat") {
state "default", action:"refresh.refresh", icon:"st.secondary.refresh"
}
standardTile("alarm", "device.alarm", width: 2, height: 2, decoration: "flat") {
state "off", label:'', action:"alarm.strobe", icon:"st.secondary.strobe", backgroundColor:"#ffffff"
state "strobe", label:'', action:"alarm.off", icon:"st.secondary.strobe", backgroundColor:"#e86d13"
}
standardTile("protection", "device.protection", width: 2, height: 2, decoration: "flat") {
state "default", label:'Updating...', action:"protectionDisabled", icon:"st.Home.home30"
state "disabled", label:'Protection Off', action:"protectionSequenceControl", icon:"st.Home.home30"
state "sequence", label:'Sequence Ctrl', action:"protectionRemoteOnly", icon:"st.Home.home30"
state "remote", label:'Remote Only', action:"protectionDisabled", icon:"st.Home.home30"
}
valueTile("range", "device.range", width: 2, height: 1, wordWrap: true) {
state "default", label:'${currentValue}'
}
valueTile("ramp", "device.ramp", width: 2, height: 1, wordWrap: true) {
state "default", label:'${currentValue}'
}
valueTile("delayed_off", "device.delayed_off", width: 2, height: 1, wordWrap: true) {
state "default", label:'${currentValue}'
}
valueTile("kickstart", "device.kickstart", width: 2, height: 1, wordWrap: true) {
state "default", label:'${currentValue}'
}
valueTile("panic_on", "device.panic_on", width: 2, height: 1, wordWrap: true) {
state "default", label:'${currentValue}'
}
valueTile("panic_off", "device.panic_off", width: 2, height: 1, wordWrap: true) {
state "default", label:'${currentValue}'
}
main(["switch"])
details(["switch", "refresh", "alarm", "protection", "range", "ramp", "delayed_off", "kickstart", "panic_on", "panic_off"])
}