mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-10 13:21:52 +00:00
Compare commits
8 Commits
MSA-1227-1
...
PROD_2016.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b05d956d95 | ||
|
|
6cdb80db1f | ||
|
|
4db99824af | ||
|
|
b2e245bd85 | ||
|
|
9a9854cf92 | ||
|
|
37f1726ee6 | ||
|
|
d5ea735df7 | ||
|
|
e150ea4a59 |
@@ -9,7 +9,7 @@ apply plugin: 'smartthings-slack'
|
||||
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath "com.smartthings.deployment:executable-deployment-scripts:1.0.7"
|
||||
classpath "com.smartthings.deployment:executable-deployment-scripts:1.0.8"
|
||||
}
|
||||
repositories {
|
||||
mavenLocal()
|
||||
|
||||
@@ -24,7 +24,6 @@ metadata {
|
||||
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,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"
|
||||
|
||||
@@ -31,7 +31,6 @@ metadata {
|
||||
capability "Configuration"
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
capability "Health Check"
|
||||
|
||||
// indicates that device keeps track of heartbeat (in state.heartbeat)
|
||||
attribute "heartbeat", "string"
|
||||
|
||||
@@ -31,7 +31,6 @@ metadata {
|
||||
capability "Refresh"
|
||||
capability "Temperature Measurement"
|
||||
capability "Water Sensor"
|
||||
capability "Health Check"
|
||||
|
||||
command "enrollResponse"
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ metadata {
|
||||
capability "Battery"
|
||||
capability "Temperature Measurement"
|
||||
capability "Refresh"
|
||||
capability "Health Check"
|
||||
|
||||
command "enrollResponse"
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ metadata {
|
||||
capability "Acceleration Sensor"
|
||||
capability "Refresh"
|
||||
capability "Temperature Measurement"
|
||||
capability "Health Check"
|
||||
|
||||
command "enrollResponse"
|
||||
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05,FC02", outClusters: "0019", manufacturer: "CentraLite", model: "3320"
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
capability "Acceleration Sensor"
|
||||
capability "Refresh"
|
||||
capability "Temperature Measurement"
|
||||
capability "Health Check"
|
||||
command "enrollResponse"
|
||||
|
||||
command "enrollResponse"
|
||||
}
|
||||
|
||||
simulator {
|
||||
|
||||
@@ -20,7 +20,6 @@ metadata {
|
||||
capability "Refresh"
|
||||
capability "Temperature Measurement"
|
||||
capability "Relative Humidity Measurement"
|
||||
capability "Health Check"
|
||||
|
||||
fingerprint endpointId: "01", inClusters: "0001,0003,0020,0402,0B05,FC45", outClusters: "0019,0003"
|
||||
}
|
||||
|
||||
@@ -25,7 +25,10 @@ metadata {
|
||||
|
||||
fingerprint deviceId: "0x2001", inClusters: "0x30,0x80,0x84,0x85,0x86,0x72"
|
||||
fingerprint deviceId: "0x07", inClusters: "0x30"
|
||||
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x98"
|
||||
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x86,0x72,0x98", outClusters: "0x5A,0x82"
|
||||
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x80,0x71,0x85,0x70,0x72,0x86,0x30,0x31,0x84,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters:"0x20" // Philio multi+
|
||||
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x72,0x5A,0x80,0x73,0x86,0x84,0x85,0x59,0x71,0x70,0x7A,0x98" // Vision door/window
|
||||
}
|
||||
|
||||
// simulator metadata
|
||||
@@ -240,7 +243,7 @@ def batteryGetCommand() {
|
||||
def retypeBasedOnMSR() {
|
||||
switch (state.MSR) {
|
||||
case "0086-0002-002D":
|
||||
log.debug("Changing device type to Z-Wave Water Sensor")
|
||||
log.debug "Changing device type to Z-Wave Water Sensor"
|
||||
setDeviceType("Z-Wave Water Sensor")
|
||||
break
|
||||
case "011F-0001-0001": // Schlage motion
|
||||
@@ -249,9 +252,16 @@ def retypeBasedOnMSR() {
|
||||
case "0060-0001-0002": // Everspring SP814
|
||||
case "0060-0001-0003": // Everspring HSP02
|
||||
case "011A-0601-0901": // Enerwave ZWN-BPC
|
||||
log.debug("Changing device type to Z-Wave Motion Sensor")
|
||||
log.debug "Changing device type to Z-Wave Motion Sensor"
|
||||
setDeviceType("Z-Wave Motion Sensor")
|
||||
break
|
||||
|
||||
case "013C-0002-000D": // Philio multi +
|
||||
log.debug "Changing device type to 3-in-1 Multisensor Plus (SG)"
|
||||
setDeviceType("3-in-1 Multisensor Plus (SG)")
|
||||
break
|
||||
case "0109-2001-0106": // Vision door/window
|
||||
log.debug "Changing device type to Door / Window Sensor Plus (SG)"
|
||||
setDeviceType("Door / Window Sensor Plus (SG)")
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
/**
|
||||
* 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.alert = huesettings.alert ? huesettings.alert : "none"
|
||||
value.transitiontime = huesettings.transitiontime ? huesettings.transitiontime : 4
|
||||
value.transition = huesettings.transition ? huesettings.transition : 4
|
||||
|
||||
// Make sure to turn off light if requested
|
||||
if (huesettings.switch == "off")
|
||||
|
||||
@@ -236,22 +236,23 @@ def addSwitches() {
|
||||
d = getChildDevices()?.find {
|
||||
it.deviceNetworkId == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac
|
||||
}
|
||||
if (!d) {
|
||||
log.debug "Creating WeMo Switch with dni: ${selectedSwitch.value.mac}"
|
||||
d = addChildDevice("smartthings", "Wemo Switch", selectedSwitch.value.mac, selectedSwitch?.value.hub, [
|
||||
"label": selectedSwitch?.value?.name ?: "Wemo Switch",
|
||||
"data": [
|
||||
"mac": selectedSwitch.value.mac,
|
||||
"ip": selectedSwitch.value.ip,
|
||||
"port": selectedSwitch.value.port
|
||||
]
|
||||
])
|
||||
def ipvalue = convertHexToIP(selectedSwitch.value.ip)
|
||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||
log.debug "Created ${d.displayName} with id: ${d.id}, dni: ${d.deviceNetworkId}"
|
||||
} else {
|
||||
log.debug "found ${d.displayName} with id $dni already exists"
|
||||
}
|
||||
}
|
||||
|
||||
if (!d) {
|
||||
log.debug "Creating WeMo Switch with dni: ${selectedSwitch.value.mac}"
|
||||
d = addChildDevice("smartthings", "Wemo Switch", selectedSwitch.value.mac, selectedSwitch?.value.hub, [
|
||||
"label": selectedSwitch?.value?.name ?: "Wemo Switch",
|
||||
"data": [
|
||||
"mac": selectedSwitch.value.mac,
|
||||
"ip": selectedSwitch.value.ip,
|
||||
"port": selectedSwitch.value.port
|
||||
]
|
||||
])
|
||||
def ipvalue = convertHexToIP(selectedSwitch.value.ip)
|
||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||
log.debug "Created ${d.displayName} with id: ${d.id}, dni: ${d.deviceNetworkId}"
|
||||
} else {
|
||||
log.debug "found ${d.displayName} with id $dni already exists"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,22 +267,23 @@ def addMotions() {
|
||||
d = getChildDevices()?.find {
|
||||
it.deviceNetworkId == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac
|
||||
}
|
||||
if (!d) {
|
||||
log.debug "Creating WeMo Motion with dni: ${selectedMotion.value.mac}"
|
||||
d = addChildDevice("smartthings", "Wemo Motion", selectedMotion.value.mac, selectedMotion?.value.hub, [
|
||||
"label": selectedMotion?.value?.name ?: "Wemo Motion",
|
||||
"data": [
|
||||
"mac": selectedMotion.value.mac,
|
||||
"ip": selectedMotion.value.ip,
|
||||
"port": selectedMotion.value.port
|
||||
]
|
||||
])
|
||||
def ipvalue = convertHexToIP(selectedMotion.value.ip)
|
||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||
log.debug "Created ${d.displayName} with id: ${d.id}, dni: ${d.deviceNetworkId}"
|
||||
} else {
|
||||
log.debug "found ${d.displayName} with id $dni already exists"
|
||||
}
|
||||
}
|
||||
|
||||
if (!d) {
|
||||
log.debug "Creating WeMo Motion with dni: ${selectedMotion.value.mac}"
|
||||
d = addChildDevice("smartthings", "Wemo Motion", selectedMotion.value.mac, selectedMotion?.value.hub, [
|
||||
"label": selectedMotion?.value?.name ?: "Wemo Motion",
|
||||
"data": [
|
||||
"mac": selectedMotion.value.mac,
|
||||
"ip": selectedMotion.value.ip,
|
||||
"port": selectedMotion.value.port
|
||||
]
|
||||
])
|
||||
def ipvalue = convertHexToIP(selectedMotion.value.ip)
|
||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||
log.debug "Created ${d.displayName} with id: ${d.id}, dni: ${d.deviceNetworkId}"
|
||||
} else {
|
||||
log.debug "found ${d.displayName} with id $dni already exists"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,22 +298,23 @@ def addLightSwitches() {
|
||||
d = getChildDevices()?.find {
|
||||
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}"
|
||||
d = addChildDevice("smartthings", "Wemo Light Switch", selectedLightSwitch.value.mac, selectedLightSwitch?.value.hub, [
|
||||
"label": selectedLightSwitch?.value?.name ?: "Wemo Light Switch",
|
||||
"data": [
|
||||
"mac": selectedLightSwitch.value.mac,
|
||||
"ip": selectedLightSwitch.value.ip,
|
||||
"port": selectedLightSwitch.value.port
|
||||
]
|
||||
])
|
||||
def ipvalue = convertHexToIP(selectedLightSwitch.value.ip)
|
||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||
log.debug "created ${d.displayName} with id $dni"
|
||||
} else {
|
||||
log.debug "found ${d.displayName} with id $dni already exists"
|
||||
}
|
||||
}
|
||||
|
||||
if (!d) {
|
||||
log.debug "Creating WeMo Light Switch with dni: ${selectedLightSwitch.value.mac}"
|
||||
d = addChildDevice("smartthings", "Wemo Light Switch", selectedLightSwitch.value.mac, selectedLightSwitch?.value.hub, [
|
||||
"label": selectedLightSwitch?.value?.name ?: "Wemo Light Switch",
|
||||
"data": [
|
||||
"mac": selectedLightSwitch.value.mac,
|
||||
"ip": selectedLightSwitch.value.ip,
|
||||
"port": selectedLightSwitch.value.port
|
||||
]
|
||||
])
|
||||
def ipvalue = convertHexToIP(selectedLightSwitch.value.ip)
|
||||
d.sendEvent(name: "currentIP", value: ipvalue, descriptionText: "IP is ${ipvalue}")
|
||||
log.debug "created ${d.displayName} with id $dni"
|
||||
} else {
|
||||
log.debug "found ${d.displayName} with id $dni already exists"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user