The two tiles are:
controlTile ("WUI", "device.wUI", "slider", height: 1, width: 2, range:"(1..24)", inactiveLabel: false) {
state "level", action:"switch level.setLevel"
}
valueTile ("wakeUp", "device.wakeUp", inactiveLabel: false, decoration: "flat") {
state "wakeUp", label:'${currentValue}', unit:""
}
def setLevel(val) {
result << createEvent(name: "wakeUp", value: "wakeUp")
}
The slider has values from 1 to 24 and when moved, I want its value to be displayed in the other tile.
How should I pass the slider’s current value to the others tile’s label?
Hi @Simeon_Simeonov,
Here’s a good example from ST’s default thermostat DH. The slider(s) used to adjust heat/cool setpoints have the value show up in the time next to the slider.
https://raw.githubusercontent.com/SmartThingsCommunity/SmartThingsPublic/master/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy
controlTile("heatSliderControl", "device.heatingSetpoint", "slider", height: 1, width: 2, inactiveLabel: false) {
state "setHeatingSetpoint", action:"quickSetHeat", backgroundColor:"#d04e00"
}
valueTile("heatingSetpoint", "device.heatingSetpoint", inactiveLabel: false, decoration: "flat") {
state "heat", label:'${currentValue}° heat', backgroundColor:"#ffffff"
}
controlTile("coolSliderControl", "device.coolingSetpoint", "slider", height: 1, width: 2, inactiveLabel: false) {
state "setCoolingSetpoint", action:"quickSetCool", backgroundColor: "#1e9cbb"
}
valueTile("coolingSetpoint", "device.coolingSetpoint", inactiveLabel: false, decoration: "flat") {
state "cool", label:'${currentValue}° cool', backgroundColor:"#ffffff"
}
In your example, just change valueTile to this:
valueTile ("wakeUp", "device.wUI", inactiveLabel: false, decoration: "flat") {
state "wakeUp", label:'${currentValue}', unit:""
}
Thanks, but it still doesn’t work.
I also copied the ST’s default thermostat DH and it also doesn’t work for me - when moving the sliders, their respective value tiles kept showing “–” instead of the slider value.
It looks like as if changing the slider’s value/position does nothing. Тhe function defined for “action:” is not executed.
That’s odd. I just changed mine to the default and it worked:
Fixed it - thanks for the replies.