From ee0a439022f12242e85894d6acde6a64a1dc68b9 Mon Sep 17 00:00:00 2001 From: Tom Manley Date: Thu, 3 Oct 2019 09:12:46 -0500 Subject: [PATCH] Fix window shade commands not being visible on device view The latest device plugin expects that devices implementing the Window Shade capability have created the supportedWindowShadeCommands event to indicate which commands they support. If that event hasnt' been generated then the plugin doesn't render the device properly. --- devicetypes/axis/axis-gear-st.src/axis-gear-st.groovy | 2 +- .../springs-window-fashions-shade.groovy | 9 +++++++++ .../zigbee-window-shade.src/zigbee-window-shade.groovy | 6 ++++++ .../zwave-window-shade.src/zwave-window-shade.groovy | 9 +++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/devicetypes/axis/axis-gear-st.src/axis-gear-st.groovy b/devicetypes/axis/axis-gear-st.src/axis-gear-st.groovy index 3dce3ec841e..f73c65af0c8 100644 --- a/devicetypes/axis/axis-gear-st.src/axis-gear-st.groovy +++ b/devicetypes/axis/axis-gear-st.src/axis-gear-st.groovy @@ -308,7 +308,7 @@ def configure() { sendEvent(name: "windowShade", value: "unknown") log.debug "Configuring Reporting and Bindings." sendEvent(name: "checkInterval", value: (2 * 60 * 60 + 10 * 60), displayed: true, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) - sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"])) + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"]), displayed: false) def attrs_refresh = zigbee.readAttribute(CLUSTER_BASIC, BASIC_ATTR_SWBUILDID) + zigbee.readAttribute(CLUSTER_WINDOWCOVERING, WINDOWCOVERING_ATTR_LIFTPERCENTAGE) + diff --git a/devicetypes/smartthings/springs-window-fashions-shade.src/springs-window-fashions-shade.groovy b/devicetypes/smartthings/springs-window-fashions-shade.src/springs-window-fashions-shade.groovy index b576947aa0f..45687fb4ef0 100644 --- a/devicetypes/smartthings/springs-window-fashions-shade.src/springs-window-fashions-shade.groovy +++ b/devicetypes/smartthings/springs-window-fashions-shade.src/springs-window-fashions-shade.groovy @@ -11,6 +11,9 @@ * for the specific language governing permissions and limitations under the License. * */ +import groovy.json.JsonOutput + + metadata { definition (name: "Springs Window Fashions Shade", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.blind") { capability "Window Shade" @@ -111,6 +114,7 @@ def getCheckInterval() { def installed() { sendEvent(name: "checkInterval", value: checkInterval, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]) + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"]), displayed: false) response(refresh()) } @@ -242,6 +246,11 @@ def presetPosition() { zwave.switchMultilevelV1.switchMultilevelSet(value: 0xFF).format() } +def pause() { + log.debug "pause()" + stop() +} + def stop() { log.debug "stop()" zwave.switchMultilevelV3.switchMultilevelStopLevelChange().format() 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 b3331d7945b..33014ddca5d 100755 --- a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy +++ b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy @@ -11,6 +11,8 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License * for the specific language governing permissions and limitations under the License. */ + +import groovy.json.JsonOutput import physicalgraph.zigbee.zcl.DataType metadata { @@ -201,6 +203,10 @@ def refresh() { return cmds } +def installed() { + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"]), displayed: false) +} + def configure() { // Device-Watch allows 2 check-in misses from device + ping (plus 2 min lag time) log.info "configure()" diff --git a/devicetypes/smartthings/zwave-window-shade.src/zwave-window-shade.groovy b/devicetypes/smartthings/zwave-window-shade.src/zwave-window-shade.groovy index f8709453105..7015b52076c 100644 --- a/devicetypes/smartthings/zwave-window-shade.src/zwave-window-shade.groovy +++ b/devicetypes/smartthings/zwave-window-shade.src/zwave-window-shade.groovy @@ -11,6 +11,9 @@ * for the specific language governing permissions and limitations under the License. * */ +import groovy.json.JsonOutput + + metadata { definition (name: "Z-Wave Window Shade", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.blind") { capability "Window Shade" @@ -106,6 +109,7 @@ def getCheckInterval() { def installed() { sendEvent(name: "checkInterval", value: checkInterval, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]) + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"]), displayed: false) response(refresh()) } @@ -222,6 +226,11 @@ def presetPosition() { setLevel(preset ?: state.preset ?: 50) } +def pause() { + log.debug "pause()" + stop() +} + def stop() { log.debug "stop()" zwave.switchMultilevelV3.switchMultilevelStopLevelChange().format()