Is there a way to do something like the below? It’s not working code, but I wanted to know if there was a way to do something like this.
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
[value:"02", { // mode2
attributeState "on", label:'Open', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
attributeState "off", label:'Closed', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
attributeState "turningOn", label:'Opening', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
attributeState "turningOff", label:'Closing', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
}],
[value:"01", { // mode1
attributeState "on", label:'Open', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"stop1"
attributeState "off", label:'Closed', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"stop2"
attributeState "stop1", label:'Stop', action:"stop", backgroundColor:"#cccccc", nextState:"off"
attributeState "stop2", label:'Stop', action:"stop", backgroundColor:"#cccccc", nextState:"on"
}],
}
}