mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-09 13:21:53 +00:00
Compare commits
12 Commits
PROD_2017.
...
MSA-1786-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
827f92179d | ||
|
|
51832c8db2 | ||
|
|
f001eb0792 | ||
|
|
7c5734b752 | ||
|
|
2a3c393534 | ||
|
|
91763e7b4d | ||
|
|
1263b72a72 | ||
|
|
bf45430061 | ||
|
|
054ccbeffe | ||
|
|
6e28d83e96 | ||
|
|
2d82b05f90 | ||
|
|
61356ec8a7 |
@@ -14,6 +14,7 @@ metadata {
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
capability "Health Check"
|
||||
capability "Light"
|
||||
}
|
||||
|
||||
simulator {
|
||||
|
||||
@@ -13,6 +13,7 @@ metadata {
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
capability "Health Check"
|
||||
capability "Light"
|
||||
}
|
||||
|
||||
simulator {
|
||||
|
||||
@@ -36,6 +36,7 @@ metadata {
|
||||
capability "Switch"
|
||||
capability "Refresh"
|
||||
capability "Contact Sensor"
|
||||
capability "Light"
|
||||
|
||||
attribute "powered", "string"
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ Works with:
|
||||
* **Switch** - can detect state (possible values: on/off)
|
||||
* **Switch Level** - represents current light level, usually 0-100 in percent
|
||||
* **Health Check** - indicates ability to get device health notifications
|
||||
* **Light** - indicates that the device belongs to Light category.
|
||||
|
||||
## Device Health
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ metadata {
|
||||
capability "Switch"
|
||||
capability "Switch Level"
|
||||
capability "Health Check"
|
||||
capability "Light"
|
||||
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B04"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0702"
|
||||
|
||||
@@ -21,6 +21,7 @@ metadata {
|
||||
capability "Sensor"
|
||||
capability "Switch"
|
||||
capability "Health Check"
|
||||
capability "Light"
|
||||
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0B04"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0702"
|
||||
|
||||
@@ -6,6 +6,12 @@ Works with:
|
||||
|
||||
* [Leviton Plug-in Lamp Dimmer Module (DZPD3-1LW)](https://www.smartthings.com/works-with-smartthings/outlets/leviton-plug-in-lamp-dimmer-module)
|
||||
* [Leviton Universal Dimmer (DZMX1-LZ)](https://www.smartthings.com/works-with-smartthings/switches-and-dimmers/leviton-universal-dimmer)
|
||||
* [Leviton 1000W Incandescent Dimmer](https://www.smartthings.com/works-with-smartthings/leviton/leviton-1000w-incandescent-dimmer)
|
||||
* [Leviton 600W Incandescent Dimmer](https://www.smartthings.com/works-with-smartthings/leviton/leviton-600w-incandescent-dimmer)
|
||||
* [Enerwave In-Wall Dimmer](https://www.smartthings.com/works-with-smartthings/enerwave/enerwave-in-wall-dimmer-zw500d)
|
||||
* [Leviton 3-Speed Fan Controller](https://www.smartthings.com/works-with-smartthings/leviton/leviton-3-speed-fan-controller)
|
||||
* [Leviton Magnetic Low Voltage Dimmer](https://www.smartthings.com/works-with-smartthings/leviton/leviton-magnetic-low-voltage-dimmer)
|
||||
* [Remotec Technology Plug-In Dimmer](https://www.smartthings.com/works-with-smartthings/remotec-technology/remotec-technology-plug-in-dimmer)
|
||||
|
||||
## Table of contents
|
||||
|
||||
@@ -40,4 +46,9 @@ If the device doesn't pair when trying from the SmartThings mobile app, it is po
|
||||
Pairing needs to be tried again by placing the device closer to the hub.
|
||||
Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link:
|
||||
* [Leviton Plug-in Lamp Dimmer Module (DZPD3-1LW) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/206171053-How-to-connect-Leviton-Z-Wave-devices)
|
||||
* [Leviton Universal Dimmer (DZMX1-LZ) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/206171053-How-to-connect-Leviton-Z-Wave-devices)
|
||||
* [Leviton Universal Dimmer (DZMX1-LZ) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/206171053-How-to-connect-Leviton-Z-Wave-devices)
|
||||
* [Leviton 1000W Incandescent Dimmer Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/206171053-How-to-connect-Leviton-Z-Wave-devices)
|
||||
* [Leviton 600W Incandescent Dimmer Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/206171053-How-to-connect-Leviton-Z-Wave-devices)
|
||||
* [Leviton 3-Speed Fan Controller Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/206171053-How-to-connect-Leviton-Z-Wave-devices)
|
||||
* [Enerwave In-Wall Dimmer Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/204854176-How-to-connect-Enerwave-switches-and-dimmers)
|
||||
* [Remotec Technology Plug-In Dimmer Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/202295150-Remotec-Technology-Plug-In-Dimmer-ZDS-100-)
|
||||
@@ -20,6 +20,7 @@ metadata {
|
||||
capability "Polling"
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
capability "Light"
|
||||
|
||||
fingerprint inClusters: "0x26", deviceJoinName: "Z-Wave Dimmer"
|
||||
fingerprint mfr:"001D", prod:"1902", deviceJoinName: "Z-Wave Dimmer"
|
||||
@@ -28,6 +29,8 @@ metadata {
|
||||
fingerprint mfr:"001D", prod:"1001", model:"0334", deviceJoinName: "Leviton 3-Speed Fan Controller"
|
||||
fingerprint mfr:"001D", prod:"0602", model:"0334", deviceJoinName: "Leviton Magnetic Low Voltage Dimmer"
|
||||
fingerprint mfr:"001D", prod:"0401", model:"0334", deviceJoinName: "Leviton 600W Incandescent Dimmer"
|
||||
fingerprint mfr:"0111", prod:"8200", model:"0200", deviceJoinName: "Remotec Technology Plug-In Dimmer"
|
||||
fingerprint mfr:"1104", prod:"001D", model:"0501", deviceJoinName: "Leviton 1000W Incandescant Dimmer"
|
||||
}
|
||||
|
||||
simulator {
|
||||
|
||||
@@ -25,6 +25,7 @@ metadata {
|
||||
capability "Switch Level"
|
||||
capability "Sensor"
|
||||
capability "Actuator"
|
||||
capability "Light"
|
||||
|
||||
command "reset"
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ metadata {
|
||||
capability "Refresh"
|
||||
capability "Configuration"
|
||||
capability "Sensor"
|
||||
capability "Light"
|
||||
|
||||
command "reset"
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ metadata {
|
||||
capability "Polling"
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
capability "Light"
|
||||
|
||||
fingerprint inClusters: "0x25", deviceJoinName: "Z-Wave Switch"
|
||||
fingerprint mfr:"001D", prod:"1A02", model:"0334", deviceJoinName: "Leviton Appliance Module"
|
||||
@@ -26,6 +27,8 @@ metadata {
|
||||
fingerprint mfr:"001D", prod:"1D04", model:"0334", deviceJoinName: "Leviton Outlet"
|
||||
fingerprint mfr:"001D", prod:"1C02", model:"0334", deviceJoinName: "Leviton Switch"
|
||||
fingerprint mfr:"001D", prod:"0301", model:"0334", deviceJoinName: "Leviton 15A Switch"
|
||||
fingerprint mfr:"001D", prod:"0F01", model:"0334", deviceJoinName: "Leviton 5A Incandescent Switch"
|
||||
fingerprint mfr:"001D", prod:"1603", model:"0334", deviceJoinName: "Leviton 15A Split Duplex Receptacle"
|
||||
fingerprint mfr:"011A", prod:"0101", model:"0102", deviceJoinName: "Enerwave On/Off Switch"
|
||||
fingerprint mfr:"011A", prod:"0101", model:"0603", deviceJoinName: "Enerwave Duplex Receptacle"
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ metadata {
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
capability "Health Check"
|
||||
capability "Light"
|
||||
|
||||
fingerprint mfr:"0063", prod:"4952", deviceJoinName: "Z-Wave Wall Switch"
|
||||
fingerprint mfr:"0063", prod:"5257", deviceJoinName: "Z-Wave Wall Switch"
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* Smart Humidifier
|
||||
*
|
||||
* Copyright 2014 Sheikh Dawood
|
||||
*
|
||||
* 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: "Smart Dehumidifier",
|
||||
namespace: "Sheikhsphere",
|
||||
author: "Sheikh Dawood",
|
||||
description: "Turn on/off dehumidifier based on relative humidity from a sensor.",
|
||||
category: "Convenience",
|
||||
iconUrl: "https://graph.api.smartthings.com/api/devices/icons/st.Weather.weather12-icn",
|
||||
iconX2Url: "https://graph.api.smartthings.com/api/devices/icons/st.Weather.weather12-icn?displaySize=2x",
|
||||
iconX3Url: "https://graph.api.smartthings.com/api/devices/icons/st.Weather.weather12-icn?displaySize=3x",
|
||||
oauth: true)
|
||||
|
||||
|
||||
preferences {
|
||||
section("Monitor the humidity of:") {
|
||||
input "humiditySensor1", "capability.relativeHumidityMeasurement"
|
||||
}
|
||||
section("When the humidity rises above:") {
|
||||
input "humidityHigh", "number", title: "Percentage ?"
|
||||
}
|
||||
section("When the humidity drops below:") {
|
||||
input "humidityLow", "number", title: "Percentage ?"
|
||||
}
|
||||
section("Control Humidifier:") {
|
||||
input "switch1", "capability.switch"
|
||||
}
|
||||
section( "Notifications" ) {
|
||||
input "sendPushMessage", "enum", title: "Send a push notification?", metadata:[values:["Yes","No"]], required:false
|
||||
input "phone1", "phone", title: "Send a Text Message?", required: false
|
||||
}
|
||||
}
|
||||
|
||||
def installed() {
|
||||
subscribe(humiditySensor1, "humidity", humidityHandler)
|
||||
}
|
||||
|
||||
def updated() {
|
||||
unsubscribe()
|
||||
subscribe(humiditySensor1, "humidity", humidityHandler)
|
||||
}
|
||||
|
||||
def humidityHandler(evt) {
|
||||
log.trace "humidity: $evt.value"
|
||||
log.trace "set high point: $humidityHigh"
|
||||
log.trace "set low point: $humidityLow"
|
||||
|
||||
def currentHumidity = Double.parseDouble(evt.value.replace("%", ""))
|
||||
def humidityHigh1 = humidityHigh
|
||||
def humidityLow1 = humidityLow
|
||||
def mySwitch = settings.switch1
|
||||
|
||||
if (currentHumidity >= humidityHigh1) {
|
||||
log.debug "Checking how long the humidity sensor has been reporting >= $humidityHigh1"
|
||||
|
||||
// Don't send a continuous stream of text messages
|
||||
def deltaMinutes = 10
|
||||
def timeAgo = new Date(now() - (1000 * 60 * deltaMinutes).toLong())
|
||||
def recentEvents = humiditySensor1.eventsSince(timeAgo)
|
||||
log.trace "Found ${recentEvents?.size() ?: 0} events in the last $deltaMinutes minutes"
|
||||
def alreadySentSms1 = recentEvents.count { Double.parseDouble(it.value.replace("%", "")) >= humidityHigh1 } > 1
|
||||
|
||||
if (alreadySentSms1) {
|
||||
log.debug "Notification already sent within the last $deltaMinutes minutes"
|
||||
|
||||
} else {
|
||||
if (state.lastStatus != "on") {
|
||||
log.debug "Humidity Rose Above $humidityHigh1: sending SMS and deactivating $mySwitch"
|
||||
send("${humiditySensor1.label} sensed high humidity level of ${evt.value}, turning on ${switch1.label}")
|
||||
switch1?.on()
|
||||
state.lastStatus = "on"
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentHumidity <= humidityLow1) {
|
||||
log.debug "Checking how long the humidity sensor has been reporting <= $humidityLow1"
|
||||
|
||||
// Don't send a continuous stream of text messages
|
||||
def deltaMinutes = 10
|
||||
def timeAgo = new Date(now() - (1000 * 60 * deltaMinutes).toLong())
|
||||
def recentEvents = humiditySensor1.eventsSince(timeAgo)
|
||||
log.trace "Found ${recentEvents?.size() ?: 0} events in the last $deltaMinutes minutes"
|
||||
def alreadySentSms2 = recentEvents.count { Double.parseDouble(it.value.replace("%", "")) <= humidityLow1 } > 1
|
||||
|
||||
if (alreadySentSms2) {
|
||||
log.debug "Notification already sent within the last $deltaMinutes minutes"
|
||||
|
||||
} else {
|
||||
if (state.lastStatus != "off") {
|
||||
log.debug "Humidity Dropped Below $humidityLow1: sending SMS and activating $mySwitch"
|
||||
send("${humiditySensor1.label} sensed low humidity level of ${evt.value}, turning off ${switch1.label}")
|
||||
switch1?.off()
|
||||
state.lastStatus = "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
//log.debug "Humidity remained in threshold: sending SMS to $phone1 and activating $mySwitch"
|
||||
//send("${humiditySensor1.label} sensed humidity level of ${evt.value} is within threshold, keeping off ${switch1.label}")
|
||||
//switch1?.off()
|
||||
}
|
||||
}
|
||||
|
||||
private send(msg) {
|
||||
if ( sendPushMessage != "No" ) {
|
||||
log.debug( "sending push message" )
|
||||
sendPush( msg )
|
||||
}
|
||||
|
||||
if ( phone1 ) {
|
||||
log.debug( "sending text message" )
|
||||
sendSms( phone1, msg )
|
||||
}
|
||||
|
||||
log.debug msg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user