mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-26 13:24:09 +00:00
Compare commits
8 Commits
MSA-1774-1
...
MSA-1779-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a29df7693 | ||
|
|
2c4a177630 | ||
|
|
2d82b05f90 | ||
|
|
1611fd0144 | ||
|
|
c416c39ac4 | ||
|
|
bc0f849dad | ||
|
|
f164b8832c | ||
|
|
2d3fa22e07 |
@@ -23,6 +23,7 @@ metadata {
|
|||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Light"
|
||||||
|
|
||||||
fingerprint profileId: "C05E", inClusters: "0000,0003,0004,0005,0006,0008,1000", outClusters: "0000,0019"
|
fingerprint profileId: "C05E", inClusters: "0000,0003,0004,0005,0006,0008,1000", outClusters: "0000,0019"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ metadata {
|
|||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Light"
|
||||||
|
|
||||||
fingerprint mfr:"0063", prod:"4457", deviceJoinName: "GE In-Wall Smart Dimmer "
|
fingerprint mfr:"0063", prod:"4457", deviceJoinName: "GE In-Wall Smart Dimmer "
|
||||||
fingerprint mfr:"0063", prod:"4944", deviceJoinName: "GE In-Wall Smart Dimmer "
|
fingerprint mfr:"0063", prod:"4944", deviceJoinName: "GE In-Wall Smart Dimmer "
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ metadata {
|
|||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Light"
|
||||||
|
capability "Outlet"
|
||||||
|
|
||||||
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0B04,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3200", deviceJoinName: "Outlet"
|
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0B04,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3200", deviceJoinName: "Outlet"
|
||||||
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0B04,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3200-Sgb", deviceJoinName: "Outlet"
|
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0B04,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3200-Sgb", deviceJoinName: "Outlet"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ metadata {
|
|||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Light"
|
||||||
|
|
||||||
|
|
||||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008"
|
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ metadata {
|
|||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Light"
|
||||||
|
|
||||||
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0008,0300,0B04,FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "Gardenspot RGB", deviceJoinName: "SYLVANIA Smart Gardenspot mini RGB"
|
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0008,0300,0B04,FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "Gardenspot RGB", deviceJoinName: "SYLVANIA Smart Gardenspot mini RGB"
|
||||||
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0008,0300,0B04,FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "LIGHTIFY Gardenspot RGB", deviceJoinName: "SYLVANIA Smart Gardenspot mini RGB"
|
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0008,0300,0B04,FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "LIGHTIFY Gardenspot RGB", deviceJoinName: "SYLVANIA Smart Gardenspot mini RGB"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ metadata {
|
|||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Light"
|
||||||
|
|
||||||
attribute "colorName", "string"
|
attribute "colorName", "string"
|
||||||
command "setGenericName"
|
command "setGenericName"
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ metadata {
|
|||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
|
capability "Light"
|
||||||
|
|
||||||
attribute "colorName", "string"
|
attribute "colorName", "string"
|
||||||
command "setGenericName"
|
command "setGenericName"
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
definition(
|
||||||
|
name: "Shut the windows!",
|
||||||
|
namespace: "nick257",
|
||||||
|
author: "Nick Mahon",
|
||||||
|
description: "Notifies when last person leaves without closing doors or windows.",
|
||||||
|
category: "Safety & Security",
|
||||||
|
iconUrl: "https://s3.amazonaws.com/smartapp-icons/ModeMagic/bon-voyage.png",
|
||||||
|
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/ModeMagic/bon-voyage%402x.png"
|
||||||
|
)
|
||||||
|
|
||||||
|
preferences
|
||||||
|
{
|
||||||
|
section("As the last of these persons leaves") {
|
||||||
|
input "people", "capability.presenceSensor", multiple: true
|
||||||
|
}
|
||||||
|
section("Check that these are closed") {
|
||||||
|
input "doors", "capability.contactSensor", multiple: true
|
||||||
|
}
|
||||||
|
section("Send Push Notification?") {
|
||||||
|
input "sendPush", "bool", required: false,
|
||||||
|
title: "Send Push Notification when Opened?"
|
||||||
|
}
|
||||||
|
section("Send a text message to this number (optional)") {
|
||||||
|
input "phone", "phone", required: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
log.debug "Installed with settings: ${settings}"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "Updated with settings: ${settings}"
|
||||||
|
unsubscribe()
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def initialize() {
|
||||||
|
subscribe(people, "presence", presence)
|
||||||
|
}
|
||||||
|
|
||||||
|
def presence(evt)
|
||||||
|
{
|
||||||
|
log.debug "evt.name: $evt.value, $evt.deviceId"
|
||||||
|
if (evt.value == "not present") {
|
||||||
|
log.debug "isSomeonePresent()? ${isSomeonePresent()}"
|
||||||
|
log.debug "isDoorsOpen()? ${isDoorsOpen()}"
|
||||||
|
if (!isSomeonePresent() && isDoorsOpen()) {
|
||||||
|
def device = people.find { it.id == evt.deviceId }
|
||||||
|
log.debug "${device.displayName} left ${location.name} without closing ${isDoorsOpen().join(", ")}"
|
||||||
|
|
||||||
|
def message = "${device.displayName} left ${location.name} without closing ${isDoorsOpen().join(", ")}"
|
||||||
|
if (sendPush) {
|
||||||
|
sendPush(message)
|
||||||
|
}
|
||||||
|
if (phone) {
|
||||||
|
sendSms(phone, message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def isSomeonePresent() {
|
||||||
|
log.debug "presence: $people.currentPresence"
|
||||||
|
people.findAll{it.currentPresence == "present"}
|
||||||
|
}
|
||||||
|
|
||||||
|
def isDoorsOpen() {
|
||||||
|
log.debug "doorss: $doors.currentContact"
|
||||||
|
doors.findAll{it.currentContact == "open"}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user