can someone help me figure out why my icon state is not changing… I have the following:
metadata {
definition (name: “Aeon Dimming Metering Smart Switch 6”, namespace: “smartthings”, author: “lg kahn”) {
capability "Switch"
capability "Polling"
capability "Power Meter"
capability "Energy Meter"
capability "Refresh"
capability "Switch Level"
capability "Sensor"
capability “Actuator”
command "followMode"
command "briefMode"
command "nightLightMode"
fingerprint inClusters: "0x26,0x32"
}
… later
standardTile("deviceMode", "state.currentMode", inactiveLabel: false, canChangeIcon: true) {
state "0", label:'Follow', action:"briefMode", icon: "st.switches.switch.on", backgroundColor: '#ffffff', defaultState : true
state "1", label:'Brief', action:"nightLightMode", icon: "st.switches.switch.off", backgroundColor: '#0011cc'
state "2", label:'NightLight', action:"followMode", icon: "st.switches.switch.on", backgroundColor: '#cc00cc'
}
main(["switch","power","energy"] )
details(["switch", "power", "energy", "levelSliderControl", "deviceMode","refresh", "reset"])
then finally these fx…
the fx are getting called… but the icon tile is not changing…
def nightLightMode() {
log.debug "in set nightlight mode"
setDeviceMode(2)
}
def followMode() {
log.debug “in set follow mode”
setDeviceMode(0)
}
def briefMode() {
log.debug “in brief mode”
setDeviceMode(1)
}
def setDeviceMode(mode) {
log.debug “in set device mode”
state.currentMode = mode
log.debug “set current mode to ‘$mode’”
zwave.configurationV1.configurationSet(parameterNumber: 0x51, size: 1, scaledConfigurationValue: mode).format()
sendEvent(name: “deviceMode”, value: mode)
}
I also initialize the current state in the on method
as follows:
state.currentMode = 0
thanks in advance…
larry