mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-19 21:03:46 +00:00
Compare commits
10 Commits
MSA-1765-1
...
PROD_2017.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc312286a2 | ||
|
|
871d75aea6 | ||
|
|
3905d48235 | ||
|
|
d91c02b970 | ||
|
|
e019d22aff | ||
|
|
900ab9f70e | ||
|
|
e8d205c775 | ||
|
|
1800ea2bad | ||
|
|
54a4620c9b | ||
|
|
0846b6f34c |
@@ -1,145 +0,0 @@
|
|||||||
/**
|
|
||||||
* Aeon Motor Controller
|
|
||||||
*
|
|
||||||
* Copyright 2015 Bruce Ravenel
|
|
||||||
*
|
|
||||||
* 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: "Aeon Motor Controller", namespace: "bravenel", author: "Bruce Ravenel") {
|
|
||||||
capability "Refresh"
|
|
||||||
capability "Actuator"
|
|
||||||
capability "doorControl"
|
|
||||||
capability "Switch"
|
|
||||||
|
|
||||||
command "up"
|
|
||||||
command "down"
|
|
||||||
command "stop"
|
|
||||||
|
|
||||||
// fingerprint inClusters: "0x26,0x32"
|
|
||||||
}
|
|
||||||
|
|
||||||
simulator {
|
|
||||||
status "up": "command: 2604, payload: FF"
|
|
||||||
status "down": "command: 2604, payload: 00"
|
|
||||||
status "stop": "command: 2605, payload: FE"
|
|
||||||
|
|
||||||
["FF", "FE", "00"].each { val ->
|
|
||||||
reply "2001$val,delay 100,2602": "command: 2603, payload: $val"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tiles {
|
|
||||||
standardTile("motor", "device.motor", width: 2, height: 2) {
|
|
||||||
state("stopUp", label:'stop', icon:"st.doors.garage.garage-open", action: 'down', backgroundColor:"#79b821")
|
|
||||||
state("stopDn", label:'stop', icon:"st.doors.garage.garage-closed", action: 'up', backgroundColor:"#79b821")
|
|
||||||
state("up", label:'up', icon:"st.doors.garage.garage-opening", action:'stop', backgroundColor:"#ffe71e")
|
|
||||||
state("down", label:'down', icon:"st.doors.garage.garage-closing", action:'stop', backgroundColor:"#ffe71e")
|
|
||||||
}
|
|
||||||
valueTile("energy", "device.energy", decoration: "flat") {
|
|
||||||
state "default", label:' '
|
|
||||||
}
|
|
||||||
standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
|
|
||||||
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
|
||||||
}
|
|
||||||
standardTile("stop", "device.switch") {
|
|
||||||
state "default", label:"", action: "stop", icon:"http://cdn.device-icons.smartthings.com/sonos/stop-btn@2x.png"
|
|
||||||
}
|
|
||||||
standardTile("up", "device.switch") {
|
|
||||||
state "default", label: "Up", action: "up", icon:"http://cdn.device-icons.smartthings.com/thermostat/thermostat-up@2x.png"
|
|
||||||
}
|
|
||||||
standardTile("down", "device.switch") {
|
|
||||||
state "default", label: "Down", action: "down", icon:"http://cdn.device-icons.smartthings.com/thermostat/thermostat-down@2x.png"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
main(["motor"])
|
|
||||||
details(["motor", "refresh", "energy", "up", "down", "stop",])
|
|
||||||
}
|
|
||||||
|
|
||||||
// parse events into attributes
|
|
||||||
def parse(String description) {
|
|
||||||
def result = []
|
|
||||||
def cmd = zwave.parse(description, [0x20: 1, 0x26: 3])
|
|
||||||
if (cmd) {
|
|
||||||
result = zwaveEvent(cmd)
|
|
||||||
log.debug("'$description' parsed to $result")
|
|
||||||
} else {
|
|
||||||
log.debug("Couldn't zwave.parse '$description'")
|
|
||||||
}
|
|
||||||
result
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
|
|
||||||
motorEvents(cmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
|
|
||||||
motorEvents(cmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.switchmultilevelv3.SwitchMultilevelReport cmd) {
|
|
||||||
motorEvents(cmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
def motorEvents(physicalgraph.zwave.Command cmd) {
|
|
||||||
def result = []
|
|
||||||
def switchEvent = []
|
|
||||||
if(cmd.value == 0) {switchEvent = createEvent(name: "motor", value: "down", descriptionText: text)}
|
|
||||||
else if(cmd.value == 254) {
|
|
||||||
def stopVal = state.up ? "stopUp" : "stopDn"
|
|
||||||
switchEvent = createEvent(name: "motor", value: stopVal, descriptionText: text)
|
|
||||||
}
|
|
||||||
else if(cmd.value == 255) {switchEvent = createEvent(name: "motor", value: "up", descriptionText: text)}
|
|
||||||
result << switchEvent
|
|
||||||
}
|
|
||||||
|
|
||||||
def refresh() {
|
|
||||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
|
||||||
}
|
|
||||||
|
|
||||||
def up() {
|
|
||||||
state.up = true
|
|
||||||
delayBetween([
|
|
||||||
zwave.basicV1.basicSet(value: 0xFF).format(),
|
|
||||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
|
||||||
], 1000)
|
|
||||||
}
|
|
||||||
|
|
||||||
def down() {
|
|
||||||
state.up = false
|
|
||||||
delayBetween([
|
|
||||||
zwave.basicV1.basicSet(value: 0x00).format(),
|
|
||||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
|
||||||
], 1000)
|
|
||||||
}
|
|
||||||
|
|
||||||
def stop() {
|
|
||||||
delayBetween([
|
|
||||||
zwave.switchMultilevelV1.switchMultilevelStopLevelChange().format(),
|
|
||||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
|
||||||
], 1000)
|
|
||||||
}
|
|
||||||
|
|
||||||
def on() {
|
|
||||||
state.up = true
|
|
||||||
delayBetween([
|
|
||||||
zwave.basicV1.basicSet(value: 0xFF).format(),
|
|
||||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
|
||||||
], 1000)
|
|
||||||
}
|
|
||||||
|
|
||||||
def off() {
|
|
||||||
state.up = false
|
|
||||||
delayBetween([
|
|
||||||
zwave.basicV1.basicSet(value: 0x00).format(),
|
|
||||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
|
||||||
], 1000)
|
|
||||||
}
|
|
||||||
@@ -40,11 +40,14 @@ metadata {
|
|||||||
|
|
||||||
// Parse incoming device messages to generate events
|
// Parse incoming device messages to generate events
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def resMap
|
def name = null
|
||||||
if (description.startsWith("zone")) {
|
def value = description
|
||||||
resMap = createEvent(name: "contact", value: zigbee.parseZoneStatus(description).isAlarm1Set() ? "open" : "closed")
|
if (zigbee.isZoneType19(description)) {
|
||||||
|
name = "contact"
|
||||||
|
value = zigbee.translateStatusZoneType19(description) ? "open" : "closed"
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $resMap"
|
def result = createEvent(name: name, value: value)
|
||||||
return resMap
|
log.debug "Parse returned ${result?.descriptionText}"
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ def parse(String description) {
|
|||||||
log.debug "parse($description)"
|
log.debug "parse($description)"
|
||||||
def results = [:]
|
def results = [:]
|
||||||
|
|
||||||
if (!isSupportedDescription(description) || description.startsWith("zone")) {
|
if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) {
|
||||||
// Ignore this in favor of orientation-based state
|
// Ignore this in favor of orientation-based state
|
||||||
// results = parseSingleMessage(description)
|
// results = parseSingleMessage(description)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ def parse(String description) {
|
|||||||
log.debug "parse($description)"
|
log.debug "parse($description)"
|
||||||
def results = null
|
def results = null
|
||||||
|
|
||||||
if (!isSupportedDescription(description) || description.startsWith("zone")) {
|
if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) {
|
||||||
// Ignore this in favor of orientation-based state
|
// Ignore this in favor of orientation-based state
|
||||||
// results = parseSingleMessage(description)
|
// results = parseSingleMessage(description)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ metadata {
|
|||||||
|
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def results = [:]
|
def results = [:]
|
||||||
if (description.startsWith("zone") || !isSupportedDescription(description)) {
|
if (isZoneType19(description) || !isSupportedDescription(description)) {
|
||||||
results = parseBasicMessage(description)
|
results = parseBasicMessage(description)
|
||||||
}
|
}
|
||||||
else if (isMotionStatusMessage(description)){
|
else if (isMotionStatusMessage(description)){
|
||||||
@@ -87,12 +87,16 @@ private String parseName(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String parseValue(String description) {
|
private String parseValue(String description) {
|
||||||
def zs = zigbee.parseZoneStatus(description)
|
if (isZoneType19(description)) {
|
||||||
if (zs) {
|
if (translateStatusZoneType19(description)) {
|
||||||
zs.isAlarm1Set() ? "active" : "inactive"
|
return "active"
|
||||||
} else {
|
}
|
||||||
description
|
else {
|
||||||
|
return "inactive"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
description
|
||||||
}
|
}
|
||||||
|
|
||||||
private parseDescriptionText(String linkText, String value, String description) {
|
private parseDescriptionText(String linkText, String value, String description) {
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ metadata {
|
|||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def results
|
def results
|
||||||
|
|
||||||
if (!isSupportedDescription(description) || description.startsWith("zone")) {
|
if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) {
|
||||||
results = parseSingleMessage(description)
|
results = parseSingleMessage(description)
|
||||||
}
|
}
|
||||||
else if (description == 'updated') {
|
else if (description == 'updated') {
|
||||||
@@ -488,7 +488,12 @@ private String parseValue(String description) {
|
|||||||
if (!isSupportedDescription(description)) {
|
if (!isSupportedDescription(description)) {
|
||||||
return description
|
return description
|
||||||
}
|
}
|
||||||
return zigbee.parseZoneStatus(description)?.isAlarm1Set() ? "open" : "closed"
|
else if (zigbee.translateStatusZoneType19(description)) {
|
||||||
|
return "open"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "closed"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private parseDescriptionText(String linkText, String value, String description) {
|
private parseDescriptionText(String linkText, String value, String description) {
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ metadata {
|
|||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def results
|
def results
|
||||||
|
|
||||||
if (!isSupportedDescription(description) || description.startsWith("zone")) {
|
if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) {
|
||||||
// Ignore this in favor of orientation-based state
|
// Ignore this in favor of orientation-based state
|
||||||
// results = parseSingleMessage(description)
|
// results = parseSingleMessage(description)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,38 +118,15 @@ private Map getBatteryResult(rawValue) {
|
|||||||
private Map parseNonIasButtonMessage(Map descMap){
|
private Map parseNonIasButtonMessage(Map descMap){
|
||||||
def buttonState = ""
|
def buttonState = ""
|
||||||
def buttonNumber = 0
|
def buttonNumber = 0
|
||||||
if ((device.getDataValue("model") == "3460-L") &&(descMap.clusterInt == 0x0006)) {
|
if (((device.getDataValue("model") == "3460-L") || (device.getDataValue("model") == "3450-L"))
|
||||||
if (descMap.commandInt == 1) {
|
&&(descMap.clusterInt == 0x0006)) {
|
||||||
|
if (descMap.command == "01") {
|
||||||
getButtonResult("press")
|
getButtonResult("press")
|
||||||
}
|
}
|
||||||
else if (descMap.commandInt == 0) {
|
else if (descMap.command == "00") {
|
||||||
getButtonResult("release")
|
getButtonResult("release")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((device.getDataValue("model") == "3450-L") && (descMap.clusterInt == 0x0006)) {
|
|
||||||
if (descMap.commandInt == 1) {
|
|
||||||
getButtonResult("press")
|
|
||||||
}
|
|
||||||
else if (descMap.commandInt == 0) {
|
|
||||||
def button = 1
|
|
||||||
switch(descMap.sourceEndpoint) {
|
|
||||||
case "01":
|
|
||||||
button = 4
|
|
||||||
break
|
|
||||||
case "02":
|
|
||||||
button = 3
|
|
||||||
break
|
|
||||||
case "03":
|
|
||||||
button = 1
|
|
||||||
break
|
|
||||||
case "04":
|
|
||||||
button = 2
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
getButtonResult("release", button)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (descMap.clusterInt == 0x0006) {
|
else if (descMap.clusterInt == 0x0006) {
|
||||||
buttonState = "pushed"
|
buttonState = "pushed"
|
||||||
if (descMap.command == "01") {
|
if (descMap.command == "01") {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ def on() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def setLevel(value) {
|
def setLevel(value) {
|
||||||
zigbee.setLevel(value)
|
zigbee.setLevel(value) + (value?.toInteger() > 0 ? zigbee.on() : [])
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ metadata {
|
|||||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "0003, 0006, 0019, 0406", manufacturer: "Leviton", model: "ZSS-10", deviceJoinName: "Leviton Switch"
|
fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "0003, 0006, 0019, 0406", manufacturer: "Leviton", model: "ZSS-10", deviceJoinName: "Leviton Switch"
|
||||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "000A", manufacturer: "HAI", model: "65A21-1", deviceJoinName: "Leviton Wireless Load Control Module-30amp"
|
fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "000A", manufacturer: "HAI", model: "65A21-1", deviceJoinName: "Leviton Wireless Load Control Module-30amp"
|
||||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15A", deviceJoinName: "Leviton Lumina RF Plug-In Appliance Module"
|
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15A", deviceJoinName: "Leviton Lumina RF Plug-In Appliance Module"
|
||||||
|
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15S", deviceJoinName: "Leviton Lumina RF Switch"
|
||||||
}
|
}
|
||||||
|
|
||||||
// simulator metadata
|
// simulator metadata
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ definition(
|
|||||||
|
|
||||||
//Device Inputs
|
//Device Inputs
|
||||||
preferences {
|
preferences {
|
||||||
section("Allow <PLACEHOLDER: Your App Name> to control these things...") {
|
section("Allow OpenT2T to control these things...") {
|
||||||
input "contactSensors", "capability.contactSensor", title: "Which Contact Sensors", multiple: true, required: false
|
input "contactSensors", "capability.contactSensor", title: "Which Contact Sensors", multiple: true, required: false
|
||||||
input "garageDoors", "capability.garageDoorControl", title: "Which Garage Doors?", multiple: true, required: false
|
input "garageDoors", "capability.garageDoorControl", title: "Which Garage Doors?", multiple: true, required: false
|
||||||
input "locks", "capability.lock", title: "Which Locks?", multiple: true, required: false
|
input "locks", "capability.lock", title: "Which Locks?", multiple: true, required: false
|
||||||
@@ -329,34 +329,38 @@ private getDeviceType(device) {
|
|||||||
switch (it.name.toLowerCase()) {
|
switch (it.name.toLowerCase()) {
|
||||||
case "switch":
|
case "switch":
|
||||||
deviceType = "switch"
|
deviceType = "switch"
|
||||||
break
|
if (caps.any { it.name.toLowerCase() == "power meter" }) {
|
||||||
case "switch level":
|
return deviceType
|
||||||
deviceType = "light"
|
}
|
||||||
|
if (caps.any { it.name.toLowerCase() == "switch level" }) {
|
||||||
|
deviceType = "light"
|
||||||
|
return deviceType
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case "contact sensor":
|
case "contact sensor":
|
||||||
deviceType = "contactSensor"
|
deviceType = "contactSensor"
|
||||||
break
|
return deviceType
|
||||||
case "garageDoorControl":
|
case "garageDoorControl":
|
||||||
deviceType = "garageDoor"
|
deviceType = "garageDoor"
|
||||||
break
|
return deviceType
|
||||||
case "lock":
|
case "lock":
|
||||||
deviceType = "lock"
|
deviceType = "lock"
|
||||||
break
|
return deviceType
|
||||||
case "video camera":
|
case "video camera":
|
||||||
deviceType = "camera"
|
deviceType = "camera"
|
||||||
break
|
return deviceType
|
||||||
case "motion sensor":
|
case "motion sensor":
|
||||||
deviceType = "motionSensor"
|
deviceType = "motionSensor"
|
||||||
break
|
return deviceType
|
||||||
case "presence sensor":
|
case "presence sensor":
|
||||||
deviceType = "presenceSensor"
|
deviceType = "presenceSensor"
|
||||||
break
|
return deviceType
|
||||||
case "thermostat":
|
case "thermostat":
|
||||||
deviceType = "thermostat"
|
deviceType = "thermostat"
|
||||||
break
|
return deviceType
|
||||||
case "water sensor":
|
case "water sensor":
|
||||||
deviceType = "waterSensor"
|
deviceType = "waterSensor"
|
||||||
break
|
return deviceType
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user