This is my DTH. zigbee.command(0x0102, 0x02) is what sends the stop command.
metadata {
definition (name: "Curtain", namespace: "Tek", author: "Jack", ocfDeviceType: "oic.d.switch", runLocally: false, minHubCoreVersion: '000.019.00012', executeCommandsLocally: false) {
capability "Actuator"
capability "Configuration"
capability "Refresh"
capability "Switch"
capability "Health Check"
command "pause"
command "cont"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0102", deviceJoinName: "Window", manufacturer: "Tek", model: "MD002"
}
// simulator metadata
simulator {
// status messages
status "on": "on/off: 1"
status "off": "on/off: 0"
// reply messages
reply "zcl on-off on": "on/off: 1"
reply "zcl on-off off": "on/off: 0"
}
tiles(scale: 2) {
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState "on", label:'Open', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
attributeState "off", label:'Closed', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
attributeState "turningOn", label:'Opening', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
attributeState "turningOff", label:'Closing', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
}
}
standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}
standardTile("contPuase", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "pause", label:'', icon:'st.sonos.pause-btn', action:'pause', backgroundColor:"#cccccc", nextState: "cont"
state "cont", label:'', icon:'st.sonos.play-btn', action:'cont', backgroundColor:"#90d2a7", nextState: "pause"
}
main "switch"
details(["switch", "contPuase", "refresh"])
}
}
// Parse incoming device messages to generate events
def parse(String description) {
log.debug "description is $description"
def event = zigbee.getEvent(description)
if (event) {
sendEvent(event)
}
else {
log.warn "DID NOT PARSE MESSAGE for description : $description"
log.debug descMap
}
}
def off() {
zigbee.off()
}
def on() {
zigbee.on()
}
def pause() {
zigbee.command(0x0102, 0x02)
}
def cont() {
zigbee.command(0x0102, 0x02) // TODO: make change here
}
/**
* PING is used by Device-Watch in attempt to reach the Device
* */
def ping() {
return refresh()
}
def refresh() {
zigbee.onOffRefresh() + //zigbee.onOffConfig() +
}
def configure() {
// Device-Watch allows 2 check-in misses from device + ping (plus 2 min lag time)
sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
log.debug "Configuring Reporting and Bindings."
refresh()
}