mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-18 13:20:53 +00:00
Compare commits
10 Commits
PROD_2017.
...
MSA-1999-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93f22a2c84 | ||
|
|
21f7a00cc9 | ||
|
|
06faa988c8 | ||
|
|
fe5f5c35b2 | ||
|
|
d7b448b699 | ||
|
|
9285536f73 | ||
|
|
e7713caec9 | ||
|
|
f0de2f1a19 | ||
|
|
01c2968f91 | ||
|
|
12bb6c0492 |
@@ -34,19 +34,22 @@ metadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tile definitions
|
// tile definitions
|
||||||
tiles {
|
tiles(scale: 2) {
|
||||||
standardTile("contact", "device.contact", width: 2, height: 2, canChangeIcon: true) {
|
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
||||||
state "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
tileAttribute ("device.valve", key: "PRIMARY_CONTROL") {
|
||||||
state "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
||||||
state "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC"
|
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
||||||
state "closing", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff"
|
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC"
|
||||||
|
attributeState "closing", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
|
|
||||||
|
standardTile("refresh", "device.valve", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
|
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "contact"
|
main "valve"
|
||||||
details(["contact","refresh"])
|
details(["valve","refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ import physicalgraph.zigbee.zcl.DataType
|
|||||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD210 PB DB", deviceJoinName: "Yale Push Button Deadbolt Lock"
|
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD210 PB DB", deviceJoinName: "Yale Push Button Deadbolt Lock"
|
||||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD220/240 TSDB", deviceJoinName: "Yale Touch Screen Deadbolt Lock"
|
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD220/240 TSDB", deviceJoinName: "Yale Touch Screen Deadbolt Lock"
|
||||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRL210 PB LL", deviceJoinName: "Yale Push Button Lever Lock"
|
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRL210 PB LL", deviceJoinName: "Yale Push Button Lever Lock"
|
||||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD226/246 TSDB", deviceJoinName: "Yale Touch Screen Deadbolt Lock"
|
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD226/246 TSDB", deviceJoinName: "Yale Touch Screen Deadbolt Lock"
|
||||||
|
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,0020,0101,0B05", outClusters: "000A, 0019, 0B05", manufacturer: "Danalock", model: "V3-BTZB",deviceJoinName: "Danalock V3-BTZB"
|
||||||
}
|
}
|
||||||
|
|
||||||
tiles(scale: 2) {
|
tiles(scale: 2) {
|
||||||
@@ -170,4 +171,4 @@ private Map parseReportAttributeMessage(String description) {
|
|||||||
log.debug "parseReportAttributeMessage() --- ignoring attribute"
|
log.debug "parseReportAttributeMessage() --- ignoring attribute"
|
||||||
}
|
}
|
||||||
return resultMap
|
return resultMap
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ metadata {
|
|||||||
|
|
||||||
tiles(scale: 2) {
|
tiles(scale: 2) {
|
||||||
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
||||||
tileAttribute ("device.contact", key: "PRIMARY_CONTROL") {
|
tileAttribute ("device.valve", key: "PRIMARY_CONTROL") {
|
||||||
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
||||||
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
||||||
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
||||||
|
|||||||
2
devicetypes/smartthings/zwave-water-valve.src/.st-ignore
Normal file
2
devicetypes/smartthings/zwave-water-valve.src/.st-ignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.st-ignore
|
||||||
|
README.md
|
||||||
38
devicetypes/smartthings/zwave-water-valve.src/README.md
Normal file
38
devicetypes/smartthings/zwave-water-valve.src/README.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# Z-Wave Water Valve
|
||||||
|
|
||||||
|
Cloud Execution
|
||||||
|
|
||||||
|
Works with:
|
||||||
|
|
||||||
|
* [Leak Intelligence Leak Gopher Water Shutoff Valve](https://www.smartthings.com/works-with-smartthings/other/leak-intelligence-leak-gopher-water-shutoff-valve)
|
||||||
|
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
* [Capabilities](#capabilities)
|
||||||
|
* [Health](#device-health)
|
||||||
|
* [Troubleshooting](#Troubleshooting)
|
||||||
|
|
||||||
|
## Capabilities
|
||||||
|
|
||||||
|
* **Actuator** - represents that a Device has commands
|
||||||
|
* **Health Check** - indicates ability to get device health notifications
|
||||||
|
* **Valve** - allows for the control of a valve device
|
||||||
|
* **Polling** - represents that poll() can be implemented for the device
|
||||||
|
* **Refresh** - _refresh()_ command for status updates
|
||||||
|
* **Sensor** - detects sensor events
|
||||||
|
|
||||||
|
## Device Health
|
||||||
|
|
||||||
|
SmartThings platform will ping the device after `checkInterval` seconds of inactivity in last attempt to reach the device before marking it `OFFLINE`
|
||||||
|
|
||||||
|
* __32min__ checkInterval
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range.
|
||||||
|
Pairing needs to be tried again by placing the device closer to the hub.
|
||||||
|
Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link:
|
||||||
|
* [Leak Intelligence Leak Gopher Water Shutoff Valve Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/209631423-Leak-Gopher-Z-Wave-Valve-Control)
|
||||||
|
|
||||||
|
|
||||||
@@ -14,12 +14,14 @@
|
|||||||
metadata {
|
metadata {
|
||||||
definition (name: "Z-Wave Water Valve", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.watervalve") {
|
definition (name: "Z-Wave Water Valve", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.watervalve") {
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
|
capability "Health Check"
|
||||||
capability "Valve"
|
capability "Valve"
|
||||||
capability "Polling"
|
capability "Polling"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
|
||||||
fingerprint deviceId: "0x1006", inClusters: "0x25"
|
fingerprint deviceId: "0x1006", inClusters: "0x25"
|
||||||
|
fingerprint mfr:"0173", prod:"0003", model:"0002", deviceJoinName: "Leak Intelligence Leak Gopher Water Shutoff Valve"
|
||||||
}
|
}
|
||||||
|
|
||||||
// simulator metadata
|
// simulator metadata
|
||||||
@@ -35,7 +37,7 @@ metadata {
|
|||||||
// tile definitions
|
// tile definitions
|
||||||
tiles(scale: 2) {
|
tiles(scale: 2) {
|
||||||
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
||||||
tileAttribute ("device.contact", key: "PRIMARY_CONTROL") {
|
tileAttribute ("device.valve", key: "PRIMARY_CONTROL") {
|
||||||
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
||||||
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
||||||
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC"
|
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC"
|
||||||
@@ -43,7 +45,7 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
standardTile("refresh", "device.contact", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
standardTile("refresh", "device.valve", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
|
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +55,14 @@ metadata {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
||||||
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
|
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
||||||
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
response(refresh())
|
response(refresh())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,6 +126,13 @@ def poll() {
|
|||||||
zwave.switchBinaryV1.switchBinaryGet().format()
|
zwave.switchBinaryV1.switchBinaryGet().format()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PING is used by Device-Watch in attempt to reach the Device
|
||||||
|
* */
|
||||||
|
def ping() {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
|
||||||
def refresh() {
|
def refresh() {
|
||||||
log.debug "refresh() is called"
|
log.debug "refresh() is called"
|
||||||
def commands = [zwave.switchBinaryV1.switchBinaryGet().format()]
|
def commands = [zwave.switchBinaryV1.switchBinaryGet().format()]
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ def motionHandler(evt) {
|
|||||||
else {
|
else {
|
||||||
state.motionStopTime = now()
|
state.motionStopTime = now()
|
||||||
if(delayMinutes) {
|
if(delayMinutes) {
|
||||||
runIn(delayMinutes*60, turnOffMotionAfterDelay, [overwrite: false])
|
runIn(delayMinutes*60, turnOffMotionAfterDelay, [overwrite: true])
|
||||||
} else {
|
} else {
|
||||||
turnOffMotionAfterDelay()
|
turnOffMotionAfterDelay()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,19 +125,19 @@
|
|||||||
if(allOk) {
|
if(allOk) {
|
||||||
|
|
||||||
if(everyoneIsAway() && (state.sunMode == "sunrise")) {
|
if(everyoneIsAway() && (state.sunMode == "sunrise")) {
|
||||||
log.info("Home is Empty Setting New Away Mode")
|
log.debug("Home is Empty Setting New Away Mode")
|
||||||
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
|
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
|
||||||
runIn(delay, "setAway")
|
runIn(delay, "setAway")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(everyoneIsAway() && (state.sunMode == "sunset")) {
|
if(everyoneIsAway() && (state.sunMode == "sunset")) {
|
||||||
log.info("Home is Empty Setting New Away Mode")
|
log.debug("Home is Empty Setting New Away Mode")
|
||||||
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
|
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
|
||||||
runIn(delay, "setAway")
|
runIn(delay, "setAway")
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
log.info("Home is Occupied Setting New Home Mode")
|
log.debug("Home is Occupied Setting New Home Mode")
|
||||||
setHome()
|
setHome()
|
||||||
|
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
log.debug("Checking if everyone is away")
|
log.debug("Checking if everyone is away")
|
||||||
|
|
||||||
if(everyoneIsAway()) {
|
if(everyoneIsAway()) {
|
||||||
log.info("Nobody is home, running away sequence")
|
log.debug("Nobody is home, running away sequence")
|
||||||
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
|
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
|
||||||
runIn(delay, "setAway")
|
runIn(delay, "setAway")
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
else {
|
else {
|
||||||
def lastTime = state[evt.deviceId]
|
def lastTime = state[evt.deviceId]
|
||||||
if (lastTime == null || now() - lastTime >= 1 * 60000) {
|
if (lastTime == null || now() - lastTime >= 1 * 60000) {
|
||||||
log.info("Someone is home, running home sequence")
|
log.debug("Someone is home, running home sequence")
|
||||||
setHome()
|
setHome()
|
||||||
}
|
}
|
||||||
state[evt.deviceId] = now()
|
state[evt.deviceId] = now()
|
||||||
@@ -175,14 +175,14 @@
|
|||||||
if(everyoneIsAway()) {
|
if(everyoneIsAway()) {
|
||||||
if(state.sunMode == "sunset") {
|
if(state.sunMode == "sunset") {
|
||||||
def message = "Performing \"${awayNight}\" for you as requested."
|
def message = "Performing \"${awayNight}\" for you as requested."
|
||||||
log.info(message)
|
log.debug(message)
|
||||||
sendAway(message)
|
sendAway(message)
|
||||||
location.helloHome.execute(settings.awayNight)
|
location.helloHome.execute(settings.awayNight)
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(state.sunMode == "sunrise") {
|
else if(state.sunMode == "sunrise") {
|
||||||
def message = "Performing \"${awayDay}\" for you as requested."
|
def message = "Performing \"${awayDay}\" for you as requested."
|
||||||
log.info(message)
|
log.debug(message)
|
||||||
sendAway(message)
|
sendAway(message)
|
||||||
location.helloHome.execute(settings.awayDay)
|
location.helloHome.execute(settings.awayDay)
|
||||||
}
|
}
|
||||||
@@ -192,19 +192,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
log.info("Somebody returned home before we set to '${newAwayMode}'")
|
log.debug("Somebody returned home before we set to '${newAwayMode}'")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//set home mode when house is occupied
|
//set home mode when house is occupied
|
||||||
def setHome() {
|
def setHome() {
|
||||||
sendOutOfDateNotification()
|
sendOutOfDateNotification()
|
||||||
log.info("Setting Home Mode!!")
|
log.debug("Setting Home Mode!!")
|
||||||
if(anyoneIsHome()) {
|
if(anyoneIsHome()) {
|
||||||
if(state.sunMode == "sunset"){
|
if(state.sunMode == "sunset"){
|
||||||
if (location.mode != "${homeModeNight}"){
|
if (location.mode != "${homeModeNight}"){
|
||||||
def message = "Performing \"${homeNight}\" for you as requested."
|
def message = "Performing \"${homeNight}\" for you as requested."
|
||||||
log.info(message)
|
log.debug(message)
|
||||||
sendHome(message)
|
sendHome(message)
|
||||||
location.helloHome.execute(settings.homeNight)
|
location.helloHome.execute(settings.homeNight)
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
if(state.sunMode == "sunrise"){
|
if(state.sunMode == "sunrise"){
|
||||||
if (location.mode != "${homeModeDay}"){
|
if (location.mode != "${homeModeDay}"){
|
||||||
def message = "Performing \"${homeDay}\" for you as requested."
|
def message = "Performing \"${homeDay}\" for you as requested."
|
||||||
log.info(message)
|
log.debug(message)
|
||||||
sendHome(message)
|
sendHome(message)
|
||||||
location.helloHome.execute(settings.homeDay)
|
location.helloHome.execute(settings.homeDay)
|
||||||
}
|
}
|
||||||
@@ -329,4 +329,4 @@
|
|||||||
sendNotification("Your version of Hello, Home Phrase Director is currently out of date. Please look for the new version of Hello, Home Phrase Director now called 'Routine Director' in the marketplace.")
|
sendNotification("Your version of Hello, Home Phrase Director is currently out of date. Please look for the new version of Hello, Home Phrase Director now called 'Routine Director' in the marketplace.")
|
||||||
state.lastTime = (new Date() + 31).getTime()
|
state.lastTime = (new Date() + 31).getTime()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user