Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| advanced_thermo [2009/10/26 23:00] – jay | advanced_thermo [2026/04/07 18:27] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Advanced Thermostat Adjustment ====== | ||
| + | The [[thermostat|basic thermostat wiki page]] describes a simple way to change your thermostat settings at various times of day. This will help to reduce your energy consumption considerably. However, as you add more control over your home, you may find that the sheer number of time/date actions grows quickly. Consider this: if you want behavior that's different when you're on vacation or when you have the windows open in your house, you now potentially have to add complex conditionals and perhaps many more trigger or time/date events to compensate. Now, add another thermostat to the mix (many houses have 2 HVAC units) and the complexity really goes up. | ||
| + | |||
| + | In this article we'll talk about a script that can be used in conjunction with some variables, triggers, and action groups that makes creating complex thermostat schedules easier. You can even use this technique for controlling other environmental aspects of your house as well. The [[wiki: | ||
| + | |||
| + | Let's start with a scenario that I have in my home. I have two HVAC units: one that controls the master bedroom/ | ||
| + | |||
| + | After thinking a lot about what parts of the house are lived in at various times, I put together a spreadsheet that let me visualize what I thought would be the best set points for my HVAC system to keep the various sides of my house comfortable when occupied: | ||
| + | |||
| + | {{http:// | ||
| + | |||
| + | So, as you can see from the charts above, I have 4 different times of day when I'd like my set points to be changed during the week, and on the weekend during the day I need some different set points since we live in a different part of the house on the weekends during the day. Not shown in these tables are a couple of other scenarios: 1) when I'm on vacation, 2) when I have the windows open, and 3) when we have company. For each of these situations, I want to have a separate set of set points that don't change based on time of day - in other words, they stay the same regardless of time of day or weekend/ | ||
| + | |||
| + | Now, I could do this with a LOT of time/date actions, some variables, some complex conditionals, | ||
| + | |||
| + | So, to summarize my houseMode states, I have: home, vacation, open, and company. Let's take the easiest scenarios first: vacation, company, and open. These scenarios are simple because I only need a single change to the two HVAC system set points and they' | ||
| + | |||
| + | The first thing you need to do is [[https:// | ||
| + | |||
| + | Next, let's create a trigger that fires whenever houseMode changes: | ||
| + | |||
| + | - Make sure '' | ||
| + | - Click on the '' | ||
| + | - Name the trigger something like " | ||
| + | - Set the '' | ||
| + | - Select the '' | ||
| + | - Select the '' | ||
| + | - Skip the '' | ||
| + | - Select '' | ||
| + | - In the text area below the Embedded radio button, paste in the following: | ||
| + | < | ||
| + | processVariable(" | ||
| + | - Click the '' | ||
| + | |||
| + | OK, so now, when the variable you specified changes, the processing method is going to fire. Right now, however, it's not going to do much - the script is going to look at the value of the variable and try and find a variable or action group with the same name (or ID) to execute. If it doesn' | ||
| + | |||
| + | '' | ||
| + | |||
| + | When you see that, you know you need to do something. In this case, we're gonna create an action group called " | ||
| + | |||
| + | - Make sure '' | ||
| + | - Click on the '' | ||
| + | - Name the action group " | ||
| + | - Select '' | ||
| + | - Select '' | ||
| + | - Select one of your thermostats | ||
| + | - Enter the set point value in the '' | ||
| + | - Click the '' | ||
| + | - repeat steps 4-8 for the heat set point, and then set the mode for the thermostat to '' | ||
| + | - if you have more than one thermostat, repeat steps 4-8 for the other thermostat as well | ||
| + | - Click the '' | ||
| + | |||
| + | Now, you have your " | ||
| + | |||
| + | OK, so, now you've taken care of the easy ones - where it just needs to execute once. Now we get to the more interesting houseMode: " | ||
| + | |||
| + | Why is this useful? Because the script is recursive. This means that it calls itself. If the script finds a variable called " | ||
| + | |||
| + | Next, create the " | ||
| + | |||
| + | - In the Variable List window, click on the New... button | ||
| + | - Name the variable " | ||
| + | - Set its value to " | ||
| + | |||
| + | Now, create a trigger that will execute whenever the " | ||
| + | |||
| + | - Make sure '' | ||
| + | - Click on the '' | ||
| + | - Name the trigger something like "home change" | ||
| + | - Set the '' | ||
| + | - Select the '' | ||
| + | - Select the '' | ||
| + | - Select the '' | ||
| + | - Select '' | ||
| + | - Select '' | ||
| + | - Select the '' | ||
| + | - Select '' | ||
| + | - In the text area below the Embedded radio button, paste in the following: | ||
| + | < | ||
| + | processVariable(" | ||
| + | - Click the '' | ||
| + | |||
| + | Now, when houseMode is equal to " | ||
| + | |||
| + | The final thing is to actually change these variables automatically. For houseMode (home, open, company, vacation), you'll probably want to change those manually, although you could certainly create a button on a keypad somewhere that set the value - so, for instance, you could have a button on a KeypadLinc or remote that toggles houseMode between vacation and home. | ||
| + | |||
| + | The more interesting changes are the daily changes to the " | ||
| + | |||
| + | - Make sure '' | ||
| + | - Click on the '' | ||
| + | - Name the trigger something like "set work day" | ||
| + | - Set the '' | ||
| + | - Set the '' | ||
| + | - Skip the '' | ||
| + | - Select '' | ||
| + | - Select '' | ||
| + | - Click on the '' | ||
| + | - Click the '' | ||
| + | |||
| + | Repeat this for the other potential variable values as appropriate. There you go! You now have a pretty manageable way of fine-tuning your thermostat settings based on some pretty complex logic - all without having to write a line of code. What you have done is create a logic tree. We can represent the tree like this: | ||
| + | |||
| + | < | ||
| + | houseMode | ||
| + | | ||
| + | | ||
| + | | ||
| + | - work day - execute "work day" action group | ||
| + | - weekend day - execute " | ||
| + | - evening | ||
| + | - night | ||
| + | |||
| + | To add a new value to houseMode, you'll first need to decide if it has substates. If not, then just create an action group with the same value as the new value that you'll be entering in " | ||
| + | |||
| + | If you want to add a new houseMode value that has substates, just follow the pattern for " | ||
| + | |||
| + | I've created a [[https:// | ||
| + | |||