Compare commits

...

3 Commits

Author SHA1 Message Date
Zahir Patel
42916fa2d3 MSA-1522: controls one z wave switch via another z wave temp sensor to check for a max temp limit and turns off the switch, useful for heating applications. 2016-10-11 03:01:09 -05:00
dsainteclaire
84323afa04 Merge pull request #1324 from james-smartthings/DVCSMP-2097-add-alterSetpoint-check
alterSetpoint - check for auto or off mode
2016-10-07 10:03:08 -07:00
James Chen
12b09acfa8 alterSetpoint - check for auto or off mode
changed debug message
2016-10-06 16:02:09 -07:00
2 changed files with 54 additions and 49 deletions

View File

@@ -655,6 +655,10 @@ void lowerSetpoint() {
void alterSetpoint(temp) {
def mode = device.currentValue("thermostatMode")
if (mode == "off" || mode == "auto") {
log.warn "this mode: $mode does not allow alterSetpoint"
} else {
def heatingSetpoint = device.currentValue("heatingSetpoint")
def coolingSetpoint = device.currentValue("coolingSetpoint")
def deviceId = device.deviceNetworkId.split(/\./).last()
@@ -704,6 +708,7 @@ void alterSetpoint(temp) {
}
}
generateStatusEvent()
}
}
def generateStatusEvent() {

View File

@@ -12,13 +12,13 @@
*
* It's Too Hot
*
* Author: SmartThings
* Author: SmartThings - zahir
*/
definition(
name: "It's Too Hot",
namespace: "smartthings",
author: "SmartThings",
description: "Monitor the temperature and when it rises above your setting get a notification and/or turn on an A/C unit or fan.",
description: "Monitor the temperature and when it rises above your setting get a notification and/or turn off underfloor heating.",
category: "Convenience",
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/its-too-hot.png",
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/its-too-hot@2x.png"
@@ -37,7 +37,7 @@ preferences {
input "phone1", "phone", title: "Send a Text Message?", required: false
}
}
section("Turn on which A/C or fan...") {
section("Turn off which A/C or fan...") {
input "switch1", "capability.switch", required: false
}
}
@@ -73,9 +73,9 @@ def temperatureHandler(evt) {
// TODO: Send "Temperature back to normal" SMS, turn switch off
} else {
log.debug "Temperature rose above $tooHot: sending SMS and activating $mySwitch"
def tempScale = location.temperatureScale ?: "F"
def tempScale = location.temperatureScale ?: "C"
send("${temperatureSensor1.displayName} is too hot, reporting a temperature of ${evt.value}${evt.unit?:tempScale}")
switch1?.on()
switch1?.off()
}
}
}