mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-26 21:04:08 +00:00
Compare commits
8 Commits
MSA-1801-1
...
MSA-1807-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ce6b55edb | ||
|
|
a192b75e4c | ||
|
|
f97a0a4072 | ||
|
|
dd0aba3dc9 | ||
|
|
e787afd165 | ||
|
|
12be259779 | ||
|
|
9cb0ce716b | ||
|
|
1674dc7339 |
68
devicetypes/danlwelch/zooz-4-in-1.src/zooz-4-in-1.groovy
Normal file
68
devicetypes/danlwelch/zooz-4-in-1.src/zooz-4-in-1.groovy
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/**
|
||||||
|
* Zooz 4-in-1
|
||||||
|
*
|
||||||
|
* Copyright 2017 Dan Welch
|
||||||
|
*
|
||||||
|
* 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: "Zooz 4-in-1", namespace: "Danlwelch", author: "Dan Welch") {
|
||||||
|
capability "Illuminance Measurement"
|
||||||
|
capability "Light"
|
||||||
|
capability "Light"
|
||||||
|
capability "Motion Sensor"
|
||||||
|
capability "Temperature Measurement"
|
||||||
|
|
||||||
|
attribute "Humidity", "string"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
simulator {
|
||||||
|
// TODO: define status and reply messages here
|
||||||
|
}
|
||||||
|
|
||||||
|
tiles {
|
||||||
|
// TODO: define your main and details tiles here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// parse events into attributes
|
||||||
|
def parse(String description) {
|
||||||
|
log.debug "Parsing '${description}'"
|
||||||
|
// TODO: handle 'illuminance' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'motion' attribute
|
||||||
|
// TODO: handle 'temperature' attribute
|
||||||
|
// TODO: handle 'Humidity' attribute
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// handle commands
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
@@ -1,71 +1,71 @@
|
|||||||
/**
|
/**
|
||||||
* Simulated Alarm
|
* Simulated Alarm
|
||||||
*
|
*
|
||||||
* Copyright 2014 SmartThings
|
* Copyright 2014 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:
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* 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
|
* 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
|
* 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.
|
* for the specific language governing permissions and limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Simulated Alarm", namespace: "smartthings/testing", author: "SmartThings") {
|
definition (name: "Simulated Alarm", namespace: "smartthings/testing", author: "SmartThings") {
|
||||||
capability "Alarm"
|
capability "Alarm"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator {
|
simulator {
|
||||||
// reply messages
|
// reply messages
|
||||||
["strobe","siren","both","off"].each {
|
["strobe","siren","both","off"].each {
|
||||||
reply "$it": "alarm:$it"
|
reply "$it": "alarm:$it"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tiles {
|
tiles {
|
||||||
standardTile("alarm", "device.alarm", width: 2, height: 2) {
|
standardTile("alarm", "device.alarm", width: 2, height: 2) {
|
||||||
state "off", label:'off', action:'alarm.both', icon:"st.alarm.alarm.alarm", backgroundColor:"#ffffff"
|
state "off", label:'off', action:'alarm.both', icon:"st.alarm.alarm.alarm", backgroundColor:"#ffffff"
|
||||||
state "strobe", label:'strobe!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
|
state "strobe", label:'strobe!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
|
||||||
state "siren", label:'siren!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
|
state "siren", label:'siren!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
|
||||||
state "both", label:'alarm!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
|
state "both", label:'alarm!', action:'alarm.off', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
|
||||||
}
|
}
|
||||||
standardTile("strobe", "device.alarm", inactiveLabel: false, decoration: "flat") {
|
standardTile("strobe", "device.alarm", inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'', action:"alarm.strobe", icon:"st.secondary.strobe", backgroundColor:"#cccccc"
|
state "default", label:'', action:"alarm.strobe", icon:"st.secondary.strobe", backgroundColor:"#cccccc"
|
||||||
}
|
}
|
||||||
standardTile("siren", "device.alarm", inactiveLabel: false, decoration: "flat") {
|
standardTile("siren", "device.alarm", inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'', action:"alarm.siren", icon:"st.secondary.siren", backgroundColor:"#cccccc"
|
state "default", label:'', action:"alarm.siren", icon:"st.secondary.siren", backgroundColor:"#cccccc"
|
||||||
}
|
}
|
||||||
standardTile("off", "device.alarm", inactiveLabel: false, decoration: "flat") {
|
standardTile("off", "device.alarm", inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:'', action:"alarm.off", icon:"st.secondary.off"
|
state "default", label:'', action:"alarm.off", icon:"st.secondary.off"
|
||||||
}
|
}
|
||||||
main "alarm"
|
main "alarm"
|
||||||
details(["alarm","strobe","siren","test","off"])
|
details(["alarm","strobe","siren","test","off"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def strobe() {
|
def strobe() {
|
||||||
sendEvent(name: "alarm", value: "strobe")
|
sendEvent(name: "alarm", value: "strobe")
|
||||||
}
|
}
|
||||||
|
|
||||||
def siren() {
|
def siren() {
|
||||||
sendEvent(name: "alarm", value: "siren")
|
sendEvent(name: "alarm", value: "siren")
|
||||||
}
|
}
|
||||||
|
|
||||||
def both() {
|
def both() {
|
||||||
sendEvent(name: "alarm", value: "both")
|
sendEvent(name: "alarm", value: "both")
|
||||||
}
|
}
|
||||||
|
|
||||||
def off() {
|
def off() {
|
||||||
sendEvent(name: "alarm", value: "off")
|
sendEvent(name: "alarm", value: "off")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse incoming device messages to generate events
|
// Parse incoming device messages to generate events
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def pair = description.split(":")
|
def pair = description.split(":")
|
||||||
createEvent(name: pair[0].trim(), value: pair[1].trim())
|
createEvent(name: pair[0].trim(), value: pair[1].trim())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,14 @@ def refresh() {
|
|||||||
zigbee.onOffRefresh() + zigbee.levelRefresh()
|
zigbee.onOffRefresh() + zigbee.levelRefresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
if (((device.getDataValue("manufacturer") == "MRVL") && (device.getDataValue("model") == "MZ100")) || (device.getDataValue("manufacturer") == "OSRAM SYLVANIA") || (device.getDataValue("manufacturer") == "OSRAM")) {
|
||||||
|
if ((device.currentState("level")?.value == null) || (device.currentState("level")?.value == 0)) {
|
||||||
|
sendEvent(name: "level", value: 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def configure() {
|
def configure() {
|
||||||
log.debug "Configuring Reporting and Bindings."
|
log.debug "Configuring Reporting and Bindings."
|
||||||
// Device-Watch allows 2 check-in misses from device + ping (plus 1 min lag time)
|
// Device-Watch allows 2 check-in misses from device + ping (plus 1 min lag time)
|
||||||
|
|||||||
103
smartapps/curb-v2/curb-control.src/curb-control.groovy
Normal file
103
smartapps/curb-v2/curb-control.src/curb-control.groovy
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
/**
|
||||||
|
* Curb Control
|
||||||
|
*
|
||||||
|
* Copyright 2016 Savanni D'Gerinel
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
definition(
|
||||||
|
name: "Curb Control",
|
||||||
|
namespace: "curb-v2",
|
||||||
|
author: "Savanni D'Gerinel",
|
||||||
|
description: "Control point for Curb/SmartThings integration",
|
||||||
|
category: "Green Living",
|
||||||
|
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
|
||||||
|
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
||||||
|
iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
||||||
|
oauth: true)
|
||||||
|
|
||||||
|
|
||||||
|
preferences {
|
||||||
|
section("Allow Endpoint to Control These Things...") {
|
||||||
|
input "switches", "capability.switch", title: "Which Switches?", multiple: true, required: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mappings {
|
||||||
|
|
||||||
|
path("/switches") {
|
||||||
|
action: [
|
||||||
|
GET: "listSwitches"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
path("/switches/:id") {
|
||||||
|
action: [
|
||||||
|
GET: "showSwitch"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
path("/switches/:id/:command") {
|
||||||
|
action: [
|
||||||
|
PUT: "updateSwitch"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def installed() {}
|
||||||
|
|
||||||
|
def updated() {}
|
||||||
|
|
||||||
|
|
||||||
|
//switches
|
||||||
|
def listSwitches() {
|
||||||
|
switches.collect{device(it,"switch")}
|
||||||
|
}
|
||||||
|
|
||||||
|
def showSwitch() {
|
||||||
|
show(switches, "switch")
|
||||||
|
}
|
||||||
|
void updateSwitch() {
|
||||||
|
update(switches)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def deviceHandler(evt) {}
|
||||||
|
|
||||||
|
private void update(devices) {
|
||||||
|
log.debug "update, request: params: ${params}, devices: $devices.id"
|
||||||
|
|
||||||
|
|
||||||
|
//def command = request.JSON?.command
|
||||||
|
def command = params.command
|
||||||
|
//let's create a toggle option here
|
||||||
|
if (command)
|
||||||
|
{
|
||||||
|
def device = devices.find { it.id == params.id }
|
||||||
|
if (!device) {
|
||||||
|
httpError(404, "Device not found")
|
||||||
|
} else {
|
||||||
|
if(command == "toggle")
|
||||||
|
{
|
||||||
|
if(device.currentValue('switch') == "on")
|
||||||
|
device.off();
|
||||||
|
else
|
||||||
|
device.on();;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private show(devices, type) {
|
||||||
|
def device = devices.find { it.id == params.id }
|
||||||
|
if (!device) {
|
||||||
|
httpError(404, "Device not found")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
def attributeName = type == "motionSensor" ? "motion" : type
|
||||||
|
def s = device.currentState(attributeName)
|
||||||
|
[id: device.id, label: device.displayName, value: s?.value, unitTime: s?.date?.time, type: type]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private device(it, type) {
|
||||||
|
it ? [id: it.id, label: it.label, type: type] : null
|
||||||
|
}
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
/**
|
|
||||||
* jefferson
|
|
||||||
*
|
|
||||||
* Copyright 2017 Jaeguk Yun
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
definition(
|
|
||||||
name: "jefferson",
|
|
||||||
namespace: "jefferson",
|
|
||||||
author: "Jaeguk Yun",
|
|
||||||
description: "Jaeguk Yun",
|
|
||||||
category: "Green Living",
|
|
||||||
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
|
|
||||||
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
|
||||||
iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
|
||||||
oauth: true)
|
|
||||||
|
|
||||||
|
|
||||||
preferences {
|
|
||||||
section("Title") {
|
|
||||||
// TODO: put inputs here
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def installed() {
|
|
||||||
log.debug "Installed with settings: ${settings}"
|
|
||||||
|
|
||||||
initialize()
|
|
||||||
}
|
|
||||||
|
|
||||||
def updated() {
|
|
||||||
log.debug "Updated with settings: ${settings}"
|
|
||||||
|
|
||||||
unsubscribe()
|
|
||||||
initialize()
|
|
||||||
}
|
|
||||||
|
|
||||||
def initialize() {
|
|
||||||
// TODO: subscribe to attributes, devices, locations, etc.
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: implement event handlers
|
|
||||||
Reference in New Issue
Block a user