From 743fb6c9d48b5816c28b8f0257bb6c74b3780e31 Mon Sep 17 00:00:00 2001 From: Mike Crompton Date: Sat, 15 Apr 2017 12:12:30 -0700 Subject: [PATCH] MSA-1893: Standard Z-Wave thermostat device handler template modified to display humidity. --- .../zwave-thermostat.groovy | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy b/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy index 743ab0f..09c4f44 100644 --- a/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy +++ b/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy @@ -75,8 +75,8 @@ metadata { tiles { // Using standardTile instead of valueTile as it renders the icon better - standardTile("temperature", "device.temperature", width: 2, height: 2) { - state("temperature", label:'${currentValue}°', icon: "st.thermostat.ac.air-conditioning", + valueTile("temperature", "device.temperature", width: 3, height: 3) { + state "temperature", label:'${currentValue}°', backgroundColors:[ [value: 31, color: "#153591"], [value: 44, color: "#1e9cbb"], @@ -85,10 +85,21 @@ metadata { [value: 84, color: "#f1d801"], [value: 95, color: "#d04e00"], [value: 96, color: "#bc2323"] - ] - ) + ] } - standardTile("mode", "device.thermostatMode", inactiveLabel: false, decoration: "flat") { + valueTile("humidity", "device.humidity", inactiveLabel: false) { + state "humidity", label:'${currentValue}%', unit:"", + icon: "http://cdn.device-icons.smartthings.com/Weather/weather12-icn@2x.png", + backgroundColors : [ + [value: 01, color: "#724529"], + [value: 11, color: "#724529"], + [value: 21, color: "#724529"], + [value: 35, color: "#44b621"], + [value: 49, color: "#44b621"], + [value: 50, color: "#1e9cbb"] + ] + } + standardTile("mode", "device.thermostatMode", inactiveLabel: false, decoration: "flat") { state "off", action:"switchMode", nextState:"to_heat", icon: "st.thermostat.heating-cooling-off" state "heat", action:"switchMode", nextState:"to_cool", icon: "st.thermostat.heat" state "cool", action:"switchMode", nextState:"...", icon: "st.thermostat.cool" @@ -120,7 +131,7 @@ metadata { state "default", action:"polling.poll", icon:"st.secondary.refresh" } main "temperature" - details(["temperature", "mode", "fanMode", "heatSliderControl", "heatingSetpoint", "coolSliderControl", "coolingSetpoint", "refresh"]) + details(["temperature", "humidity", "mode", "fanMode", "heatSliderControl", "heatingSetpoint", "coolSliderControl", "coolingSetpoint", "refresh"]) } } @@ -585,5 +596,4 @@ def fanCirculate() { private getStandardDelay() { 1000 -} - +} \ No newline at end of file