Change tile attribute state without changing value?

smarttiles

(Raphael Hsieh) #1

Is it possible to change a tiles state without changing its value ? Or are those just synonyms?

tileAttribute("device.temperature", key: "PRIMARY_CONTROL") {
            attributeState("off", label:'${currentValue}', unit:"dF", action:"heat", nextState:"turningOn", defaultState: true)
            attributeState("on", label:'${currentValue}', unit:"dF", action:"off", backgroundColor:"#00A0DC", nextState:"turningOff")
			attributeState("turningOn", label:'${currentValue}', unit:"dF", action:"off", backgroundColor:"#00A0DC", nextState:"turningOff")
			attributeState("turningOff", label:'${currentValue}', unit:"dF", action:"heat", nextState:"turningOn")
		}

I have a thermostat device handler that I want to be able to turn off/on, but I want it to always display the current temperature. So I’m using states to change the color in order to indicate off/on.

Having “nextState” works fine for changing the color. however the state doesn’t transition between the “device list” view, and the actual “device” view


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

They are not synonyms; they are somewhat loosely related.

  1. Tile States do not have a lot of options to manipulate them. They are either based on the current state of an Attribute, or the nextState (if defined), if the Tile is tapped, or a static text label, etc.

  2. The nextState value does not change the Attribute value!!! Only a “sendEvent()” (or the implied sendEvent() at the end of the parse() method) will actually change the Attribute value.