mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-17 21:03:30 +00:00
Compare commits
4 Commits
MSA-862-1
...
DVCSMP-144
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eae2a9ca08 | ||
|
|
0c87601c64 | ||
|
|
a6bec43f2a | ||
|
|
5ec82217ac |
@@ -100,9 +100,6 @@ metadata {
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
valueTile("3axis", "device.threeAxis", decoration: "flat", wordWrap: false, width: 2, height: 2) {
|
|
||||||
state("threeAxis", label:'${currentValue}', unit:"", backgroundColor:"#ffffff")
|
|
||||||
}
|
|
||||||
valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) {
|
valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) {
|
||||||
state "battery", label:'${currentValue}% battery', unit:""
|
state "battery", label:'${currentValue}% battery', unit:""
|
||||||
}
|
}
|
||||||
@@ -112,7 +109,7 @@ metadata {
|
|||||||
|
|
||||||
|
|
||||||
main(["status", "acceleration", "temperature"])
|
main(["status", "acceleration", "temperature"])
|
||||||
details(["status", "acceleration", "temperature", "3axis", "battery", "refresh"])
|
details(["status", "acceleration", "temperature", "battery", "refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,28 +438,28 @@ def configure() {
|
|||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
||||||
|
|
||||||
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 1 {${device.zigbeeId}} {}", "delay 200",
|
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 1 {${device.zigbeeId}} {}", "delay 200",
|
||||||
"zcl global send-me-a-report 1 0x20 0x20 30 21600 {01}", //checkin time 6 hrs
|
"zcl global send-me-a-report 1 0x20 0x20 30 21600 {01}", "delay 200", //checkin time 6 hrs
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
||||||
|
|
||||||
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 0x402 {${device.zigbeeId}} {}", "delay 200",
|
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 0x402 {${device.zigbeeId}} {}", "delay 200",
|
||||||
"zcl global send-me-a-report 0x402 0 0x29 30 3600 {6400}",
|
"zcl global send-me-a-report 0x402 0 0x29 30 3600 {6400}", "delay 200",
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
||||||
|
|
||||||
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 0xFC02 {${device.zigbeeId}} {}", "delay 200",
|
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 0xFC02 {${device.zigbeeId}} {}", "delay 200",
|
||||||
"zcl mfg-code ${manufacturerCode}",
|
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
||||||
"zcl global send-me-a-report 0xFC02 0x0010 0x18 10 3600 {01}",
|
"zcl global send-me-a-report 0xFC02 0x0010 0x18 10 3600 {01}", "delay 200",
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}",
|
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
||||||
"zcl global send-me-a-report 0xFC02 0x0012 0x29 1 3600 {01}",
|
"zcl global send-me-a-report 0xFC02 0x0012 0x29 1 3600 {01}", "delay 200",
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}",
|
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
||||||
"zcl global send-me-a-report 0xFC02 0x0013 0x29 1 3600 {01}",
|
"zcl global send-me-a-report 0xFC02 0x0013 0x29 1 3600 {01}", "delay 200",
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}",
|
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
||||||
"zcl global send-me-a-report 0xFC02 0x0014 0x29 1 3600 {01}",
|
"zcl global send-me-a-report 0xFC02 0x0014 0x29 1 3600 {01}", "delay 200",
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500"
|
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500"
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -481,7 +478,7 @@ def enrollResponse() {
|
|||||||
"zcl global write 0x500 0x10 0xf0 {${zigbeeEui}}", "delay 200",
|
"zcl global write 0x500 0x10 0xf0 {${zigbeeEui}}", "delay 200",
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
||||||
//Enroll Response
|
//Enroll Response
|
||||||
"raw 0x500 {01 23 00 00 00}",
|
"raw 0x500 {01 23 00 00 00}", "delay 200",
|
||||||
"send 0x${device.deviceNetworkId} 1 1", "delay 200"
|
"send 0x${device.deviceNetworkId} 1 1", "delay 200"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,15 +72,12 @@ metadata {
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
valueTile("3axis", "device.threeAxis", decoration: "flat", wordWrap: false, width: 2, height: 2) {
|
|
||||||
state("threeAxis", label:'${currentValue}', unit:"", backgroundColor:"#ffffff")
|
|
||||||
}
|
|
||||||
valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) {
|
valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) {
|
||||||
state "battery", label:'${currentValue}% battery', unit:""
|
state "battery", label:'${currentValue}% battery', unit:""
|
||||||
}
|
}
|
||||||
|
|
||||||
main(["contact", "acceleration", "temperature"])
|
main(["contact", "acceleration", "temperature"])
|
||||||
details(["contact", "acceleration", "temperature", "3axis", "battery"])
|
details(["contact", "acceleration", "temperature", "battery"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,117 +0,0 @@
|
|||||||
definition(
|
|
||||||
name: "EyXAr Notifications",
|
|
||||||
namespace: "eyxar",
|
|
||||||
author: "EyXAr",
|
|
||||||
description: "Phone and Voice notification of your door sensor status and phone presence sensor autonitification.",
|
|
||||||
category: "SmartThings Labs",
|
|
||||||
iconUrl: "https://s3.amazonaws.com/for-st/For_ST_60px.png",
|
|
||||||
iconX2Url: "https://s3.amazonaws.com/for-st/For_ST_120px.png",
|
|
||||||
iconX3Url: "https://s3.amazonaws.com/for-st/For_ST_256px.png"
|
|
||||||
)
|
|
||||||
|
|
||||||
/* For ST will only work if EyXAr Notification is installed and set-up first. */
|
|
||||||
|
|
||||||
preferences {
|
|
||||||
section("EyXAr Auto Notifications - For Voice Notification, Install the app 'FOR ST' in Google Play")
|
|
||||||
{
|
|
||||||
input "door", "capability.contactSensor", title: "Select Door/Contact", required: false, multiple: true
|
|
||||||
}
|
|
||||||
|
|
||||||
section("Send Notifications by Text or use below option?") {
|
|
||||||
input("recipients", "contact", title: "Send notifications to"){
|
|
||||||
input "phone", "phone", title: "Phone Number (optional, text charges may apply)",
|
|
||||||
description: "Phone Number", required: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
section("If combine with 'For ST' android app, this will add features of voice notifications.") {
|
|
||||||
input "sendPush", "bool", required: false,
|
|
||||||
title: "Phone/Tablet Auto Notification (Must be set to On =>>)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Presense */
|
|
||||||
|
|
||||||
section("Phone Presence Auto Notifications - For Voice notifications install 'FOR ST' in Google Play") {
|
|
||||||
input "presence", "capability.presenceSensor", title: "Select Phone/Tablet to Detect: (mandatory & rest below are optional)", required: false, multiple: true
|
|
||||||
}
|
|
||||||
|
|
||||||
def installed() {
|
|
||||||
initialize()
|
|
||||||
/* Presense */
|
|
||||||
subscribe(door, "contact.open", doorOpenHandler)
|
|
||||||
subscribe(door, "contact.closed", doorClosedHandler)
|
|
||||||
subscribe(presence, "presence", myHandler)
|
|
||||||
subscribe(presence, "presence", presenceHandler)
|
|
||||||
}
|
|
||||||
|
|
||||||
def updated() {
|
|
||||||
initialize()
|
|
||||||
}
|
|
||||||
|
|
||||||
def initialize() {
|
|
||||||
subscribe(door, "contact.open", doorOpenHandler)
|
|
||||||
subscribe(door, "contact.closed", doorClosedHandler)
|
|
||||||
subscribe(presence, "presence", myHandler)
|
|
||||||
subscribe(presence, "presence", presenceHandler)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
def doorOpenHandler(evt) {
|
|
||||||
def message = "EyXAr Detected the ${evt.displayName} is ${evt.value}!"
|
|
||||||
if (sendPush) {
|
|
||||||
sendPush(message)
|
|
||||||
}
|
|
||||||
if (phone) {
|
|
||||||
sendSms(phone, message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def doorClosedHandler(evt) {
|
|
||||||
def message = "EyXAr Detected the ${evt.displayName} is ${evt.value}!"
|
|
||||||
if (sendPush) {
|
|
||||||
sendPush(message)
|
|
||||||
}
|
|
||||||
if (phone) {
|
|
||||||
sendSms(phone, message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def contactHandler(evt) {
|
|
||||||
if("open" == evt.value)
|
|
||||||
|
|
||||||
// contact was opened, turn on a light maybe?
|
|
||||||
log.debug "Contact is in ${evt.value} state"
|
|
||||||
|
|
||||||
if("closed" == evt.value)
|
|
||||||
// contact was closed, turn off the light?
|
|
||||||
log.debug "Contact is in ${evt.value} state"
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Presense */
|
|
||||||
def myHandler(evt) {
|
|
||||||
if("present" == evt.value)
|
|
||||||
def message = "EyXAr Detected ${evt.displayName} is ${evt.value}!"
|
|
||||||
if (sendPush) {
|
|
||||||
sendPush(message)
|
|
||||||
}
|
|
||||||
if (phone) {
|
|
||||||
sendSms(phone, message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def presenceHandler(evt) {
|
|
||||||
|
|
||||||
if (evt.value == "present") {
|
|
||||||
log.debug "EyXAr ${evt.displayName} has arrived at the ${location}!"
|
|
||||||
sendPush("EyXAr ${evt.displayName} has arrived at the ${location}!")
|
|
||||||
} else if (evt.value == "not present") {
|
|
||||||
|
|
||||||
log.debug "EyXAr ${evt.displayName} has left the ${location}!"
|
|
||||||
|
|
||||||
sendPush("EyXAr ${evt.displayName} has left the ${location}!")
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user