valueTile tutorial doesn't work


(Remy Koelemij) #1

Hi all,

I think I’m going crazy, but maybe it’s just a minor thing that I constantly overlook. I can’t get a valueTile populated:

    metadata {
        definition (name: "Fibaro Thermostat", namespace: "DuMees", author: "Remy Koelemij") {
            capability "Battery"
            capability "Power"

            attribute "battery", "NUMBER"

            fingerprint mfr:"010F", prod:"1301", model:"1000", deviceJoinName: "Fibaro Z-Wave Thermostat"
        }

      tiles(scale: 2) {
            valueTile("text", "device.text", width: 2, height: 2) {
                state "val", label:'${currentValue}', defaultState: true
            }

            main("text")
            details([
                "text"
            ])
        }
    }

    def installed() {
        sendEvent(name: "text", value: "120%")

    }

    def parse(String description) {
    }

I borrowed this from an example, did the tutorial but it doesn’t seem to work. Did something changed and the documentation is not updated?

Regards,

Remy


(Tony - SmartThings Unpublished Contributor ) #2

Try adding isStateChange : true to the sendEvent

sendEvent(name: “text”, value: “120%”, isStateChange: true)


(Robin) #3

Place your send event inside def updated() instead of def installed()

Events default to isStateChange: true so it doesn’t need to be included.


(Tony Fleisher) #4

‘text’ should be added as an attribute in the metadata definition block


(Robin) #5

It can be read through the ‘door’ attribute, doesn’t need a custom one.