mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-17 13:10:52 +00:00
Compare commits
28 Commits
simulated-
...
MSA-796
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d69abb64bd | ||
|
|
7429ecc83b | ||
|
|
112a35f5db | ||
|
|
c297564665 | ||
|
|
26ab32565b | ||
|
|
9733947fea | ||
|
|
6abf8c7f20 | ||
|
|
fe505ddc9f | ||
|
|
f4034f5ccf | ||
|
|
c1c2431299 | ||
|
|
39f0c49ea6 | ||
|
|
ed5a409c63 | ||
|
|
8453292038 | ||
|
|
e98a04a1b4 | ||
|
|
41e95b9248 | ||
|
|
63f20c912d | ||
|
|
837d2d0cfd | ||
|
|
629c4cc231 | ||
|
|
f12684565c | ||
|
|
51e727b91a | ||
|
|
49a858eb5c | ||
|
|
112a4087b0 | ||
|
|
132d8fc9d8 | ||
|
|
5b0b239caa | ||
|
|
3ea70fecad | ||
|
|
358cf261e8 | ||
|
|
21041570db | ||
|
|
96f2c5ed8b |
@@ -0,0 +1,153 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2016 SmartThings
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License. You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
metadata {
|
||||||
|
definition (name: "Arrival Sensor HA", namespace: "smartthings", author: "SmartThings") {
|
||||||
|
capability "Tone"
|
||||||
|
capability "Actuator"
|
||||||
|
capability "Presence Sensor"
|
||||||
|
capability "Sensor"
|
||||||
|
capability "Battery"
|
||||||
|
capability "Configuration"
|
||||||
|
|
||||||
|
fingerprint inClusters: "0000,0001,0003,000F,0020", outClusters: "0003,0019",
|
||||||
|
manufacturer: "SmartThings", model: "tagv4", deviceJoinName: "Arrival Sensor"
|
||||||
|
}
|
||||||
|
|
||||||
|
preferences {
|
||||||
|
section {
|
||||||
|
image(name: 'educationalcontent', multiple: true, images: [
|
||||||
|
"http://cdn.device-gse.smartthings.com/Arrival/Arrival1.png",
|
||||||
|
"http://cdn.device-gse.smartthings.com/Arrival/Arrival2.png"
|
||||||
|
])
|
||||||
|
}
|
||||||
|
section {
|
||||||
|
input "checkInterval", "enum", title: "Presence timeout (minutes)",
|
||||||
|
defaultValue:"2", options: ["2", "3", "5"], displayDuringSetup: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tiles {
|
||||||
|
standardTile("presence", "device.presence", width: 2, height: 2, canChangeBackground: true) {
|
||||||
|
state "present", labelIcon:"st.presence.tile.present", backgroundColor:"#53a7c0"
|
||||||
|
state "not present", labelIcon:"st.presence.tile.not-present", backgroundColor:"#ffffff"
|
||||||
|
}
|
||||||
|
standardTile("beep", "device.beep", decoration: "flat") {
|
||||||
|
state "beep", label:'', action:"tone.beep", icon:"st.secondary.beep", backgroundColor:"#ffffff"
|
||||||
|
}
|
||||||
|
valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) {
|
||||||
|
state "battery", label:'${currentValue}% battery', unit:""
|
||||||
|
}
|
||||||
|
|
||||||
|
main "presence"
|
||||||
|
details(["presence", "beep", "battery"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
startTimer()
|
||||||
|
}
|
||||||
|
|
||||||
|
def configure() {
|
||||||
|
def cmds = zigbee.configureReporting(0x0001, 0x0020, 0x20, 20, 20, 0x01)
|
||||||
|
log.debug "configure -- cmds: ${cmds}"
|
||||||
|
return cmds
|
||||||
|
}
|
||||||
|
|
||||||
|
def beep() {
|
||||||
|
log.debug "Sending Identify command to beep the sensor for 5 seconds"
|
||||||
|
return zigbee.command(0x0003, 0x00, "0500")
|
||||||
|
}
|
||||||
|
|
||||||
|
def parse(String description) {
|
||||||
|
state.lastCheckin = now()
|
||||||
|
handlePresenceEvent(true)
|
||||||
|
|
||||||
|
if (description?.startsWith('read attr -')) {
|
||||||
|
handleReportAttributeMessage(description)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleReportAttributeMessage(String description) {
|
||||||
|
def descMap = zigbee.parseDescriptionAsMap(description)
|
||||||
|
|
||||||
|
if (descMap.clusterInt == 0x0001 && descMap.attrInt == 0x0020) {
|
||||||
|
handleBatteryEvent(Integer.parseInt(descMap.value, 16))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleBatteryEvent(rawValue) {
|
||||||
|
def linkText = getLinkText(device)
|
||||||
|
|
||||||
|
def eventMap = [
|
||||||
|
name: 'battery',
|
||||||
|
value: '--'
|
||||||
|
]
|
||||||
|
|
||||||
|
def volts = rawValue / 10
|
||||||
|
if (volts > 0){
|
||||||
|
def minVolts = 2.0
|
||||||
|
def maxVolts = 2.8
|
||||||
|
|
||||||
|
if (volts < minVolts)
|
||||||
|
volts = minVolts
|
||||||
|
else if (volts > maxVolts)
|
||||||
|
volts = maxVolts
|
||||||
|
def pct = (volts - minVolts) / (maxVolts - minVolts)
|
||||||
|
|
||||||
|
eventMap.value = Math.round(pct * 100)
|
||||||
|
eventMap.descriptionText = "${linkText} battery was ${eventMap.value}%"
|
||||||
|
}
|
||||||
|
|
||||||
|
log.debug "Creating battery event: ${eventMap}"
|
||||||
|
sendEvent(eventMap)
|
||||||
|
}
|
||||||
|
|
||||||
|
private handlePresenceEvent(present) {
|
||||||
|
def wasPresent = device.currentState("presence")?.value == "present"
|
||||||
|
if (!wasPresent && present) {
|
||||||
|
log.debug "Sensor is present"
|
||||||
|
startTimer()
|
||||||
|
} else if (!present) {
|
||||||
|
log.debug "Sensor is not present"
|
||||||
|
stopTimer()
|
||||||
|
}
|
||||||
|
def linkText = getLinkText(device)
|
||||||
|
def eventMap = [
|
||||||
|
name: "presence",
|
||||||
|
value: present ? "present" : "not present",
|
||||||
|
linkText: linkText,
|
||||||
|
descriptionText: "${linkText} has ${present ? 'arrived' : 'left'}",
|
||||||
|
]
|
||||||
|
log.debug "Creating presence event: ${eventMap}"
|
||||||
|
sendEvent(eventMap)
|
||||||
|
}
|
||||||
|
|
||||||
|
private startTimer() {
|
||||||
|
log.debug "Scheduling periodic timer"
|
||||||
|
schedule("0 * * * * ?", checkPresenceCallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
private stopTimer() {
|
||||||
|
log.debug "Stopping periodic timer"
|
||||||
|
unschedule()
|
||||||
|
}
|
||||||
|
|
||||||
|
def checkPresenceCallback() {
|
||||||
|
def timeSinceLastCheckin = (now() - state.lastCheckin) / 1000
|
||||||
|
def theCheckInterval = (checkInterval ? checkInterval as int : 2) * 60
|
||||||
|
log.debug "Sensor checked in ${timeSinceLastCheckin} seconds ago"
|
||||||
|
if (timeSinceLastCheckin >= theCheckInterval) {
|
||||||
|
handlePresenceEvent(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,7 +67,7 @@ metadata {
|
|||||||
state "setpoint", action:"raiseSetpoint", icon:"st.thermostat.thermostat-up"
|
state "setpoint", action:"raiseSetpoint", icon:"st.thermostat.thermostat-up"
|
||||||
}
|
}
|
||||||
valueTile("thermostatSetpoint", "device.thermostatSetpoint", width: 1, height: 1, decoration: "flat") {
|
valueTile("thermostatSetpoint", "device.thermostatSetpoint", width: 1, height: 1, decoration: "flat") {
|
||||||
state "thermostatSetpoint", label:'${currentValue}°'
|
state "thermostatSetpoint", label:'${currentValue}'
|
||||||
}
|
}
|
||||||
valueTile("currentStatus", "device.thermostatStatus", height: 1, width: 2, decoration: "flat") {
|
valueTile("currentStatus", "device.thermostatStatus", height: 1, width: 2, decoration: "flat") {
|
||||||
state "thermostatStatus", label:'${currentValue}', backgroundColor:"#ffffff"
|
state "thermostatStatus", label:'${currentValue}', backgroundColor:"#ffffff"
|
||||||
|
|||||||
@@ -204,8 +204,10 @@ private List parseReportAttributeMessage(String description) {
|
|||||||
}
|
}
|
||||||
result << getAccelerationResult(descMap.value)
|
result << getAccelerationResult(descMap.value)
|
||||||
}
|
}
|
||||||
else if (descMap.cluster == "FC02" && descMap.attrId == "0012") {
|
else if (descMap.cluster == "FC02" && descMap.attrId == "0012" && descMap.value.size() == 24) {
|
||||||
result << parseAxis(descMap.value)
|
// The size is checked to ensure the attribute report contains X, Y and Z values
|
||||||
|
// If all three axis are not included then the attribute report is ignored
|
||||||
|
result << parseAxis(descMap.value)
|
||||||
}
|
}
|
||||||
else if (descMap.cluster == "0001" && descMap.attrId == "0020") {
|
else if (descMap.cluster == "0001" && descMap.attrId == "0020") {
|
||||||
result << getBatteryResult(Integer.parseInt(descMap.value, 16))
|
result << getBatteryResult(Integer.parseInt(descMap.value, 16))
|
||||||
@@ -371,21 +373,50 @@ def getTemperature(value) {
|
|||||||
|
|
||||||
def refresh() {
|
def refresh() {
|
||||||
log.debug "Refreshing Values "
|
log.debug "Refreshing Values "
|
||||||
def refreshCmds = [
|
|
||||||
|
|
||||||
/* sensitivity - default value (8) */
|
def refreshCmds = []
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
if (device.getDataValue("manufacturer") == "SmartThings") {
|
||||||
"zcl global write 0xFC02 0 0x20 {02}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 1", "delay 400",
|
|
||||||
|
|
||||||
"st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 200",
|
log.debug "Refreshing Values for manufacturer: SmartThings "
|
||||||
"st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 200",
|
refreshCmds = refreshCmds + [
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
/* These values of Motion Threshold Multiplier(01) and Motion Threshold (7602)
|
||||||
"zcl global read 0xFC02 0x0010",
|
seem to be giving pretty accurate results for the XYZ co-ordinates for this manufacturer.
|
||||||
"send 0x${device.deviceNetworkId} 1 1","delay 400"
|
Separating these out in a separate if-else because I do not want to touch Centralite part
|
||||||
]
|
as of now.
|
||||||
|
*/
|
||||||
|
|
||||||
|
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
||||||
|
"zcl global write 0xFC02 0 0x20 {01}", "delay 200",
|
||||||
|
"send 0x${device.deviceNetworkId} 1 1", "delay 400",
|
||||||
|
|
||||||
|
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
||||||
|
"zcl global write 0xFC02 2 0x21 {7602}", "delay 200",
|
||||||
|
"send 0x${device.deviceNetworkId} 1 1", "delay 400",
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
refreshCmds = refreshCmds + [
|
||||||
|
|
||||||
|
/* sensitivity - default value (8) */
|
||||||
|
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
||||||
|
"zcl global write 0xFC02 0 0x20 {02}", "delay 200",
|
||||||
|
"send 0x${device.deviceNetworkId} 1 1", "delay 400",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
//Common refresh commands
|
||||||
|
refreshCmds = refreshCmds + [
|
||||||
|
"st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 200",
|
||||||
|
"st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 200",
|
||||||
|
|
||||||
|
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
||||||
|
"zcl global read 0xFC02 0x0010",
|
||||||
|
"send 0x${device.deviceNetworkId} 1 1","delay 400"
|
||||||
|
]
|
||||||
|
|
||||||
return refreshCmds + enrollResponse()
|
return refreshCmds + enrollResponse()
|
||||||
}
|
}
|
||||||
@@ -447,35 +478,34 @@ def enrollResponse() {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Map parseAxis(String description) {
|
private Map parseAxis(String description) {
|
||||||
log.debug "parseAxis"
|
def hexToSignedInt = { hexVal ->
|
||||||
def xyzResults = [x: 0, y: 0, z: 0]
|
def unsignedVal = hexToInt(hexVal)
|
||||||
def parts = description.split("2900")
|
unsignedVal > 32767 ? unsignedVal - 65536 : unsignedVal
|
||||||
parts[0] = "12" + parts[0]
|
}
|
||||||
parts.each { part ->
|
|
||||||
part = part.trim()
|
def z = hexToSignedInt(description[0..3])
|
||||||
if (part.startsWith("12")) {
|
def y = hexToSignedInt(description[10..13])
|
||||||
def unsignedX = hexToInt(part.split("12")[1].trim())
|
def x = hexToSignedInt(description[20..23])
|
||||||
def signedX = unsignedX > 32767 ? unsignedX - 65536 : unsignedX
|
def xyzResults = [x: x, y: y, z: z]
|
||||||
xyzResults.x = signedX
|
|
||||||
log.debug "X Part: ${signedX}"
|
if (device.getDataValue("manufacturer") == "SmartThings") {
|
||||||
}
|
// This mapping matches the current behavior of the Device Handler for the Centralite sensors
|
||||||
else if (part.startsWith("13")) {
|
xyzResults.x = z
|
||||||
def unsignedY = hexToInt(part.split("13")[1].trim())
|
xyzResults.y = y
|
||||||
def signedY = unsignedY > 32767 ? unsignedY - 65536 : unsignedY
|
xyzResults.z = -x
|
||||||
xyzResults.y = signedY
|
} else {
|
||||||
log.debug "Y Part: ${signedY}"
|
// The axises reported by the Device Handler differ from the axises reported by the sensor
|
||||||
}
|
// This may change in the future
|
||||||
else if (part.startsWith("14")) {
|
xyzResults.x = z
|
||||||
def unsignedZ = hexToInt(part.split("14")[1].trim())
|
xyzResults.y = x
|
||||||
def signedZ = unsignedZ > 32767 ? unsignedZ - 65536 : unsignedZ
|
xyzResults.z = y
|
||||||
xyzResults.z = signedZ
|
}
|
||||||
log.debug "Z Part: ${signedZ}"
|
|
||||||
if (garageSensor == "Yes")
|
log.debug "parseAxis -- ${xyzResults}"
|
||||||
garageEvent(signedZ)
|
|
||||||
}
|
if (garageSensor == "Yes")
|
||||||
}
|
garageEvent(xyzResults.z)
|
||||||
|
|
||||||
getXyzResult(xyzResults, description)
|
getXyzResult(xyzResults, description)
|
||||||
}
|
}
|
||||||
@@ -553,3 +583,4 @@ private byte[] reverseArray(byte[] array) {
|
|||||||
return array
|
return array
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2014 SmartThings
|
* Copyright 2015 SmartThings
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License. You may obtain a copy of the License at:
|
* in compliance with the License. You may obtain a copy of the License at:
|
||||||
@@ -15,6 +15,7 @@ metadata {
|
|||||||
// Automatically generated. Make future change here.
|
// Automatically generated. Make future change here.
|
||||||
definition (name: "Simulated Thermostat", namespace: "smartthings/testing", author: "SmartThings") {
|
definition (name: "Simulated Thermostat", namespace: "smartthings/testing", author: "SmartThings") {
|
||||||
capability "Thermostat"
|
capability "Thermostat"
|
||||||
|
capability "Relative Humidity Measurement"
|
||||||
|
|
||||||
command "tempUp"
|
command "tempUp"
|
||||||
command "tempDown"
|
command "tempDown"
|
||||||
@@ -22,11 +23,40 @@ metadata {
|
|||||||
command "heatDown"
|
command "heatDown"
|
||||||
command "coolUp"
|
command "coolUp"
|
||||||
command "coolDown"
|
command "coolDown"
|
||||||
command "setTemperature", ["number"]
|
command "setTemperature", ["number"]
|
||||||
}
|
}
|
||||||
|
|
||||||
tiles {
|
tiles(scale: 2) {
|
||||||
valueTile("temperature", "device.temperature", width: 1, height: 1) {
|
multiAttributeTile(name:"thermostatMulti", type:"thermostat", width:6, height:4) {
|
||||||
|
tileAttribute("device.temperature", key: "PRIMARY_CONTROL") {
|
||||||
|
attributeState("default", label:'${currentValue}', unit:"dF")
|
||||||
|
}
|
||||||
|
tileAttribute("device.temperature", key: "VALUE_CONTROL") {
|
||||||
|
attributeState("default", action: "setTemperature")
|
||||||
|
}
|
||||||
|
tileAttribute("device.humidity", key: "SECONDARY_CONTROL") {
|
||||||
|
attributeState("default", label:'${currentValue}%', unit:"%")
|
||||||
|
}
|
||||||
|
tileAttribute("device.thermostatOperatingState", key: "OPERATING_STATE") {
|
||||||
|
attributeState("idle", backgroundColor:"#44b621")
|
||||||
|
attributeState("heating", backgroundColor:"#ffa81e")
|
||||||
|
attributeState("cooling", backgroundColor:"#269bd2")
|
||||||
|
}
|
||||||
|
tileAttribute("device.thermostatMode", key: "THERMOSTAT_MODE") {
|
||||||
|
attributeState("off", label:'${name}')
|
||||||
|
attributeState("heat", label:'${name}')
|
||||||
|
attributeState("cool", label:'${name}')
|
||||||
|
attributeState("auto", label:'${name}')
|
||||||
|
}
|
||||||
|
tileAttribute("device.heatingSetpoint", key: "HEATING_SETPOINT") {
|
||||||
|
attributeState("default", label:'${currentValue}', unit:"dF")
|
||||||
|
}
|
||||||
|
tileAttribute("device.coolingSetpoint", key: "COOLING_SETPOINT") {
|
||||||
|
attributeState("default", label:'${currentValue}', unit:"dF")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
valueTile("temperature", "device.temperature", width: 2, height: 2) {
|
||||||
state("temperature", label:'${currentValue}', unit:"dF",
|
state("temperature", label:'${currentValue}', unit:"dF",
|
||||||
backgroundColors:[
|
backgroundColors:[
|
||||||
[value: 31, color: "#153591"],
|
[value: 31, color: "#153591"],
|
||||||
@@ -39,51 +69,51 @@ metadata {
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
standardTile("tempDown", "device.temperature", inactiveLabel: false, decoration: "flat") {
|
standardTile("tempDown", "device.temperature", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'down', action:"tempDown"
|
state "default", label:'down', action:"tempDown"
|
||||||
}
|
}
|
||||||
standardTile("tempUp", "device.temperature", inactiveLabel: false, decoration: "flat") {
|
standardTile("tempUp", "device.temperature", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'up', action:"tempUp"
|
state "default", label:'up', action:"tempUp"
|
||||||
}
|
}
|
||||||
|
|
||||||
valueTile("heatingSetpoint", "device.heatingSetpoint", inactiveLabel: false, decoration: "flat") {
|
valueTile("heatingSetpoint", "device.heatingSetpoint", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "heat", label:'${currentValue} heat', unit: "F", backgroundColor:"#ffffff"
|
state "heat", label:'${currentValue} heat', unit: "F", backgroundColor:"#ffffff"
|
||||||
}
|
}
|
||||||
standardTile("heatDown", "device.temperature", inactiveLabel: false, decoration: "flat") {
|
standardTile("heatDown", "device.temperature", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'down', action:"heatDown"
|
state "default", label:'down', action:"heatDown"
|
||||||
}
|
}
|
||||||
standardTile("heatUp", "device.temperature", inactiveLabel: false, decoration: "flat") {
|
standardTile("heatUp", "device.temperature", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'up', action:"heatUp"
|
state "default", label:'up', action:"heatUp"
|
||||||
}
|
}
|
||||||
|
|
||||||
valueTile("coolingSetpoint", "device.coolingSetpoint", inactiveLabel: false, decoration: "flat") {
|
valueTile("coolingSetpoint", "device.coolingSetpoint", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "cool", label:'${currentValue} cool', unit:"F", backgroundColor:"#ffffff"
|
state "cool", label:'${currentValue} cool', unit:"F", backgroundColor:"#ffffff"
|
||||||
}
|
}
|
||||||
standardTile("coolDown", "device.temperature", inactiveLabel: false, decoration: "flat") {
|
standardTile("coolDown", "device.temperature", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'down', action:"coolDown"
|
state "default", label:'down', action:"coolDown"
|
||||||
}
|
}
|
||||||
standardTile("coolUp", "device.temperature", inactiveLabel: false, decoration: "flat") {
|
standardTile("coolUp", "device.temperature", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'up', action:"coolUp"
|
state "default", label:'up', action:"coolUp"
|
||||||
}
|
}
|
||||||
|
|
||||||
standardTile("mode", "device.thermostatMode", inactiveLabel: false, decoration: "flat") {
|
standardTile("mode", "device.thermostatMode", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "off", label:'${name}', action:"thermostat.heat", backgroundColor:"#ffffff"
|
state "off", label:'${name}', action:"thermostat.heat", backgroundColor:"#ffffff"
|
||||||
state "heat", label:'${name}', action:"thermostat.cool", backgroundColor:"#ffa81e"
|
state "heat", label:'${name}', action:"thermostat.cool", backgroundColor:"#ffa81e"
|
||||||
state "cool", label:'${name}', action:"thermostat.auto", backgroundColor:"#269bd2"
|
state "cool", label:'${name}', action:"thermostat.auto", backgroundColor:"#269bd2"
|
||||||
state "auto", label:'${name}', action:"thermostat.off", backgroundColor:"#79b821"
|
state "auto", label:'${name}', action:"thermostat.off", backgroundColor:"#79b821"
|
||||||
}
|
}
|
||||||
standardTile("fanMode", "device.thermostatFanMode", inactiveLabel: false, decoration: "flat") {
|
standardTile("fanMode", "device.thermostatFanMode", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "fanAuto", label:'${name}', action:"thermostat.fanOn", backgroundColor:"#ffffff"
|
state "fanAuto", label:'${name}', action:"thermostat.fanOn", backgroundColor:"#ffffff"
|
||||||
state "fanOn", label:'${name}', action:"thermostat.fanCirculate", backgroundColor:"#ffffff"
|
state "fanOn", label:'${name}', action:"thermostat.fanCirculate", backgroundColor:"#ffffff"
|
||||||
state "fanCirculate", label:'${name}', action:"thermostat.fanAuto", backgroundColor:"#ffffff"
|
state "fanCirculate", label:'${name}', action:"thermostat.fanAuto", backgroundColor:"#ffffff"
|
||||||
}
|
}
|
||||||
standardTile("operatingState", "device.thermostatOperatingState") {
|
standardTile("operatingState", "device.thermostatOperatingState", width: 2, height: 2) {
|
||||||
state "idle", label:'${name}', backgroundColor:"#ffffff"
|
state "idle", label:'${name}', backgroundColor:"#ffffff"
|
||||||
state "heating", label:'${name}', backgroundColor:"#ffa81e"
|
state "heating", label:'${name}', backgroundColor:"#ffa81e"
|
||||||
state "cooling", label:'${name}', backgroundColor:"#269bd2"
|
state "cooling", label:'${name}', backgroundColor:"#269bd2"
|
||||||
}
|
}
|
||||||
|
|
||||||
main("temperature","operatingState")
|
main("thermostatMulti")
|
||||||
details([
|
details([
|
||||||
"temperature","tempDown","tempUp",
|
"temperature","tempDown","tempUp",
|
||||||
"mode", "fanMode", "operatingState",
|
"mode", "fanMode", "operatingState",
|
||||||
@@ -101,6 +131,7 @@ def installed() {
|
|||||||
sendEvent(name: "thermostatMode", value: "off")
|
sendEvent(name: "thermostatMode", value: "off")
|
||||||
sendEvent(name: "thermostatFanMode", value: "fanAuto")
|
sendEvent(name: "thermostatFanMode", value: "fanAuto")
|
||||||
sendEvent(name: "thermostatOperatingState", value: "idle")
|
sendEvent(name: "thermostatOperatingState", value: "idle")
|
||||||
|
sendEvent(name: "humidity", value: 53, unit: "%")
|
||||||
}
|
}
|
||||||
|
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ metadata {
|
|||||||
|
|
||||||
tiles {
|
tiles {
|
||||||
|
|
||||||
valueTile("power", "device.power") {
|
valueTile("power", "device.power", canChangeIcon: true) {
|
||||||
state "power", label: '${currentValue} W'
|
state "power", label: '${currentValue} W'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ User-Agent: CyberGarage-HTTP/1.0
|
|||||||
def poll() {
|
def poll() {
|
||||||
log.debug "Executing 'poll'"
|
log.debug "Executing 'poll'"
|
||||||
if (device.currentValue("currentIP") != "Offline")
|
if (device.currentValue("currentIP") != "Offline")
|
||||||
runIn(10, setOffline)
|
runIn(30, setOffline)
|
||||||
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
|
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
|
||||||
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
|
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
|
||||||
Content-Length: 277
|
Content-Length: 277
|
||||||
|
|||||||
@@ -77,9 +77,8 @@ def parse(String description) {
|
|||||||
def result = []
|
def result = []
|
||||||
def bodyString = msg.body
|
def bodyString = msg.body
|
||||||
if (bodyString) {
|
if (bodyString) {
|
||||||
unschedule("setOffline")
|
unschedule("setOffline")
|
||||||
def body = new XmlSlurper().parseText(bodyString)
|
def body = new XmlSlurper().parseText(bodyString)
|
||||||
|
|
||||||
if (body?.property?.TimeSyncRequest?.text()) {
|
if (body?.property?.TimeSyncRequest?.text()) {
|
||||||
log.trace "Got TimeSyncRequest"
|
log.trace "Got TimeSyncRequest"
|
||||||
result << timeSyncResponse()
|
result << timeSyncResponse()
|
||||||
@@ -134,7 +133,7 @@ def refresh() {
|
|||||||
def getStatus() {
|
def getStatus() {
|
||||||
log.debug "Executing WeMo Motion 'getStatus'"
|
log.debug "Executing WeMo Motion 'getStatus'"
|
||||||
if (device.currentValue("currentIP") != "Offline")
|
if (device.currentValue("currentIP") != "Offline")
|
||||||
runIn(10, setOffline)
|
runIn(30, setOffline)
|
||||||
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
|
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
|
||||||
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
|
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
|
||||||
Content-Length: 277
|
Content-Length: 277
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
command "subscribe"
|
command "subscribe"
|
||||||
command "resubscribe"
|
command "resubscribe"
|
||||||
command "unsubscribe"
|
command "unsubscribe"
|
||||||
|
command "setOffline"
|
||||||
}
|
}
|
||||||
|
|
||||||
// simulator metadata
|
// simulator metadata
|
||||||
@@ -275,7 +276,7 @@ def setOffline() {
|
|||||||
def poll() {
|
def poll() {
|
||||||
log.debug "Executing 'poll'"
|
log.debug "Executing 'poll'"
|
||||||
if (device.currentValue("currentIP") != "Offline")
|
if (device.currentValue("currentIP") != "Offline")
|
||||||
runIn(10, setOffline)
|
runIn(30, setOffline)
|
||||||
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
|
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
|
||||||
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
|
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
|
||||||
Content-Length: 277
|
Content-Length: 277
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
@@ -0,0 +1,189 @@
|
|||||||
|
/**
|
||||||
|
* Vinli Home Beta
|
||||||
|
*
|
||||||
|
* Copyright 2015 Daniel
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
definition(
|
||||||
|
name: "Vinli Home Connect",
|
||||||
|
namespace: "com.vinli.smartthings",
|
||||||
|
author: "Daniel",
|
||||||
|
description: "Allows Vinli users to connect their car to SmartThings",
|
||||||
|
category: "SmartThings Labs",
|
||||||
|
iconUrl: "https://d3azp77rte0gip.cloudfront.net/smartapps/baeb2e5d-ebd0-49fe-a4ec-e92417ae20bb/images/vinli_oauth_60.png",
|
||||||
|
iconX2Url: "https://d3azp77rte0gip.cloudfront.net/smartapps/baeb2e5d-ebd0-49fe-a4ec-e92417ae20bb/images/vinli_oauth_120.png",
|
||||||
|
iconX3Url: "https://d3azp77rte0gip.cloudfront.net/smartapps/baeb2e5d-ebd0-49fe-a4ec-e92417ae20bb/images/vinli_oauth_120.png",
|
||||||
|
oauth: true)
|
||||||
|
|
||||||
|
preferences {
|
||||||
|
section ("Allow external service to control these things...") {
|
||||||
|
input "switches", "capability.switch", multiple: true, required: true
|
||||||
|
input "locks", "capability.lock", multiple: true, required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mappings {
|
||||||
|
|
||||||
|
path("/devices") {
|
||||||
|
action: [
|
||||||
|
GET: "listAllDevices"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
path("/switches") {
|
||||||
|
action: [
|
||||||
|
GET: "listSwitches"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
path("/switches/:command") {
|
||||||
|
action: [
|
||||||
|
PUT: "updateSwitches"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
path("/switches/:id/:command") {
|
||||||
|
action: [
|
||||||
|
PUT: "updateSwitch"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
path("/locks/:command") {
|
||||||
|
action: [
|
||||||
|
PUT: "updateLocks"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
path("/locks/:id/:command") {
|
||||||
|
action: [
|
||||||
|
PUT: "updateLock"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
path("/devices/:id/:command") {
|
||||||
|
action: [
|
||||||
|
PUT: "commandDevice"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// returns a list of all devices
|
||||||
|
def listAllDevices() {
|
||||||
|
def resp = []
|
||||||
|
switches.each {
|
||||||
|
resp << [name: it.name, label: it.label, value: it.currentValue("switch"), type: "switch", id: it.id, hub: it.hub.name]
|
||||||
|
}
|
||||||
|
|
||||||
|
locks.each {
|
||||||
|
resp << [name: it.name, label: it.label, value: it.currentValue("lock"), type: "lock", id: it.id, hub: it.hub.name]
|
||||||
|
}
|
||||||
|
return resp
|
||||||
|
}
|
||||||
|
|
||||||
|
// returns a list like
|
||||||
|
// [[name: "kitchen lamp", value: "off"], [name: "bathroom", value: "on"]]
|
||||||
|
def listSwitches() {
|
||||||
|
def resp = []
|
||||||
|
switches.each {
|
||||||
|
resp << [name: it.displayName, value: it.currentValue("switch"), type: "switch", id: it.id]
|
||||||
|
}
|
||||||
|
return resp
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateLocks() {
|
||||||
|
// use the built-in request object to get the command parameter
|
||||||
|
def command = params.command
|
||||||
|
|
||||||
|
if (command) {
|
||||||
|
|
||||||
|
// check that the switch supports the specified command
|
||||||
|
// If not, return an error using httpError, providing a HTTP status code.
|
||||||
|
locks.each {
|
||||||
|
if (!it.hasCommand(command)) {
|
||||||
|
httpError(501, "$command is not a valid command for all switches specified")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// all switches have the comand
|
||||||
|
// execute the command on all switches
|
||||||
|
// (note we can do this on the array - the command will be invoked on every element
|
||||||
|
locks."$command"()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateLock() {
|
||||||
|
def command = params.command
|
||||||
|
|
||||||
|
locks.each {
|
||||||
|
if (!it.hasCommand(command)) {
|
||||||
|
httpError(400, "$command is not a valid command for all lock specified")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (it.id == params.id) {
|
||||||
|
it."$command"()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateSwitch() {
|
||||||
|
def command = params.command
|
||||||
|
|
||||||
|
switches.each {
|
||||||
|
if (!it.hasCommand(command)) {
|
||||||
|
httpError(400, "$command is not a valid command for all switches specified")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (it.id == params.id) {
|
||||||
|
it."$command"()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void commandDevice() {
|
||||||
|
def command = params.command
|
||||||
|
def devices = []
|
||||||
|
|
||||||
|
switches.each {
|
||||||
|
devices << it
|
||||||
|
}
|
||||||
|
|
||||||
|
locks.each {
|
||||||
|
devices << it
|
||||||
|
}
|
||||||
|
|
||||||
|
devices.each {
|
||||||
|
if (it.id == params.id) {
|
||||||
|
if (!it.hasCommand(command)) {
|
||||||
|
httpError(400, "$command is not a valid command for specified device")
|
||||||
|
}
|
||||||
|
it."$command"()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateSwitches() {
|
||||||
|
// use the built-in request object to get the command parameter
|
||||||
|
def command = params.command
|
||||||
|
|
||||||
|
if (command) {
|
||||||
|
|
||||||
|
// check that the switch supports the specified command
|
||||||
|
// If not, return an error using httpError, providing a HTTP status code.
|
||||||
|
switches.each {
|
||||||
|
if (!it.hasCommand(command)) {
|
||||||
|
httpError(400, "$command is not a valid command for all switches specified")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// all switches have the comand
|
||||||
|
// execute the command on all switches
|
||||||
|
// (note we can do this on the array - the command will be invoked on every element
|
||||||
|
switches."$command"()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
log.debug "Installed with settings: ${settings}"
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "Updated with settings: ${settings}"
|
||||||
|
|
||||||
|
unsubscribe()
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ preferences{
|
|||||||
input "lock1", "capability.lock", required: true
|
input "lock1", "capability.lock", required: true
|
||||||
}
|
}
|
||||||
section("Select the door contact sensor:") {
|
section("Select the door contact sensor:") {
|
||||||
input "contact", "capability.contactSensor", required: true
|
input "contact", "capability.contactSensor", required: true
|
||||||
}
|
}
|
||||||
section("Automatically lock the door when closed...") {
|
section("Automatically lock the door when closed...") {
|
||||||
input "minutesLater", "number", title: "Delay (in minutes):", required: true
|
input "minutesLater", "number", title: "Delay (in minutes):", required: true
|
||||||
@@ -22,9 +22,10 @@ preferences{
|
|||||||
input "secondsLater", "number", title: "Delay (in seconds):", required: true
|
input "secondsLater", "number", title: "Delay (in seconds):", required: true
|
||||||
}
|
}
|
||||||
section( "Notifications" ) {
|
section( "Notifications" ) {
|
||||||
input "sendPushMessage", "enum", title: "Send a push notification?", metadata:[values:["Yes", "No"]], required: false
|
input("recipients", "contact", title: "Send notifications to", required: false) {
|
||||||
input "phoneNumber", "phone", title: "Enter phone number to send text notification.", required: false
|
input "phoneNumber", "phone", title: "Warn with text message (optional)", description: "Phone Number", required: false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def installed(){
|
def installed(){
|
||||||
@@ -42,55 +43,73 @@ def initialize(){
|
|||||||
subscribe(lock1, "lock", doorHandler, [filterEvents: false])
|
subscribe(lock1, "lock", doorHandler, [filterEvents: false])
|
||||||
subscribe(lock1, "unlock", doorHandler, [filterEvents: false])
|
subscribe(lock1, "unlock", doorHandler, [filterEvents: false])
|
||||||
subscribe(contact, "contact.open", doorHandler)
|
subscribe(contact, "contact.open", doorHandler)
|
||||||
subscribe(contact, "contact.closed", doorHandler)
|
subscribe(contact, "contact.closed", doorHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
def lockDoor(){
|
def lockDoor(){
|
||||||
log.debug "Locking the door."
|
log.debug "Locking the door."
|
||||||
lock1.lock()
|
lock1.lock()
|
||||||
log.debug ( "Sending Push Notification..." )
|
if(location.contactBookEnabled) {
|
||||||
if ( sendPushMessage != "No" ) sendPush( "${lock1} locked after ${contact} was closed for ${minutesLater} minutes!" )
|
if ( recipients ) {
|
||||||
log.debug("Sending text message...")
|
log.debug ( "Sending Push Notification..." )
|
||||||
if ( phoneNumber != "0" ) sendSms( phoneNumber, "${lock1} locked after ${contact} was closed for ${minutesLater} minutes!" )
|
sendNotificationToContacts( "${lock1} locked after ${contact} was closed for ${minutesLater} minutes!", recipients)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (phoneNumber) {
|
||||||
|
log.debug("Sending text message...")
|
||||||
|
sendSms( phoneNumber, "${lock1} locked after ${contact} was closed for ${minutesLater} minutes!")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def unlockDoor(){
|
def unlockDoor(){
|
||||||
log.debug "Unlocking the door."
|
log.debug "Unlocking the door."
|
||||||
lock1.unlock()
|
lock1.unlock()
|
||||||
log.debug ( "Sending Push Notification..." )
|
if(location.contactBookEnabled) {
|
||||||
if ( sendPushMessage != "No" ) sendPush( "${lock1} unlocked after ${contact} was opened for ${secondsLater} seconds!" )
|
if ( recipients ) {
|
||||||
log.debug("Sending text message...")
|
log.debug ( "Sending Push Notification..." )
|
||||||
if ( phoneNumber != "0" ) sendSms( phoneNumber, "${lock1} unlocked after ${contact} was opened for ${secondsLater} seconds!" )
|
sendNotificationToContacts( "${lock1} unlocked after ${contact} was opened for ${secondsLater} seconds!", recipients)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( phoneNumber ) {
|
||||||
|
log.debug("Sending text message...")
|
||||||
|
sendSms( phoneNumber, "${lock1} unlocked after ${contact} was opened for ${secondsLater} seconds!")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def doorHandler(evt){
|
def doorHandler(evt){
|
||||||
if ((contact.latestValue("contact") == "open") && (evt.value == "locked")) { // If the door is open and a person locks the door then...
|
if ((contact.latestValue("contact") == "open") && (evt.value == "locked")) { // If the door is open and a person locks the door then...
|
||||||
def delay = (secondsLater) // runIn uses seconds
|
//def delay = (secondsLater) // runIn uses seconds
|
||||||
runIn( delay, unlockDoor ) // ...schedule (in minutes) to unlock... We don't want the door to be closed while the lock is engaged.
|
runIn( secondsLater, unlockDoor ) // ...schedule (in minutes) to unlock... We don't want the door to be closed while the lock is engaged.
|
||||||
}
|
}
|
||||||
else if ((contact.latestValue("contact") == "open") && (evt.value == "unlocked")) { // If the door is open and a person unlocks it then...
|
else if ((contact.latestValue("contact") == "open") && (evt.value == "unlocked")) { // If the door is open and a person unlocks it then...
|
||||||
unschedule( unlockDoor ) // ...we don't need to unlock it later.
|
unschedule( unlockDoor ) // ...we don't need to unlock it later.
|
||||||
}
|
}
|
||||||
else if ((contact.latestValue("contact") == "closed") && (evt.value == "locked")) { // If the door is closed and a person manually locks it then...
|
else if ((contact.latestValue("contact") == "closed") && (evt.value == "locked")) { // If the door is closed and a person manually locks it then...
|
||||||
unschedule( lockDoor ) // ...we don't need to lock it later.
|
unschedule( lockDoor ) // ...we don't need to lock it later.
|
||||||
}
|
}
|
||||||
else if ((contact.latestValue("contact") == "closed") && (evt.value == "unlocked")) { // If the door is closed and a person unlocks it then...
|
else if ((contact.latestValue("contact") == "closed") && (evt.value == "unlocked")) { // If the door is closed and a person unlocks it then...
|
||||||
def delay = (minutesLater * 60) // runIn uses seconds
|
//def delay = (minutesLater * 60) // runIn uses seconds
|
||||||
runIn( delay, lockDoor ) // ...schedule (in minutes) to lock.
|
runIn( (minutesLater * 60), lockDoor ) // ...schedule (in minutes) to lock.
|
||||||
}
|
}
|
||||||
else if ((lock1.latestValue("lock") == "unlocked") && (evt.value == "open")) { // If a person opens an unlocked door...
|
else if ((lock1.latestValue("lock") == "unlocked") && (evt.value == "open")) { // If a person opens an unlocked door...
|
||||||
unschedule( lockDoor ) // ...we don't need to lock it later.
|
unschedule( lockDoor ) // ...we don't need to lock it later.
|
||||||
}
|
}
|
||||||
else if ((lock1.latestValue("lock") == "unlocked") && (evt.value == "closed")) { // If a person closes an unlocked door...
|
else if ((lock1.latestValue("lock") == "unlocked") && (evt.value == "closed")) { // If a person closes an unlocked door...
|
||||||
def delay = (minutesLater * 60) // runIn uses seconds
|
//def delay = (minutesLater * 60) // runIn uses seconds
|
||||||
runIn( delay, lockDoor ) // ...schedule (in minutes) to lock.
|
runIn( (minutesLater * 60), lockDoor ) // ...schedule (in minutes) to lock.
|
||||||
}
|
}
|
||||||
else { //Opening or Closing door when locked (in case you have a handle lock)
|
else { //Opening or Closing door when locked (in case you have a handle lock)
|
||||||
log.debug "Unlocking the door."
|
log.debug "Unlocking the door."
|
||||||
lock1.unlock()
|
lock1.unlock()
|
||||||
log.debug ( "Sending Push Notification..." )
|
if(location.contactBookEnabled) {
|
||||||
if ( sendPushMessage != "No" ) sendPush( "${lock1} unlocked after ${contact} was opened or closed when ${lock1} was locked!" )
|
if ( recipients ) {
|
||||||
log.debug("Sending text message...")
|
log.debug ( "Sending Push Notification..." )
|
||||||
if ( phoneNumber != "0" ) sendSms( phoneNumber, "${lock1} unlocked after ${contact} was opened or closed when ${lock1} was locked!" )
|
sendNotificationToContacts( "${lock1} unlocked after ${contact} was opened or closed when ${lock1} was locked!", recipients)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if ( phoneNumber ) {
|
||||||
|
log.debug("Sending text message...")
|
||||||
|
sendSms( phoneNumber, "${lock1} unlocked after ${contact} was opened or closed when ${lock1} was locked!")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user