Modifying 'Ventilation Guru'

This commit is contained in:
Tom Lawson
2016-11-23 13:35:39 -08:00
parent 7f4e46f9a7
commit 8ac2c8fda2

View File

@@ -46,7 +46,7 @@ def mainPage() {
state.debugMode = false state.debugMode = false
dynamicPage(name: "mainPage", install: true, uninstall: true) { dynamicPage(name: "mainPage", install: true, uninstall: true) {
section("Inside Sensors") { section("Miscellaneous Inside Sensors") {
input "myTempSensor", "capability.temperatureMeasurement", required: true, title: "Temperature Sensor" input "myTempSensor", "capability.temperatureMeasurement", required: true, title: "Temperature Sensor"
input "myHumiditySensor", "capability.relativeHumidityMeasurement", required: false, title: "Humidity Sensor" input "myHumiditySensor", "capability.relativeHumidityMeasurement", required: false, title: "Humidity Sensor"
input "mySmokeDetectors", "capability.smokeDetector", required: false, multiple: true, title: "Smoke Detectors" input "mySmokeDetectors", "capability.smokeDetector", required: false, multiple: true, title: "Smoke Detectors"
@@ -87,17 +87,20 @@ def mainPage() {
section("Ventilation Fans") { section("Ventilation Fans") {
input "myWholeHouseFans", "capability.switch", required: false, multiple: true, title: "Whole House Fans", submitOnChange: true input "myWholeHouseFans", "capability.switch", required: false, multiple: true, title: "Whole House Fans", submitOnChange: true
input "myAtticFans", "capability.switch", required: false, multiple: true, title: "Attic Fans" input "myAtticFans", "capability.switch", required: false, multiple: true, title: "Attic Fans"
input "myGarageFans", "capability.switch", required: false, multiple: true, title: "Garage Fans" input "myGarageFans", "capability.switch", required: false, multiple: true, title: "Garage Fans", submitOnChange: true
if (myGarageFans) {
input "myGarageTempSensor", "capability.temperatureMeasurement", required: false, title: "Garage Temperature Sensor (optional)"
}
input "myBasementFans", "capability.switch", required: false, multiple: true, title: "Basement/Crawlspace Fans" input "myBasementFans", "capability.switch", required: false, multiple: true, title: "Basement/Crawlspace Fans"
} }
section("Windows/Skylights") { section("Windows/Skylights") {
input "myWindowsSwitch", "capability.switch", required: false, multiple: true, title: "Motorized Windows/Skylights", submitOnChange: true input "myWindowsSwitch", "capability.switch", required: false, multiple: true, title: "Motorized Windows/Skylights", submitOnChange: true
input "myContactSensors", "capability.contactSensor", required: false, multiple: true, title: "Window Contact Sensors" input "myContactSensors", "capability.contactSensor", required: false, multiple: true, title: "Window Contact Sensors", submitOnChange: true
input "myCoverings", "capability.windowShade", required: false, multiple: true, title: "Window Coverings" input "myCoverings", "capability.windowShade", required: false, multiple: true, title: "Window Coverings"
} }
if (myWholeHouseFans || myWindowsSwitch) { if (myWholeHouseFans || myWindowsSwitch) {
section("Whole House Fan and Window/Skylight Operation") { section("Whole House Fan and Window/Skylight Operation") {
if (myWholeHouseFans && myWindowsSwitch) { if (myWholeHouseFans && (myWindowsSwitch || myContactSensors)) {
input "myWindowsNeeded", "number", title: "Number of Open Windows Needed for Whole House Fan (default is 1)", required: false input "myWindowsNeeded", "number", title: "Number of Open Windows Needed for Whole House Fan (default is 1)", required: false
} }
input "myModes", "mode", title: "Whole House Fan/Window Operating Modes (default is All)", multiple: true, required: false input "myModes", "mode", title: "Whole House Fan/Window Operating Modes (default is All)", multiple: true, required: false
@@ -114,7 +117,7 @@ def mainPage() {
image: "https://raw.githubusercontent.com/lawsonautomation/icons/master/info.png", image: "https://raw.githubusercontent.com/lawsonautomation/icons/master/info.png",
page: "UsersGuide") page: "UsersGuide")
} }
section("Version 1.2.1 - Copyright © 2016 Thomas Lawson. " + section("Version 1.2.2 - Copyright © 2016 Thomas Lawson. " +
"If you like this app and would like to contribute to its development (and the development of similar apps), " + "If you like this app and would like to contribute to its development (and the development of similar apps), " +
"tap the link below to make a donation.") { "tap the link below to make a donation.") {
href(name: "LawsonAutomation", href(name: "LawsonAutomation",
@@ -903,9 +906,10 @@ def makeComparisons() {
turnOffWHFsAndWindows() turnOffWHFsAndWindows()
turnOffFans() turnOffFans()
} else if (smokeDetected()) { } else if (smokeDetected()) {
// turn off all fans if there's smoke // turn off all fans and thermostats if there's smoke
sendNotificationEvent("Ventilation Guru Warning: Smoke Detected!") sendNotificationEvent("Ventilation Guru Warning: Smoke Detected!")
turnOffFans() turnOffFans()
turnOff(myThermostats, "thermostats", "Thermostats")
} else { } else {
checkWholeHouseFansAndWindows() checkWholeHouseFansAndWindows()
checkAtticFans() checkAtticFans()
@@ -967,7 +971,16 @@ def checkAtticFans() {
} }
def checkGarageFans() { def checkGarageFans() {
if (myGarageFans) { if (myGarageFans) {
if (myGarageTempSensor) {
// turn on garage fan if cooling mode and outside is cooler than inside
def garageTemp = myGarageTempSensor.temperature
if (state.skew < -1 && garageTemp < state.outsideTemp) {
turnOn(myGarageFans, "garageFans", "Garage Fans")
} else {
turnOff(myGarageFans, "garageFans", "Garage Fans")
}
} else {
// turn on the garage fan if cooling is needed and night time, it's cool outside, or outside temp is dropping fast // turn on the garage fan if cooling is needed and night time, it's cool outside, or outside temp is dropping fast
if (state.skew < 0 && state.insideTemp > state.meanRange + state.skew) { if (state.skew < 0 && state.insideTemp > state.meanRange + state.skew) {
if (!state.daytime || state.outsideTemp < state.meanRange) { if (!state.daytime || state.outsideTemp < state.meanRange) {
@@ -985,16 +998,17 @@ def checkGarageFans() {
turnOff(myGarageFans, "garageFans", "Garage Fans") turnOff(myGarageFans, "garageFans", "Garage Fans")
} }
} }
}
} }
def checkBasementFans() { def checkBasementFans() {
if (myBasementFans) { if (myBasementFans) {
if (state.skew > 0 && state.outsideTemp >= state.insideTemp && state.insideTemp < state.meanRange + state.skew) { if (state.skew > 0 && state.outsideTemp >= state.insideTemp && state.insideTemp < state.meanRange + state.skew) {
turnOn(myBasementFans, "basementFans", "Basement Fans") turnOn(myBasementFans, "basementFans", "Basement Fans")
} else { } else {
turnOff(myBasementFans, "basementFans", "Basement Fans") turnOff(myBasementFans, "basementFans", "Basement Fans")
} }
} }
} }