From 66287082c0483bdc0a7e35d1f6a912fb1054173b Mon Sep 17 00:00:00 2001 From: Jesse O'Neill-Oine Date: Tue, 11 Aug 2015 14:59:46 -0500 Subject: [PATCH] Meta-data updates to enable multi-attribute-tiles for most important first devices. Note: several cases use a 'multi-attribute-tile' to show only a single attribute to get the larger & richer display of multi-attribute-tiles --- .../aeon-multisensor-6.groovy | 18 +++--- .../aeon-multisensor-gen5.groovy | 20 +++--- .../aeon-multisensor.groovy | 20 +++--- .../aeon-siren.src/aeon-siren.groovy | 14 ++-- .../centralite-dimmer.groovy | 33 +++++----- .../dimmer-switch.src/dimmer-switch.groovy | 27 ++++---- .../everspring-flood-sensor.groovy | 15 +++-- .../ge-zigbee-dimmer.groovy | 27 ++++---- .../ge-zigbee-switch.groovy | 19 +++--- .../smartalert-siren.groovy | 22 ++++--- .../smartpower-dimming-outlet.groovy | 36 +++++------ .../smartpower-outlet-v1.groovy | 12 ++-- .../smartpower-outlet.groovy | 23 ++++--- .../smartsense-garage-door-multi.groovy | 42 +++++------- .../smartsense-moisture-sensor.groovy | 23 ++++--- .../smartsense-moisture.groovy | 20 +++--- .../smartsense-motion-sensor.groovy | 26 ++++---- .../smartsense-motion-temp-sensor.groovy | 26 ++++---- .../smartsense-motion.groovy | 28 +++----- .../smartsense-multi-sensor.groovy | 64 +++++++++---------- .../smartsense-multi.groovy | 33 ++++------ ...se-open-closed-accelerometer-sensor.groovy | 57 +++++++++-------- .../smartsense-open-closed-sensor.groovy | 22 ++++--- .../smartsense-temp-humidity-sensor.groovy | 36 +++++------ .../zigbee-dimmer.src/zigbee-dimmer.groovy | 25 ++++---- .../zwave-lock.src/zwave-lock.groovy | 24 +++---- .../zwave-smoke-alarm.groovy | 16 +++-- .../zwave-switch.src/zwave-switch.groovy | 15 +++-- 28 files changed, 376 insertions(+), 367 deletions(-) diff --git a/devicetypes/smartthings/aeon-multisensor-6.src/aeon-multisensor-6.groovy b/devicetypes/smartthings/aeon-multisensor-6.src/aeon-multisensor-6.groovy index 6b283e9..744879d 100644 --- a/devicetypes/smartthings/aeon-multisensor-6.src/aeon-multisensor-6.groovy +++ b/devicetypes/smartthings/aeon-multisensor-6.src/aeon-multisensor-6.groovy @@ -63,12 +63,14 @@ metadata { status "wake up" : "command: 8407, payload: " } - tiles { - standardTile("motion", "device.motion", width: 2, height: 2) { - state "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" - state "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + tiles(scale: 2) { + multiAttributeTile(name:"motion", type: "generic", width: 6, height: 4){ + tileAttribute ("device.motion", key: "PRIMARY_CONTROL") { + attributeState "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" + attributeState "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + } } - valueTile("temperature", "device.temperature", inactiveLabel: false) { + valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { state "temperature", label:'${currentValue}°', backgroundColors:[ [value: 32, color: "#153591"], @@ -80,13 +82,13 @@ metadata { [value: 98, color: "#bc2323"] ] } - valueTile("humidity", "device.humidity", inactiveLabel: false) { + valueTile("humidity", "device.humidity", inactiveLabel: false, width: 2, height: 2) { state "humidity", label:'${currentValue}% humidity', unit:"" } - valueTile("illuminance", "device.illuminance", inactiveLabel: false) { + valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) { state "luminosity", label:'${currentValue} ${unit}', unit:"lux" } - valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") { + valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "battery", label:'${currentValue}% battery', unit:"" } diff --git a/devicetypes/smartthings/aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy b/devicetypes/smartthings/aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy index 4124aa8..70c23ad 100644 --- a/devicetypes/smartthings/aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy +++ b/devicetypes/smartthings/aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy @@ -59,12 +59,14 @@ metadata { status "wake up" : "command: 8407, payload: " } - tiles { - standardTile("motion", "device.motion", width: 2, height: 2) { - state "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" - state "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + tiles(scale: 2) { + multiAttributeTile(name:"motion", type: "generic", width: 6, height: 4){ + tileAttribute ("device.motion", key: "PRIMARY_CONTROL") { + attributeState "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" + attributeState "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + } } - valueTile("temperature", "device.temperature", inactiveLabel: false) { + valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { state "temperature", label:'${currentValue}°', backgroundColors:[ [value: 32, color: "#153591"], @@ -76,16 +78,16 @@ metadata { [value: 98, color: "#bc2323"] ] } - valueTile("humidity", "device.humidity", inactiveLabel: false) { + valueTile("humidity", "device.humidity", inactiveLabel: false, width: 2, height: 2) { state "humidity", label:'${currentValue}% humidity', unit:"" } - valueTile("illuminance", "device.illuminance", inactiveLabel: false) { + valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) { state "luminosity", label:'${currentValue} ${unit}', unit:"lux" } - valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") { + valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "battery", label:'${currentValue}% battery', unit:"" } - standardTile("configureAfterSecure", "device.configure", inactiveLabel: false, decoration: "flat") { + standardTile("configureAfterSecure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "configure", label:'', action:"configureAfterSecure", icon:"st.secondary.configure" } diff --git a/devicetypes/smartthings/aeon-multisensor.src/aeon-multisensor.groovy b/devicetypes/smartthings/aeon-multisensor.src/aeon-multisensor.groovy index a00a973..5d6de58 100644 --- a/devicetypes/smartthings/aeon-multisensor.src/aeon-multisensor.groovy +++ b/devicetypes/smartthings/aeon-multisensor.src/aeon-multisensor.groovy @@ -56,12 +56,14 @@ metadata { } } - tiles { - standardTile("motion", "device.motion", width: 2, height: 2) { - state "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" - state "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + tiles(scale: 2) { + multiAttributeTile(name:"motion", type: "generic", width: 6, height: 4){ + tileAttribute ("device.motion", key: "PRIMARY_CONTROL") { + attributeState "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" + attributeState "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + } } - valueTile("temperature", "device.temperature", inactiveLabel: false) { + valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { state "temperature", label:'${currentValue}°', backgroundColors:[ [value: 31, color: "#153591"], @@ -73,16 +75,16 @@ metadata { [value: 96, color: "#bc2323"] ] } - valueTile("humidity", "device.humidity", inactiveLabel: false) { + valueTile("humidity", "device.humidity", inactiveLabel: false, width: 2, height: 2) { state "humidity", label:'${currentValue}% humidity', unit:"" } - valueTile("illuminance", "device.illuminance", inactiveLabel: false) { + valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) { state "luminosity", label:'${currentValue} ${unit}', unit:"lux" } - valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") { + valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "battery", label:'${currentValue}% battery', unit:"" } - standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat") { + standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "configure", label:'', action:"configuration.configure", icon:"st.secondary.configure" } diff --git a/devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy b/devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy index 34b73d6..a0fafb3 100644 --- a/devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy +++ b/devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy @@ -33,15 +33,17 @@ metadata { reply "9881002001FF,delay 3000,988100200100,9881002002": "command: 9881, payload: 00200300" } - tiles { - standardTile("alarm", "device.alarm", width: 2, height: 2) { - state "off", label:'off', action:'alarm.siren', icon:"st.alarm.alarm.alarm", backgroundColor:"#ffffff" - state "both", label:'alarm!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13" + tiles(scale: 2) { + multiAttributeTile(name:"alarm", type: "generic", width: 6, height: 4){ + tileAttribute ("device.alarm", key: "PRIMARY_CONTROL") { + attributeState "off", label:'off', action:'alarm.siren', icon:"st.alarm.alarm.alarm", backgroundColor:"#ffffff" + attributeState "both", label:'alarm!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13" + } } - standardTile("test", "device.alarm", inactiveLabel: false, decoration: "flat") { + standardTile("test", "device.alarm", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"test", icon:"st.secondary.test" } - standardTile("off", "device.alarm", inactiveLabel: false, decoration: "flat") { + standardTile("off", "device.alarm", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"alarm.off", icon:"st.secondary.off" } diff --git a/devicetypes/smartthings/centralite-dimmer.src/centralite-dimmer.groovy b/devicetypes/smartthings/centralite-dimmer.src/centralite-dimmer.groovy index 348239c..7e11e43 100644 --- a/devicetypes/smartthings/centralite-dimmer.src/centralite-dimmer.groovy +++ b/devicetypes/smartthings/centralite-dimmer.src/centralite-dimmer.groovy @@ -39,25 +39,28 @@ metadata { reply "zcl on-off off": "on/off: 0" } - // UI tile definitions - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" - state "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + } + tileAttribute ("device.level", key: "SLIDER_CONTROL") { + attributeState "level", action:"switch level.setLevel" + } + tileAttribute ("power", key: "SECONDARY_CONTROL") { + attributeState "power", label:'${currentValue} W' + } } - controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false) { - state "level", action:"switch level.setLevel" - } - valueTile("power", "device.power", decoration: "flat") { - state "power", label:'${currentValue} W' - } - standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat") { + + standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" } + main "switch" - details(["switch","power","refresh","levelSliderControl"]) + details(["switch","refresh"]) } } diff --git a/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy b/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy index c77545f..4218b3d 100644 --- a/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy +++ b/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy @@ -42,27 +42,30 @@ metadata { reply "200163,delay 5000,2602": "command: 2603, payload: 63" } - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" - state "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + } + tileAttribute ("device.level", key: "SLIDER_CONTROL") { + attributeState "level", action:"switch level.setLevel" + } } - standardTile("indicator", "device.indicatorStatus", inactiveLabel: false, decoration: "flat") { + + standardTile("indicator", "device.indicatorStatus", height: 2, width: 2, inactiveLabel: false, decoration: "flat") { state "when off", action:"indicator.indicatorWhenOn", icon:"st.indicators.lit-when-off" state "when on", action:"indicator.indicatorNever", icon:"st.indicators.lit-when-on" state "never", action:"indicator.indicatorWhenOff", icon:"st.indicators.never-lit" } - standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.switch", height: 2, width: 2, inactiveLabel: false, decoration: "flat") { state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" } - controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 3, inactiveLabel: false) { - state "level", action:"switch level.setLevel" - } main(["switch"]) - details(["switch", "refresh", "indicator", "levelSliderControl"]) + details(["switch", "refresh", "indicator"]) } } diff --git a/devicetypes/smartthings/everspring-flood-sensor.src/everspring-flood-sensor.groovy b/devicetypes/smartthings/everspring-flood-sensor.src/everspring-flood-sensor.groovy index 68111fa..f97fdde 100644 --- a/devicetypes/smartthings/everspring-flood-sensor.src/everspring-flood-sensor.groovy +++ b/devicetypes/smartthings/everspring-flood-sensor.src/everspring-flood-sensor.groovy @@ -28,15 +28,18 @@ metadata { status "battery ${i}%": new physicalgraph.zwave.Zwave().batteryV1.batteryReport(batteryLevel: i).incomingMessage() } } - tiles { - standardTile("water", "device.water", width: 2, height: 2) { - state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff" - state "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0" + + tiles(scale: 2) { + multiAttributeTile(name:"water", type: "generic", width: 6, height: 4){ + tileAttribute ("device.water", key: "PRIMARY_CONTROL") { + attributeState "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff" + attributeState "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0" + } } - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { state "battery", label:'${currentValue}% battery', unit:"" } - standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat") { + standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "configure", label:'', action:"configuration.configure", icon:"st.secondary.configure" } main "water" diff --git a/devicetypes/smartthings/ge-zigbee-dimmer.src/ge-zigbee-dimmer.groovy b/devicetypes/smartthings/ge-zigbee-dimmer.src/ge-zigbee-dimmer.groovy index 3a10381..2d2e2fb 100644 --- a/devicetypes/smartthings/ge-zigbee-dimmer.src/ge-zigbee-dimmer.groovy +++ b/devicetypes/smartthings/ge-zigbee-dimmer.src/ge-zigbee-dimmer.groovy @@ -41,24 +41,25 @@ metadata { reply "zcl on-off off": "on/off: 0" } - // UI tile definitions - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" - state "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + } + tileAttribute ("device.level", key: "SLIDER_CONTROL") { + attributeState "level", action:"switch level.setLevel" + } } - controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false, range:"(0..100)") { - state "level", action:"switch level.setLevel" - } - valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") { + valueTile("level", "device.level", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "level", label: 'Level ${currentValue}%' } - valueTile("power", "device.power", decoration: "flat") { + valueTile("power", "device.power", decoration: "flat", width: 2, height: 2) { state "power", label:'${currentValue} W' } - standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" } main "switch" diff --git a/devicetypes/smartthings/ge-zigbee-switch.src/ge-zigbee-switch.groovy b/devicetypes/smartthings/ge-zigbee-switch.src/ge-zigbee-switch.groovy index ea0ce0b..a731354 100644 --- a/devicetypes/smartthings/ge-zigbee-switch.src/ge-zigbee-switch.groovy +++ b/devicetypes/smartthings/ge-zigbee-switch.src/ge-zigbee-switch.groovy @@ -41,18 +41,19 @@ metadata { reply "zcl on-off off": "on/off: 0" } - // UI tile definitions - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" - state "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + } } - standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" } - valueTile("power", "device.power", inactiveLabel: false, decoration: "flat") { + valueTile("power", "device.power", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "power", label:'${currentValue} Watts' } main "switch" diff --git a/devicetypes/smartthings/smartalert-siren.src/smartalert-siren.groovy b/devicetypes/smartthings/smartalert-siren.src/smartalert-siren.groovy index 6a7f511..e46c42d 100644 --- a/devicetypes/smartthings/smartalert-siren.src/smartalert-siren.groovy +++ b/devicetypes/smartthings/smartalert-siren.src/smartalert-siren.groovy @@ -36,29 +36,31 @@ metadata { reply "2001FF,delay 3000,200100,2002": "command: 2003, payload: 00" } - tiles { - standardTile("alarm", "device.alarm", width: 2, height: 2) { - state "off", label:'off', action:'alarm.strobe', icon:"st.alarm.alarm.alarm", backgroundColor:"#ffffff" - state "strobe", label:'strobe!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13" - state "siren", label:'siren!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13" - state "both", label:'alarm!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13" + tiles(scale: 2) { + multiAttributeTile(name:"alarm", type: "generic", width: 6, height: 4){ + tileAttribute ("device.alarm", key: "PRIMARY_CONTROL") { + attributeState "off", label:'off', action:'alarm.strobe', icon:"st.alarm.alarm.alarm", backgroundColor:"#ffffff" + attributeState "strobe", label:'strobe!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13" + attributeState "siren", label:'siren!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13" + attributeState "both", label:'alarm!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13" + } } - standardTile("strobe", "device.alarm", inactiveLabel: false, decoration: "flat") { + standardTile("strobe", "device.alarm", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "off", label:'', action:"alarm.strobe", icon:"st.secondary.strobe", backgroundColor:"#cccccc" state "siren", label:'', action:"alarm.strobe", icon:"st.secondary.strobe", backgroundColor:"#cccccc" state "strobe", label:'', action:'alarm.strobe', icon:"st.secondary.strobe", backgroundColor:"#e86d13" state "both", label:'', action:'alarm.strobe', icon:"st.secondary.strobe", backgroundColor:"#e86d13" } - standardTile("siren", "device.alarm", inactiveLabel: false, decoration: "flat") { + standardTile("siren", "device.alarm", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "off", label:'', action:"alarm.siren", icon:"st.secondary.siren", backgroundColor:"#cccccc" state "strobe", label:'', action:"alarm.siren", icon:"st.secondary.siren", backgroundColor:"#cccccc" state "siren", label:'', action:'alarm.siren', icon:"st.secondary.siren", backgroundColor:"#e86d13" state "both", label:'', action:'alarm.siren', icon:"st.secondary.siren", backgroundColor:"#e86d13" } - standardTile("test", "device.alarm", inactiveLabel: false, decoration: "flat") { + standardTile("test", "device.alarm", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"test", icon:"st.secondary.test" } - standardTile("off", "device.alarm", inactiveLabel: false, decoration: "flat") { + standardTile("off", "device.alarm", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"alarm.off", icon:"st.secondary.off" } main "alarm" diff --git a/devicetypes/smartthings/smartpower-dimming-outlet.src/smartpower-dimming-outlet.groovy b/devicetypes/smartthings/smartpower-dimming-outlet.src/smartpower-dimming-outlet.groovy index 379d5bd..7f6bfa1 100644 --- a/devicetypes/smartthings/smartpower-dimming-outlet.src/smartpower-dimming-outlet.groovy +++ b/devicetypes/smartthings/smartpower-dimming-outlet.src/smartpower-dimming-outlet.groovy @@ -40,28 +40,28 @@ metadata { reply "zcl on-off off": "on/off: 0" } - // UI tile definitions - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" - state "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + } + tileAttribute ("device.level", key: "SLIDER_CONTROL") { + attributeState "level", action:"switch level.setLevel" + } + tileAttribute ("device.power", key: "SECONDARY_CONTROL") { + attributeState "power", label:'${currentValue} W' + } } - controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false) { - state "level", action:"switch level.setLevel" - } - valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") { - state "level", label: 'Level ${currentValue}%' - } - valueTile("power", "device.power", decoration: "flat") { - state "power", label:'${currentValue} W' - } - standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat") { + + standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" } + main "switch" - details(["switch", "level", "power","refresh","levelSliderControl"]) + details(["switch", "refresh"]) } } diff --git a/devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy b/devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy index ffe86b9..2c5af83 100644 --- a/devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy +++ b/devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy @@ -19,13 +19,13 @@ metadata { reply "zcl on-off off": "on/off: 0" } - // UI tile definitions - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" - state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" + attributeState "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" + } } - main "switch" details "switch" } diff --git a/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy b/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy index a58b912..d5cdf74 100644 --- a/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy +++ b/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy @@ -32,20 +32,23 @@ metadata { } // UI tile definitions - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" - state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" + attributeState "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" + } + tileAttribute ("power", key: "SECONDARY_CONTROL") { + attributeState "power", label:'${currentValue} W' + } } - valueTile("power", "device.power", decoration: "flat") { - state "power", label:'${currentValue} W' - } - standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat") { + + standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" } - + main "switch" - details(["switch","power","refresh"]) + details(["switch","refresh"]) } } diff --git a/devicetypes/smartthings/smartsense-garage-door-multi.src/smartsense-garage-door-multi.groovy b/devicetypes/smartthings/smartsense-garage-door-multi.src/smartsense-garage-door-multi.groovy index 32ddb9d..9bdf0f6 100644 --- a/devicetypes/smartthings/smartsense-garage-door-multi.src/smartsense-garage-door-multi.groovy +++ b/devicetypes/smartthings/smartsense-garage-door-multi.src/smartsense-garage-door-multi.groovy @@ -47,43 +47,35 @@ metadata { status "x,y,z: 0,0,1000": "x: 0, y: 0, z: 1000, rssi: 100, lqi: 255" } - tiles { - standardTile("status", "device.status", width: 2, height: 2) { - state("closed", label:'${name}', icon:"st.doors.garage.garage-closed", backgroundColor:"#79b821", nextState:"opening") - state("open", label:'${name}', icon:"st.doors.garage.garage-open", backgroundColor:"#ffa81e", nextState:"closing") - state("opening", label:'${name}', icon:"st.doors.garage.garage-opening", backgroundColor:"#ffe71e") - state("closing", label:'${name}', icon:"st.doors.garage.garage-closing", backgroundColor:"#ffe71e") + tiles(scale: 2) { + multiAttributeTile(name:"status", type: "generic", width: 6, height: 4){ + tileAttribute ("device.status", key: "PRIMARY_CONTROL") { + attributeState "closed", label:'${name}', icon:"st.doors.garage.garage-closed", backgroundColor:"#79b821", nextState:"opening" + attributeState "open", label:'${name}', icon:"st.doors.garage.garage-open", backgroundColor:"#ffa81e", nextState:"closing" + attributeState "opening", label:'${name}', icon:"st.doors.garage.garage-opening", backgroundColor:"#ffe71e" + attributeState "closing", label:'${name}', icon:"st.doors.garage.garage-closing", backgroundColor:"#ffe71e" + } } - standardTile("contact", "device.contact") { + standardTile("contact", "device.contact", width: 2, height: 2) { state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e") state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821") } - standardTile("acceleration", "device.acceleration", decoration: "flat") { + standardTile("acceleration", "device.acceleration", decoration: "flat", width: 2, height: 2) { state("active", label:'${name}', icon:"st.motion.acceleration.active", backgroundColor:"#53a7c0") state("inactive", label:'${name}', icon:"st.motion.acceleration.inactive", backgroundColor:"#ffffff") } - valueTile("temperature", "device.temperature", decoration: "flat") { + valueTile("temperature", "device.temperature", decoration: "flat", width: 2, height: 2) { state("temperature", label:'${currentValue}°') } - valueTile("3axis", "device.threeAxis", decoration: "flat", wordWrap: false) { + valueTile("3axis", "device.threeAxis", decoration: "flat", wordWrap: false, width: 2, height: 2) { state("threeAxis", label:'${currentValue}', unit:"") } - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery', unit:""/*, backgroundColors:[ - [value: 5, color: "#BC2323"], - [value: 10, color: "#D04E00"], - [value: 15, color: "#F1D801"], - [value: 16, color: "#FFFFFF"] - ]*/ + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" } - /* - valueTile("lqi", "device.lqi", decoration: "flat", inactiveLabel: false) { - state "lqi", label:'${currentValue}% signal', unit:"" - } - */ - - main(["status","contact", "acceleration"]) - details(["status","contact", "acceleration", "temperature", "3axis", "battery"/*, "lqi"*/]) + + main(["status", "contact", "acceleration"]) + details(["status", "contact", "acceleration", "temperature", "3axis", "battery"]) } preferences { diff --git a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy index 849cf00..78b5da1 100644 --- a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy +++ b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy @@ -39,12 +39,13 @@ metadata { input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false } - tiles { - standardTile("water", "device.water", width: 2, height: 2) { - state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff" - state "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0" + tiles(scale: 2) { + multiAttributeTile(name:"water", type: "generic", width: 6, height: 4){ + tileAttribute ("device.water", key: "PRIMARY_CONTROL") { + attributeState "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff" + attributeState "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0" + } } - valueTile("temperature", "device.temperature", inactiveLabel: false) { state "temperature", label:'${currentValue}°', backgroundColors:[ @@ -57,16 +58,14 @@ metadata { [value: 96, color: "#bc2323"] ] } - - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery' + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" } - - standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", action:"refresh.refresh", icon:"st.secondary.refresh" } - - main "water", "temperature" + + main (["water", "temperature"]) details(["water", "temperature", "battery", "refresh"]) } } diff --git a/devicetypes/smartthings/smartsense-moisture.src/smartsense-moisture.groovy b/devicetypes/smartthings/smartsense-moisture.src/smartsense-moisture.groovy index 6c3298a..5f1baee 100644 --- a/devicetypes/smartthings/smartsense-moisture.src/smartsense-moisture.groovy +++ b/devicetypes/smartthings/smartsense-moisture.src/smartsense-moisture.groovy @@ -31,23 +31,21 @@ metadata { status "battery ${i}%": new physicalgraph.zwave.Zwave().batteryV1.batteryReport(batteryLevel: i).incomingMessage() } } - tiles { - standardTile("water", "device.water", width: 2, height: 2) { - state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff" - state "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0" + + tiles(scale: 2) { + multiAttributeTile(name:"water", type: "generic", width: 6, height: 4){ + tileAttribute ("device.water", key: "PRIMARY_CONTROL") { + attributeState "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff" + attributeState "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0" + } } standardTile("temperature", "device.temperature", width: 2, height: 2) { state "normal", icon:"st.alarm.temperature.normal", backgroundColor:"#ffffff" state "freezing", icon:"st.alarm.temperature.freeze", backgroundColor:"#53a7c0" state "overheated", icon:"st.alarm.temperature.overheat", backgroundColor:"#F80000" } - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery', unit:""/*, backgroundColors:[ - [value: 5, color: "#BC2323"], - [value: 10, color: "#D04E00"], - [value: 15, color: "#F1D801"], - [value: 16, color: "#FFFFFF"] - ]*/ + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" } main (["water", "temperature"]) details(["water", "temperature", "battery"]) diff --git a/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy b/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy index 8d3cb05..7e021ca 100644 --- a/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy +++ b/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy @@ -41,13 +41,14 @@ metadata { input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false } - tiles { - standardTile("motion", "device.motion", width: 2, height: 2) { - state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0") - state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff") + tiles(scale: 2) { + multiAttributeTile(name:"motion", type: "generic", width: 6, height: 4){ + tileAttribute ("device.motion", key: "PRIMARY_CONTROL") { + attributeState "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" + attributeState "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + } } - - valueTile("temperature", "device.temperature") { + valueTile("temperature", "device.temperature", width: 2, height: 2) { state("temperature", label:'${currentValue}°', unit:"F", backgroundColors:[ [value: 31, color: "#153591"], @@ -60,16 +61,15 @@ metadata { ] ) } - - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery' + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" } - standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", action:"refresh.refresh", icon:"st.secondary.refresh" } - - main (["motion","temperature"]) - details(["motion","temperature","battery","refresh"]) + + main(["motion", "temperature"]) + details(["motion", "temperature", "battery", "refresh"]) } } diff --git a/devicetypes/smartthings/smartsense-motion-temp-sensor.src/smartsense-motion-temp-sensor.groovy b/devicetypes/smartthings/smartsense-motion-temp-sensor.src/smartsense-motion-temp-sensor.groovy index 4ec3d9a..891c2e5 100644 --- a/devicetypes/smartthings/smartsense-motion-temp-sensor.src/smartsense-motion-temp-sensor.groovy +++ b/devicetypes/smartthings/smartsense-motion-temp-sensor.src/smartsense-motion-temp-sensor.groovy @@ -40,13 +40,14 @@ metadata { input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false } - tiles { - standardTile("motion", "device.motion", width: 2, height: 2) { - state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0") - state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff") + tiles(scale: 2) { + multiAttributeTile(name:"motion", type: "generic", width: 6, height: 4){ + tileAttribute ("device.motion", key: "PRIMARY_CONTROL") { + attributeState "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" + attributeState "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + } } - - valueTile("temperature", "device.temperature") { + valueTile("temperature", "device.temperature", width: 2, height: 2) { state("temperature", label:'${currentValue}°', unit:"F", backgroundColors:[ [value: 31, color: "#153591"], @@ -59,16 +60,15 @@ metadata { ] ) } - - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery' + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" } - standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", action:"refresh.refresh", icon:"st.secondary.refresh" } - - main (["motion","temperature"]) - details(["motion","temperature","battery","refresh"]) + + main(["motion", "temperature"]) + details(["motion", "temperature", "battery", "refresh"]) } } diff --git a/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy b/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy index 491e8eb..bbb1b7d 100644 --- a/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy +++ b/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy @@ -27,27 +27,19 @@ metadata { status "inactive": "zone report :: type: 19 value: 0030" } - tiles { - standardTile("motion", "device.motion", width: 2, height: 2) { - state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0") - state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff") + tiles(scale: 2) { + multiAttributeTile(name:"motion", type: "generic", width: 6, height: 4){ + tileAttribute ("device.motion", key: "PRIMARY_CONTROL") { + attributeState "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0" + attributeState "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff" + } } - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery', unit:""/*, backgroundColors:[ - [value: 5, color: "#BC2323"], - [value: 10, color: "#D04E00"], - [value: 15, color: "#F1D801"], - [value: 16, color: "#FFFFFF"] - ]*/ + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" } - /* - valueTile("lqi", "device.lqi", decoration: "flat", inactiveLabel: false) { - state "lqi", label:'${currentValue}% signal', unit:"" - } - */ - + main "motion" - details(["motion", "battery"/*, "lqi"*/]) + details(["motion", "battery"]) } } diff --git a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy index f89bacd..3cd5126 100644 --- a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy +++ b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy @@ -55,44 +55,44 @@ input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false } - tiles { - standardTile("contact", "device.contact", width: 2, height: 2) { - state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e") - state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821") - } - standardTile("acceleration", "device.acceleration") { - state("inactive", label:'${name}', icon:"st.motion.acceleration.inactive", backgroundColor:"#ffffff") - state("active", label:'${name}', icon:"st.motion.acceleration.active", backgroundColor:"#53a7c0") + tiles(scale: 2) { + multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4){ + tileAttribute ("device.contact", key: "PRIMARY_CONTROL") { + attributeState "open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e" + attributeState "closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821" + } } - valueTile("temperature", "device.temperature", inactiveLabel: false) { - state "temperature", label:'${currentValue}°', - backgroundColors:[ - [value: 31, color: "#153591"], - [value: 44, color: "#1e9cbb"], - [value: 59, color: "#90d2a7"], - [value: 74, color: "#44b621"], - [value: 84, color: "#f1d801"], - [value: 95, color: "#d04e00"], - [value: 96, color: "#bc2323"] - ] - } - - valueTile("3axis", "device.threeAxis", decoration: "flat", wordWrap: false) { + + standardTile("acceleration", "device.acceleration", width: 2, height: 2) { + state("active", label:'${name}', icon:"st.motion.acceleration.active", backgroundColor:"#53a7c0") + state("inactive", label:'${name}', icon:"st.motion.acceleration.inactive", backgroundColor:"#ffffff") + } + valueTile("temperature", "device.temperature", width: 2, height: 2) { + state("temperature", label:'${currentValue}°', + backgroundColors:[ + [value: 31, color: "#153591"], + [value: 44, color: "#1e9cbb"], + [value: 59, color: "#90d2a7"], + [value: 74, color: "#44b621"], + [value: 84, color: "#f1d801"], + [value: 95, color: "#d04e00"], + [value: 96, color: "#bc2323"] + ] + ) + } + valueTile("3axis", "device.threeAxis", decoration: "flat", wordWrap: false, width: 2, height: 2) { state("threeAxis", label:'${currentValue}', unit:"", backgroundColor:"#ffffff") } - - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery', unit:"" - } - - standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" + } + standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", action:"refresh.refresh", icon:"st.secondary.refresh" } - - main (["contact", "acceleration", "temperature"]) - details(["contact","acceleration", "temperature", "3axis", "battery", "refresh"]) - } + main(["contact", "acceleration", "temperature"]) + details(["contact", "acceleration", "temperature", "3axis", "battery", "refresh"]) + } } def parse(String description) { diff --git a/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy b/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy index 69baa02..7524cfb 100644 --- a/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy +++ b/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy @@ -47,16 +47,19 @@ metadata { input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false } - tiles { - standardTile("contact", "device.contact", width: 2, height: 2) { - state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e") - state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821") + tiles(scale: 2) { + multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4){ + tileAttribute ("device.contact", key: "PRIMARY_CONTROL") { + attributeState "open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e" + attributeState "closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821" + } } - standardTile("acceleration", "device.acceleration") { + + standardTile("acceleration", "device.acceleration", width: 2, height: 2) { state("active", label:'${name}', icon:"st.motion.acceleration.active", backgroundColor:"#53a7c0") state("inactive", label:'${name}', icon:"st.motion.acceleration.inactive", backgroundColor:"#ffffff") } - valueTile("temperature", "device.temperature") { + valueTile("temperature", "device.temperature", width: 2, height: 2) { state("temperature", label:'${currentValue}°', backgroundColors:[ [value: 31, color: "#153591"], @@ -69,25 +72,15 @@ metadata { ] ) } - valueTile("3axis", "device.threeAxis", decoration: "flat", wordWrap: false) { + valueTile("3axis", "device.threeAxis", decoration: "flat", wordWrap: false, width: 2, height: 2) { state("threeAxis", label:'${currentValue}', unit:"", backgroundColor:"#ffffff") } - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery', unit:""/*, backgroundColors:[ - [value: 5, color: "#BC2323"], - [value: 10, color: "#D04E00"], - [value: 15, color: "#F1D801"], - [value: 16, color: "#FFFFFF"] - ]*/ + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" } - /* - valueTile("lqi", "device.lqi", decoration: "flat", inactiveLabel: false) { - state "lqi", label:'${currentValue}% signal', unit:"" - } - */ main(["contact", "acceleration", "temperature"]) - details(["contact", "acceleration", "temperature", "3axis", "battery"/*, "lqi"*/]) + details(["contact", "acceleration", "temperature", "3axis", "battery"]) } } diff --git a/devicetypes/smartthings/smartsense-open-closed-accelerometer-sensor.src/smartsense-open-closed-accelerometer-sensor.groovy b/devicetypes/smartthings/smartsense-open-closed-accelerometer-sensor.src/smartsense-open-closed-accelerometer-sensor.groovy index d2bc765..8ef9a52 100644 --- a/devicetypes/smartthings/smartsense-open-closed-accelerometer-sensor.src/smartsense-open-closed-accelerometer-sensor.groovy +++ b/devicetypes/smartthings/smartsense-open-closed-accelerometer-sensor.src/smartsense-open-closed-accelerometer-sensor.groovy @@ -36,38 +36,39 @@ input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false } - tiles { - standardTile("contact", "device.contact", width: 2, height: 2) { - state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e") - state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821") - } - standardTile("acceleration", "device.acceleration") { + tiles(scale: 2) { + multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4){ + tileAttribute ("device.contact", key: "PRIMARY_CONTROL") { + attributeState "open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e" + attributeState "closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821" + } + } + standardTile("acceleration", "device.acceleration", width: 2, height: 2) { state("active", label:'${name}', icon:"st.motion.acceleration.active", backgroundColor:"#53a7c0") state("inactive", label:'${name}', icon:"st.motion.acceleration.inactive", backgroundColor:"#ffffff") } - valueTile("temperature", "device.temperature", inactiveLabel: false) { - state "temperature", label:'${currentValue}°', - backgroundColors:[ - [value: 31, color: "#153591"], - [value: 44, color: "#1e9cbb"], - [value: 59, color: "#90d2a7"], - [value: 74, color: "#44b621"], - [value: 84, color: "#f1d801"], - [value: 95, color: "#d04e00"], - [value: 96, color: "#bc2323"] - ] - } - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { - state "battery", label:'${currentValue}% battery', unit:"" - } + valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { + state "temperature", label:'${currentValue}°', + backgroundColors:[ + [value: 31, color: "#153591"], + [value: 44, color: "#1e9cbb"], + [value: 59, color: "#90d2a7"], + [value: 74, color: "#44b621"], + [value: 84, color: "#f1d801"], + [value: 95, color: "#d04e00"], + [value: 96, color: "#bc2323"] + ] + } + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { + state "battery", label:'${currentValue}% battery', unit:"" + } + standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { + state "default", action:"refresh.refresh", icon:"st.secondary.refresh" + } - standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { - state "default", action:"refresh.refresh", icon:"st.secondary.refresh" - } - - main (["contact", "acceleration", "temperature"]) - details(["contact","acceleration", "temperature","battery","refresh"]) - } + main (["contact", "acceleration", "temperature"]) + details(["contact", "acceleration", "temperature", "battery", "refresh"]) + } } def parse(String description) { diff --git a/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy b/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy index 513419e..4b2c8a0 100644 --- a/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy +++ b/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy @@ -38,13 +38,15 @@ metadata { input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false } - tiles { - standardTile("contact", "device.contact", width: 2, height: 2) { - state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e") - state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821") + tiles(scale: 2) { + multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4){ + tileAttribute ("device.contact", key: "PRIMARY_CONTROL") { + attributeState "open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e" + attributeState "closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821" + } } - - valueTile("temperature", "device.temperature", inactiveLabel: false) { + + valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { state "temperature", label:'${currentValue}°', backgroundColors:[ [value: 31, color: "#153591"], @@ -56,14 +58,14 @@ metadata { [value: 96, color: "#bc2323"] ] } - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { state "battery", label:'${currentValue}% battery', unit:"" } - - standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { + + standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", action:"refresh.refresh", icon:"st.secondary.refresh" } - + main (["contact", "temperature"]) details(["contact","temperature","battery","refresh"]) } diff --git a/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy b/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy index 0132c66..756f883 100644 --- a/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy +++ b/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy @@ -37,33 +37,33 @@ metadata { input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false } - tiles { - valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { - state "temperature", label:'${currentValue}°', - backgroundColors:[ - [value: 31, color: "#153591"], - [value: 44, color: "#1e9cbb"], - [value: 59, color: "#90d2a7"], - [value: 74, color: "#44b621"], - [value: 84, color: "#f1d801"], - [value: 95, color: "#d04e00"], - [value: 96, color: "#bc2323"] - ] + tiles(scale: 2) { + multiAttributeTile(name:"temperature", type: "generic", width: 6, height: 4){ + tileAttribute ("device.temperature", key: "PRIMARY_CONTROL") { + attributeState "temperature", label:'${currentValue}°', + backgroundColors:[ + [value: 31, color: "#153591"], + [value: 44, color: "#1e9cbb"], + [value: 59, color: "#90d2a7"], + [value: 74, color: "#44b621"], + [value: 84, color: "#f1d801"], + [value: 95, color: "#d04e00"], + [value: 96, color: "#bc2323"] + ] + } } - valueTile("humidity", "device.humidity", inactiveLabel: false) { + valueTile("humidity", "device.humidity", inactiveLabel: false, width: 2, height: 2) { state "humidity", label:'${currentValue}% humidity', unit:"" } - - valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) { + valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) { state "battery", label:'${currentValue}% battery' } - - standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", action:"refresh.refresh", icon:"st.secondary.refresh" } main "temperature", "humidity" - details(["temperature","humidity","battery","refresh"]) + details(["temperature", "humidity", "battery", "refresh"]) } } diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index e14b550..07dbc37 100644 --- a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy +++ b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy @@ -34,21 +34,22 @@ metadata { reply "zcl on-off off": "on/off: 0" } - // UI tile definitions - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" - state "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" - state "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff" + attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn" + } + tileAttribute ("device.level", key: "SLIDER_CONTROL") { + attributeState "level", action:"switch level.setLevel" + } } - standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" } - controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 3, inactiveLabel: false) { - state "level", action:"switch level.setLevel" - } - valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") { + valueTile("level", "device.level", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "level", label:'${currentValue} %', unit:"%", backgroundColor:"#ffffff" } main "switch" diff --git a/devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy b/devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy index 8cbd8c9..d6d05e4 100644 --- a/devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy +++ b/devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy @@ -35,24 +35,26 @@ metadata { reply "988100620100,delay 4200,9881006202": "command: 9881, payload: 00 62 03 00 00 00 FE FE" } - tiles { - standardTile("toggle", "device.lock", width: 2, height: 2) { - state "locked", label:'locked', action:"lock.unlock", icon:"st.locks.lock.locked", backgroundColor:"#79b821", nextState:"unlocking" - state "unlocked", label:'unlocked', action:"lock.lock", icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff", nextState:"locking" - state "unknown", label:"unknown", action:"lock.lock", icon:"st.locks.lock.unknown", backgroundColor:"#ffffff", nextState:"locking" - state "locking", label:'locking', icon:"st.locks.lock.locked", backgroundColor:"#79b821" - state "unlocking", label:'unlocking', icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff" + tiles(scale: 2) { + multiAttributeTile(name:"toggle", type: "generic", width: 6, height: 4){ + tileAttribute ("device.lock", key: "PRIMARY_CONTROL") { + attributeState "locked", label:'locked', action:"lock.unlock", icon:"st.locks.lock.locked", backgroundColor:"#79b821", nextState:"unlocking" + attributeState "unlocked", label:'unlocked', action:"lock.lock", icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff", nextState:"locking" + attributeState "unknown", label:"unknown", action:"lock.lock", icon:"st.locks.lock.unknown", backgroundColor:"#ffffff", nextState:"locking" + attributeState "locking", label:'locking', icon:"st.locks.lock.locked", backgroundColor:"#79b821" + attributeState "unlocking", label:'unlocking', icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff" + } } - standardTile("lock", "device.lock", inactiveLabel: false, decoration: "flat") { + standardTile("lock", "device.lock", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'lock', action:"lock.lock", icon:"st.locks.lock.locked", nextState:"locking" } - standardTile("unlock", "device.lock", inactiveLabel: false, decoration: "flat") { + standardTile("unlock", "device.lock", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'unlock', action:"lock.unlock", icon:"st.locks.lock.unlocked", nextState:"unlocking" } - valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") { + valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "battery", label:'${currentValue}% battery', unit:"" } - standardTile("refresh", "device.lock", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.lock", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" } diff --git a/devicetypes/smartthings/zwave-smoke-alarm.src/zwave-smoke-alarm.groovy b/devicetypes/smartthings/zwave-smoke-alarm.src/zwave-smoke-alarm.groovy index 168e6ec..6f1f1ab 100644 --- a/devicetypes/smartthings/zwave-smoke-alarm.src/zwave-smoke-alarm.groovy +++ b/devicetypes/smartthings/zwave-smoke-alarm.src/zwave-smoke-alarm.groovy @@ -33,14 +33,16 @@ metadata { status "battery 5%": "command: 8003, payload: 05" } - tiles { - standardTile("smoke", "device.alarmState", width: 2, height: 2) { - state("clear", label:"clear", icon:"st.alarm.smoke.clear", backgroundColor:"#ffffff") - state("smoke", label:"SMOKE", icon:"st.alarm.smoke.smoke", backgroundColor:"#e86d13") - state("carbonMonoxide", label:"MONOXIDE", icon:"st.alarm.carbon-monoxide.carbon-monoxide", backgroundColor:"#e86d13") - state("tested", label:"TEST", icon:"st.alarm.smoke.test", backgroundColor:"#e86d13") + tiles (scale: 2){ + multiAttributeTile(name:"smoke", type: "lighting", width: 6, height: 4){ + tileAttribute ("device.alarmState", key: "PRIMARY_CONTROL") { + attributeState("clear", label:"clear", icon:"st.alarm.smoke.clear", backgroundColor:"#ffffff") + attributeState("smoke", label:"SMOKE", icon:"st.alarm.smoke.smoke", backgroundColor:"#e86d13") + attributeState("carbonMonoxide", label:"MONOXIDE", icon:"st.alarm.carbon-monoxide.carbon-monoxide", backgroundColor:"#e86d13") + attributeState("tested", label:"TEST", icon:"st.alarm.smoke.test", backgroundColor:"#e86d13") + } } - valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") { + valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "battery", label:'${currentValue}% battery', unit:"" } diff --git a/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy b/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy index 74d1e14..cda2e69 100644 --- a/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy +++ b/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy @@ -34,17 +34,20 @@ metadata { } // tile definitions - tiles { - standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { - state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" - state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" + tiles(scale: 2) { + multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){ + tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { + attributeState "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" + attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" + } } - standardTile("indicator", "device.indicatorStatus", inactiveLabel: false, decoration: "flat") { + + standardTile("indicator", "device.indicatorStatus", width: 2, height: 2, inactiveLabel: false, decoration: "flat") { state "when off", action:"indicator.indicatorWhenOn", icon:"st.indicators.lit-when-off" state "when on", action:"indicator.indicatorNever", icon:"st.indicators.lit-when-on" state "never", action:"indicator.indicatorWhenOff", icon:"st.indicators.never-lit" } - standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") { + standardTile("refresh", "device.switch", width: 2, height: 2, inactiveLabel: false, decoration: "flat") { state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" }