Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ metadata {
capability "Configuration"
capability "Refresh"
capability "Window Shade"
capability "Window Shade Preset"
capability "Health Check"
capability "Switch Level"

Expand All @@ -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") {
Expand All @@ -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"
}
Expand All @@ -57,7 +65,7 @@ metadata {
}

main "windowShade"
details(["windowShade", "contPause", "shadeLevel", "levelSliderControl", "refresh", "batteryLevel"])
details(["windowShade", "contPause", "presetPosition", "shadeLevel", "levelSliderControl", "refresh", "batteryLevel"])
}
}

Expand Down Expand Up @@ -184,6 +192,10 @@ def pause() {
zigbee.command(CLUSTER_WINDOW_COVERING, COMMAND_PAUSE)
}

def presetPosition() {
setLevel(preset ?: 50)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like zwave window shade uses setLevel(preset ?: state.preset ?: 50) idk which is more correct

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greens Yeah, I saw that. I'm not sure that I completely follow the logic. I'm not sure if preferences are accessible through state like that? They could be. I've always seen just directly using the name as a variable, or settings.prefName. I'll check this out as I am testing it.

}

/**
* PING is used by Device-Watch in attempt to reach the Device
* */
Expand Down Expand Up @@ -272,4 +284,4 @@ def isIkeaKadrilj() {

def isIkeaFyrtur() {
device.getDataValue("model") == "FYRTUR block-out roller blind"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ metadata {
capability "Configuration"
capability "Refresh"
capability "Window Shade"
capability "Window Shade Preset"
capability "Health Check"
capability "Switch Level"

Expand All @@ -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") {
Expand All @@ -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"
}
Expand All @@ -58,7 +66,7 @@ metadata {
}

main "windowShade"
details(["windowShade", "contPause", "shadeLevel", "levelSliderControl", "refresh"])
details(["windowShade", "contPause", "presetPosition", "shadeLevel", "levelSliderControl", "refresh"])
}
}

Expand Down Expand Up @@ -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
* */
Expand Down