Hunter Ford Hunter Ford

Adjusting the Climate upon Leaving and Restoring Previous Settings upon Return

When you're not at home, you generally don't need to have the A/C running at full blast. One simple solution for this is turn down your A/C when you leave, and turn it back up when you return. Using Indigo and a Insteon compatible thermostat, like the one fromĀ Venstar, make this a breeze. My original solution to this worked, but it didn't take into account my overrides of the thermostat. I've added a few variables to Indigo to save the thermostats current state when I leave, and restore it back to that state once I've returned.

For this to work, we're going to need to two triggers (which you may already have setup), and three action groups.

First, we need a trigger to set off the action group to save the settings (you could very well embed the action script into your trigger, but I usually modularize my scripts so that I can perform actions from a remote or from multiple triggers). I have a trigger that is called when I hit the "All Off" button on a KeypadLinc by my front door. I have another trigger that will restore my settings when I return; it is set off by a motion detector by my front door.

You'll need to create a few variables first: climateHeatSetpointPrevious, climateCoolSetpointPrevious, climateHvacModePrevious, climateFanModePrevious, climateHeatSetpointAway, climateCoolSetpointAway, climateHvacModeAway, climateFanModeAway

Now for the action groups:

1. "A/C - Save Current Settings"

if heat setpoint of device "Thermostat" is not value of variable "climateHeatSetpointAway" or cool setpoint of device "Thermostat" is not value of variable "climateCoolSetpointAway" or hvac mode of device "Thermostat" is not value of variable "climateHvacModeAway" or fan mode of device "Thermostat" is not value of variable "climateFanModeAway" then
    set value of variable "climateHeatSetpointPrevious" to heat setpoint of device "Thermostat"
    set value of variable "climateCoolSetpointPrevious" to cool setpoint of device "Thermostat"
    set value of variable "climateHvacModePrevious" to hvac mode of device "Thermostat"
    set value of variable "climateFanModePrevious" to fan mode of device "Thermostat"
end if

*Edit: I added the if statement so that if I hit the 'All Off' button twice by mistake, it wouldn't save my "away" settings as the "previous" settings.

2. "A/C - Set Away Settings"

set heat setpoint of device "Thermostat" to value of variable "climateHeatSetpointAway"
set cool setpoint of device "Thermostat" to value of variable "climateCoolSetpointAway"
set hvac mode of device "Thermostat" to value of variable "climateHvacModeAway"
set fan mode of device "Thermostat" to value of variable "climateFanModeAway"

3. "A/C - Restore Previous Settings"

set heat setpoint of device "Thermostat" to value of variable "climateHeatSetpointPrevious"
set cool setpoint of device "Thermostat" to value of variable "climateCoolSetpointPrevious"
set hvac mode of device "Thermostat" to value of variable "climateHvacModePrevious"
set fan mode of device "Thermostat" to value of variable "climateFanModePrevious"

*Edit: You may have to add some 1 second delays (delay 1) to ensure the signal is received by the thermostat. The Venstar adapter is wireless and therefore more prone to getting error messages like: "send failed (no acknowledgment)".


Comments