mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-18 13:20:53 +00:00
Compare commits
9 Commits
PROD_2016.
...
MSA-1227-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca5b896057 | ||
|
|
c7e8079ff1 | ||
|
|
481d13a571 | ||
|
|
9d83b850ca | ||
|
|
84de336a1a | ||
|
|
8b465b03b4 | ||
|
|
2f81964479 | ||
|
|
327f8dfb00 | ||
|
|
235e3f5507 |
@@ -24,6 +24,7 @@ metadata {
|
|||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
|
|
||||||
|
|
||||||
|
fingerprint inClusters: "0000,0001,0003,0500,0020", manufacturer: "NYCE", model: "3010", deviceJoinName: "NYCE Door Hinge Sensor"
|
||||||
fingerprint inClusters: "0000,0001,0003,0406,0500,0020", manufacturer: "NYCE", model: "3011", deviceJoinName: "NYCE Door/Window Sensor"
|
fingerprint inClusters: "0000,0001,0003,0406,0500,0020", manufacturer: "NYCE", model: "3011", deviceJoinName: "NYCE Door/Window Sensor"
|
||||||
fingerprint inClusters: "0000,0001,0003,0500,0020", manufacturer: "NYCE", model: "3011", deviceJoinName: "NYCE Door/Window Sensor"
|
fingerprint inClusters: "0000,0001,0003,0500,0020", manufacturer: "NYCE", model: "3011", deviceJoinName: "NYCE Door/Window Sensor"
|
||||||
fingerprint inClusters: "0000,0001,0003,0406,0500,0020", manufacturer: "NYCE", model: "3014", deviceJoinName: "NYCE Tilt Sensor"
|
fingerprint inClusters: "0000,0001,0003,0406,0500,0020", manufacturer: "NYCE", model: "3014", deviceJoinName: "NYCE Tilt Sensor"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ metadata {
|
|||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
capability "Health Check"
|
||||||
|
|
||||||
// indicates that device keeps track of heartbeat (in state.heartbeat)
|
// indicates that device keeps track of heartbeat (in state.heartbeat)
|
||||||
attribute "heartbeat", "string"
|
attribute "heartbeat", "string"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ metadata {
|
|||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Water Sensor"
|
capability "Water Sensor"
|
||||||
|
capability "Health Check"
|
||||||
|
|
||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ metadata {
|
|||||||
capability "Battery"
|
capability "Battery"
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
|
capability "Health Check"
|
||||||
|
|
||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ metadata {
|
|||||||
capability "Acceleration Sensor"
|
capability "Acceleration Sensor"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
|
capability "Health Check"
|
||||||
|
|
||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05,FC02", outClusters: "0019", manufacturer: "CentraLite", model: "3320"
|
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05,FC02", outClusters: "0019", manufacturer: "CentraLite", model: "3320"
|
||||||
|
|||||||
@@ -23,8 +23,9 @@
|
|||||||
capability "Acceleration Sensor"
|
capability "Acceleration Sensor"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
command "enrollResponse"
|
capability "Health Check"
|
||||||
|
|
||||||
|
command "enrollResponse"
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator {
|
simulator {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ metadata {
|
|||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Relative Humidity Measurement"
|
capability "Relative Humidity Measurement"
|
||||||
|
capability "Health Check"
|
||||||
|
|
||||||
fingerprint endpointId: "01", inClusters: "0001,0003,0020,0402,0B05,FC45", outClusters: "0019,0003"
|
fingerprint endpointId: "01", inClusters: "0001,0003,0020,0402,0B05,FC45", outClusters: "0019,0003"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,136 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2016 EyXAR
|
||||||
|
*
|
||||||
|
* All rights reserved. No part of this code may be reproduced, distributed, or modified in any form or by any means,
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
*
|
||||||
|
* For ST app: https://play.google.com/store/apps/details?id=eyxar.com.forst
|
||||||
|
* http://www.eyxar.com
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* EyXAr Notifications
|
||||||
|
*
|
||||||
|
* Author: EyXAr
|
||||||
|
* Published: 2016-02-14
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
definition(
|
||||||
|
name: "EyXAr Notifications",
|
||||||
|
namespace: "eyxar",
|
||||||
|
author: "EyXAr",
|
||||||
|
description: "Enable SmartThings the capability to add voice notifications to your Phones or Tablet anywhere in conjuction with For ST app. https://play.google.com/store/apps/details?id=eyxar.com.forst",
|
||||||
|
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: "Monitor Contact Sensor When Nobody's Home", 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("Arriving and Leaving Auto Notifications - For Voice notifications install 'FOR ST' in Google Play") {
|
||||||
|
input "presence", "capability.presenceSensor", title: "Select Phone/Tablet to Detect (Set Specific Mode Below to Minimize Notifications)", 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}!")
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -824,7 +824,7 @@ def setColor(childDevice, huesettings) {
|
|||||||
value.bri = Math.min(Math.round(huesettings.level * 255 / 100), 255)
|
value.bri = Math.min(Math.round(huesettings.level * 255 / 100), 255)
|
||||||
}
|
}
|
||||||
value.alert = huesettings.alert ? huesettings.alert : "none"
|
value.alert = huesettings.alert ? huesettings.alert : "none"
|
||||||
value.transition = huesettings.transition ? huesettings.transition : 4
|
value.transitiontime = huesettings.transitiontime ? huesettings.transitiontime : 4
|
||||||
|
|
||||||
// Make sure to turn off light if requested
|
// Make sure to turn off light if requested
|
||||||
if (huesettings.switch == "off")
|
if (huesettings.switch == "off")
|
||||||
|
|||||||
@@ -236,23 +236,22 @@ def addSwitches() {
|
|||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac
|
it.deviceNetworkId == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac
|
||||||
}
|
}
|
||||||
}
|
if (!d) {
|
||||||
|
log.debug "Creating WeMo Switch with dni: ${selectedSwitch.value.mac}"
|
||||||
if (!d) {
|
d = addChildDevice("smartthings", "Wemo Switch", selectedSwitch.value.mac, selectedSwitch?.value.hub, [
|
||||||
log.debug "Creating WeMo Switch with dni: ${selectedSwitch.value.mac}"
|
"label": selectedSwitch?.value?.name ?: "Wemo Switch",
|
||||||
d = addChildDevice("smartthings", "Wemo Switch", selectedSwitch.value.mac, selectedSwitch?.value.hub, [
|
"data": [
|
||||||
"label": selectedSwitch?.value?.name ?: "Wemo Switch",
|
"mac": selectedSwitch.value.mac,
|
||||||
"data": [
|
"ip": selectedSwitch.value.ip,
|
||||||
"mac": selectedSwitch.value.mac,
|
"port": selectedSwitch.value.port
|
||||||
"ip": selectedSwitch.value.ip,
|
]
|
||||||
"port": selectedSwitch.value.port
|
])
|
||||||
]
|
def ipvalue = convertHexToIP(selectedSwitch.value.ip)
|
||||||
])
|
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||||
def ipvalue = convertHexToIP(selectedSwitch.value.ip)
|
log.debug "Created ${d.displayName} with id: ${d.id}, dni: ${d.deviceNetworkId}"
|
||||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
} else {
|
||||||
log.debug "Created ${d.displayName} with id: ${d.id}, dni: ${d.deviceNetworkId}"
|
log.debug "found ${d.displayName} with id $dni already exists"
|
||||||
} else {
|
}
|
||||||
log.debug "found ${d.displayName} with id $dni already exists"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,23 +266,22 @@ def addMotions() {
|
|||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac
|
it.deviceNetworkId == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac
|
||||||
}
|
}
|
||||||
}
|
if (!d) {
|
||||||
|
log.debug "Creating WeMo Motion with dni: ${selectedMotion.value.mac}"
|
||||||
if (!d) {
|
d = addChildDevice("smartthings", "Wemo Motion", selectedMotion.value.mac, selectedMotion?.value.hub, [
|
||||||
log.debug "Creating WeMo Motion with dni: ${selectedMotion.value.mac}"
|
"label": selectedMotion?.value?.name ?: "Wemo Motion",
|
||||||
d = addChildDevice("smartthings", "Wemo Motion", selectedMotion.value.mac, selectedMotion?.value.hub, [
|
"data": [
|
||||||
"label": selectedMotion?.value?.name ?: "Wemo Motion",
|
"mac": selectedMotion.value.mac,
|
||||||
"data": [
|
"ip": selectedMotion.value.ip,
|
||||||
"mac": selectedMotion.value.mac,
|
"port": selectedMotion.value.port
|
||||||
"ip": selectedMotion.value.ip,
|
]
|
||||||
"port": selectedMotion.value.port
|
])
|
||||||
]
|
def ipvalue = convertHexToIP(selectedMotion.value.ip)
|
||||||
])
|
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||||
def ipvalue = convertHexToIP(selectedMotion.value.ip)
|
log.debug "Created ${d.displayName} with id: ${d.id}, dni: ${d.deviceNetworkId}"
|
||||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
} else {
|
||||||
log.debug "Created ${d.displayName} with id: ${d.id}, dni: ${d.deviceNetworkId}"
|
log.debug "found ${d.displayName} with id $dni already exists"
|
||||||
} else {
|
}
|
||||||
log.debug "found ${d.displayName} with id $dni already exists"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -298,23 +296,22 @@ def addLightSwitches() {
|
|||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac
|
it.deviceNetworkId == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac
|
||||||
}
|
}
|
||||||
}
|
if (!d) {
|
||||||
|
log.debug "Creating WeMo Light Switch with dni: ${selectedLightSwitch.value.mac}"
|
||||||
if (!d) {
|
d = addChildDevice("smartthings", "Wemo Light Switch", selectedLightSwitch.value.mac, selectedLightSwitch?.value.hub, [
|
||||||
log.debug "Creating WeMo Light Switch with dni: ${selectedLightSwitch.value.mac}"
|
"label": selectedLightSwitch?.value?.name ?: "Wemo Light Switch",
|
||||||
d = addChildDevice("smartthings", "Wemo Light Switch", selectedLightSwitch.value.mac, selectedLightSwitch?.value.hub, [
|
"data": [
|
||||||
"label": selectedLightSwitch?.value?.name ?: "Wemo Light Switch",
|
"mac": selectedLightSwitch.value.mac,
|
||||||
"data": [
|
"ip": selectedLightSwitch.value.ip,
|
||||||
"mac": selectedLightSwitch.value.mac,
|
"port": selectedLightSwitch.value.port
|
||||||
"ip": selectedLightSwitch.value.ip,
|
]
|
||||||
"port": selectedLightSwitch.value.port
|
])
|
||||||
]
|
def ipvalue = convertHexToIP(selectedLightSwitch.value.ip)
|
||||||
])
|
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||||
def ipvalue = convertHexToIP(selectedLightSwitch.value.ip)
|
log.debug "created ${d.displayName} with id $dni"
|
||||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
} else {
|
||||||
log.debug "created ${d.displayName} with id $dni"
|
log.debug "found ${d.displayName} with id $dni already exists"
|
||||||
} else {
|
}
|
||||||
log.debug "found ${d.displayName} with id $dni already exists"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user