Skip to content

Commit

Permalink
v1.7 changed some logic to use setVentSettings && setAdjustmentFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
yracine committed Jul 23, 2015
1 parent ccdba4c commit 363a07e
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions smartapps/ScheduleTstatZones.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def generalSetupPage() {
dynamicPage(name: "generalSetupPage", uninstall: true, nextPage: roomsSetupPage) {
section("About") {
paragraph "ScheduleTstatZones, the smartapp that enables Heating/Cooling zoned settings at selected thermostat(s) coupled with z-wave vents (optional) for better temp settings control throughout your home"
paragraph "Version 1.6\n\n" +
paragraph "Version 1.7\n\n" +
"If you like this app, please support the developer via PayPal:\n\n[email protected]\n\n" +
"Copyright©2015 Yves Racine"
href url: "http://github.com/yracine", style: "embedded", required: false, title: "More information...",
Expand Down Expand Up @@ -74,6 +74,10 @@ def generalSetupPage() {
input (name:"setVentSettingsFlag", title: "Set Vent Settings?", type:"Boolean",
description:"optional", metadata: [values: ["true", "false"]],required:false)
}
section("Enable fan/temp adjustment based on indoor/outdoor temp sensors [optional, default=false]") {
input (name:"setAdjustmentFlag", title: "Enable fan/temp adjustment based on sensors?", type:"Boolean",
description:"optional", metadata: [values: ["true", "false"]],required:false)
}
section("What do I use for the Master on/off switch to enable/disable processing? [optional]") {
input (name:"powerSwitch", type:"capability.switch", required: false)
}
Expand Down Expand Up @@ -505,6 +509,7 @@ def setZoneSettings() {
def ventSwitchesOn = []

def setVentSettings = (setVentSettingsFlag) ?: 'false'
def adjustmentFlag = (setAdjustmentFlag)?: 'false'

for (int i = 1;((i <= settings.schedulesCount) && (i <= 12)); i++) {

Expand Down Expand Up @@ -568,8 +573,11 @@ def setZoneSettings() {
def ventSwitchesZoneSet= control_vent_switches_in_zone(i)
log.debug "setZoneSettings>schedule ${scheduleName},list of Vents turned 'on'= ${ventSwitchesZoneSet}"
// adjust the temperature at the thermostat(s) based on temp sensor if any
adjust_thermostat_setpoint_in_zone(i)
set_fan_mode(i)

if (adjustmentFlag == 'true') {
adjust_thermostat_setpoint_in_zone(i)
set_fan_mode(i)
}
ventSwitchesOn = ventSwitchesOn + ventSwitchesZoneSet
state.lastScheduleName = scheduleName
state.lastStartTime = startTimeToday.time
Expand Down Expand Up @@ -602,13 +610,15 @@ def setZoneSettings() {
}
if (isResidentPresent) {

// adjust the temperature at the thermostat(s) based on temp sensor if any
adjust_thermostat_setpoint_in_zone(i)
if (adjustmentFlag =='true') {
// adjust the temperature at the thermostat(s) based on temp sensor if any
adjust_thermostat_setpoint_in_zone(i)

// let's adjust the thermostat's temp & mode settings according to outdoor temperature
adjust_tstat_for_more_less_heat_cool(i)
// will override the fan settings if required (ex. more Fan Threshold is set)
set_fan_mode(i)
// let's adjust the thermostat's temp & mode settings according to outdoor temperature
adjust_tstat_for_more_less_heat_cool(i)
// will override the fan settings if required (ex. more Fan Threshold is set)
set_fan_mode(i)
}

}
// let's adjust the vent settings according to desired Temp
Expand Down Expand Up @@ -937,6 +947,12 @@ private def set_fan_mode(indiceSchedule) {
}
}

def currentFanMode=thermostat.currentThermostatFanMode()
if ((fanMode == currentFanMode) || ((fanMode=='off') && (currentFanMode=='auto'))) {
log.debug("set_fan_mode>schedule ${scheduleName},fan already in $fanMode at thermostat ${thermostat}, exiting...")
return
}

try {
thermostat?.setThermostatFanMode(fanMode)
if (detailedNotif == 'true') {
Expand Down

0 comments on commit 363a07e

Please sign in to comment.