diff --git a/devicetypes/smartthings/zigbee-window-shade-battery.src/zigbee-window-shade-battery.groovy b/devicetypes/smartthings/zigbee-window-shade-battery.src/zigbee-window-shade-battery.groovy index 965c3cee01b..2ac0386d716 100644 --- a/devicetypes/smartthings/zigbee-window-shade-battery.src/zigbee-window-shade-battery.groovy +++ b/devicetypes/smartthings/zigbee-window-shade-battery.src/zigbee-window-shade-battery.groovy @@ -21,6 +21,7 @@ metadata { capability "Configuration" capability "Refresh" capability "Window Shade" + capability "Window Shade Preset" capability "Health Check" capability "Switch Level" @@ -30,6 +31,10 @@ metadata { fingerprint manufacturer: "IKEA of Sweden", model: "FYRTUR block-out roller blind", deviceJoinName: "IKEA FYRTUR Blinds" // raw description 01 0104 0202 01 09 0000 0001 0003 0004 0005 0020 0102 1000 FC7C 02 0019 1000 } + preferences { + input "preset", "number", title: "Preset position", description: "Set the window shade preset position", defaultValue: 50, range: "1..100", required: false, displayDuringSetup: false + } + tiles(scale: 2) { multiAttributeTile(name:"windowShade", type: "generic", width: 6, height: 4) { tileAttribute("device.windowShade", key: "PRIMARY_CONTROL") { @@ -43,6 +48,9 @@ metadata { standardTile("contPause", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "pause", label:"", icon:'st.sonos.pause-btn', action:'pause', backgroundColor:"#cccccc" } + standardTile("presetPosition", "device.presetPosition", width: 2, height: 2, decoration: "flat") { + state "default", label: "Preset", action:"presetPosition", icon:"st.Home.home2" + } standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 1) { state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" } @@ -57,7 +65,7 @@ metadata { } main "windowShade" - details(["windowShade", "contPause", "shadeLevel", "levelSliderControl", "refresh", "batteryLevel"]) + details(["windowShade", "contPause", "presetPosition", "shadeLevel", "levelSliderControl", "refresh", "batteryLevel"]) } } @@ -184,6 +192,10 @@ def pause() { zigbee.command(CLUSTER_WINDOW_COVERING, COMMAND_PAUSE) } +def presetPosition() { + setLevel(preset ?: 50) +} + /** * PING is used by Device-Watch in attempt to reach the Device * */ @@ -272,4 +284,4 @@ def isIkeaKadrilj() { def isIkeaFyrtur() { device.getDataValue("model") == "FYRTUR block-out roller blind" -} \ No newline at end of file +} diff --git a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy index 1aa28f9d0c6..ea9a2364c81 100755 --- a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy +++ b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy @@ -22,6 +22,7 @@ metadata { capability "Configuration" capability "Refresh" capability "Window Shade" + capability "Window Shade Preset" capability "Health Check" capability "Switch Level" @@ -34,6 +35,10 @@ metadata { fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0102", outClusters: "0003", manufacturer: "REXENSE", model: "DY0010", deviceJoinName: "Smart Curtain Motor(DT82TV)" } + preferences { + input "preset", "number", title: "Preset position", description: "Set the window shade preset position", defaultValue: 50, range: "1..100", required: false, displayDuringSetup: false + } + tiles(scale: 2) { multiAttributeTile(name:"windowShade", type: "generic", width: 6, height: 4) { tileAttribute("device.windowShade", key: "PRIMARY_CONTROL") { @@ -47,6 +52,9 @@ metadata { standardTile("contPause", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "pause", label:"", icon:'st.sonos.pause-btn', action:'pause', backgroundColor:"#cccccc" } + standardTile("presetPosition", "device.presetPosition", width: 2, height: 2, decoration: "flat") { + state "default", label: "Preset", action:"presetPosition", icon:"st.Home.home2" + } standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 1) { state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" } @@ -58,7 +66,7 @@ metadata { } main "windowShade" - details(["windowShade", "contPause", "shadeLevel", "levelSliderControl", "refresh"]) + details(["windowShade", "contPause", "presetPosition", "shadeLevel", "levelSliderControl", "refresh"]) } } @@ -184,6 +192,10 @@ def pause() { zigbee.command(CLUSTER_WINDOW_COVERING, COMMAND_PAUSE) } +def presetPosition() { + setLevel(preset ?: 50) +} + /** * PING is used by Device-Watch in attempt to reach the Device * */