Jump to content

Varibles for Thermostat


snownh2o2

Recommended Posts

Hello Everyone,

 

I admit that I have spent too much time being creative on this idea, however does anyone know of a quick and easy way to use variables to change times and temperature.

 

For instance, I have multiple programs that determine my thermostat settings. They change 4 times throughout the day. There also adjust (set back) and extra 4degress when my cell phone MAC address is not on the network or the home is in 'AWAY' mode. Because of multiple thermostats and Home, Away, & Vacation states in both Heat and AC setting, if I want to make a change to the timing and/or the temperature I need to change around 30 programs for each mode.

 

I would like to make a variable for different time changes and for the different temperatures.

 

For example:

HeatTempMorningHome=70F

HeatTempMorningAway=66F

TimeMorningBegin=04:30:01AM

TimeMorningEnd=07:30:00AM

 

Here is an example of a single Home Heating set of programs:

 

If

On Sat, Fri

From 4:00:01PM

To 8:00:00PM (same day)

And Folder 'HT:Heat' is True

Then

Allow the programs in this folder to run.

 

-----

 

If

Folder 'HTH:Evening Fr-Sa' is True

Then

Set 'IN / House / 1st FLR / Fam Rm / FR TStat_Main' 68° (Heat Setpoint)

Set 'IN / House / 2nd FLR / Mstr Bed / MB TStat_Main' 68° (Heat Setpoint)

Wait 15 seconds

Run Program 'HTHE:1600-2000' (Else Path)

Else

Stop program 'HTHE:1600-2000'

 

Thanks for any insights that you can contribute,

Matt

Link to comment

Here are some ideas (things that I am currently doing).

 

First, we need to know the current Heating and Cooling SPs of your thermostat.

- ISY currently does not support writing this value to a variable, but you can look it up.

If
       Status  'Thermostat- Main' is 74° (Cool Setpoint)
Then
       $Thermostat_Setpoint_Cooling_Integer  = 74
       $Thermostat_Setpoint_Cooling_Integer Init To 74
       $Thermostat_Setpoint_Cooling_State  = 74
       $Thermostat_Setpoint_Cooling_State Init To 74

The variables are self explanatory. For my family, a range of 60-80 covers our needs so this is the range I cover.

- Anything <= 59 or >=81 gets set to 59/81 (beyond that I don't care, they are wrong).

- We do this for both Heating and Cooling Setpoint

- To repeat, this is 22 programs for Heating Setpoint and 22 programs for Cooling Setpoint

 

Next, we need to be able to set the Cooling/Heating SP based on a variable.

- To do this, I have an Integer Variable called $Thermostat_Set_Cooling (and heating).

If
       $Thermostat_Set_Cooling is 70
Then
       Set 'Thermostat- Main' 70° (Cool Setpoint)

Then, I have a program I can call to update the Heating/Cooling setpoints based on whatever I've set $Thermostat_Set_Cooling. I did not use a STATE for this as I would like to do math on it, and not have it update until I'm ready for it.

If
  - No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
       Run Program 'Set Cooling 60' (If)
       Run Program 'Set Cooling 61' (If)
       Run Program 'Set Cooling 62' (If)
       Run Program 'Set Cooling 63' (If)
       Run Program 'Set Cooling 64' (If)
       Run Program 'Set Cooling 65' (If)
       Run Program 'Set Cooling 66' (If)
       Run Program 'Set Cooling 67' (If)
       Run Program 'Set Cooling 68' (If)
       Run Program 'Set Cooling 69' (If)
       Run Program 'Set Cooling 70' (If)
       Run Program 'Set Cooling 71' (If)
       Run Program 'Set Cooling 72' (If)
       Run Program 'Set Cooling 73' (If)
       Run Program 'Set Cooling 74' (If)
       Run Program 'Set Cooling 75' (If)
       Run Program 'Set Cooling 76' (If)
       Run Program 'Set Cooling 77' (If)
       Run Program 'Set Cooling 78' (If)
       Run Program 'Set Cooling 79' (If)
       Run Program 'Set Cooling 80' (If)

To recap where we are at now:

- We know the current SP of our TStat (even if someone were to change the SP outside of ISY, ISY will know this happened).

- We can change the current SP to match any variable or math that we use.

Now we make a schedule that only contains a time:

If
       Time is  6:00:00AM
Then
       Run Program 'Set Morning Cool' (Then Path)
       Run Program 'Set Morning Heat' (Then Path)

And then separate programs to handle the SPs:

If
  - No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
       $SP_Cooling  = 75
       $SP_Cooling Init To $SP_Cooling
       $Thermostat_Set_Cooling  = $SP_Cooling
       $Thermostat_Set_Cooling Init To $SP_Cooling
       Wait  2 seconds
       Run Program 'Set Cooling Update' (Then Path)

Another recap:

- We have 1 time based program, at that time we put in our time based SPs.

- The $Thermostat_Set_Cooling has been introduced already, but we now have a $SP_Cooling.

- $SP_Cooling is what the SP SHOULD BE, $Thermostat_Setpoint_Cooling_Integer(State) is what the SP IS.

What you would like to adjust here:

- I find it very easy to change that 75 from within the program; but there is nothing stopping you from making that equal to $SP_Morning_Cooling and setting that to 75 in your variables.

Lets talk about timers:

- I'll give you an example here, as you would like to make a 'dynamic timer' or change when the SP is set based off a variable.

- My example is not directly applicable to what you are trying to do, but the concept is similar and can be adjusted.

- I do this for my evening cooling. It changes when it starts based on how long it took to cool yesterday (averaged) so that we reach the correct set point at a certain time.

- The concept is that at 10pm I would like the house to be at a certain set point.

- At 6pm I start a 4 hour count down, where I subtract from that how long it took to cool yesterday. So if it took 30 minutes, the timer ends at 210 minutes, or 9:30pm.

Start the Timer at 6pm:

If
       Time is  6:00:00PM
Then
       Run Program 'Evening Wait Timer' (If)

Countdown:

If
       $Timer_Countdown > $Timer_Yesterday
   And $Timer_Countdown > 0
Then
       Wait  1 minute 
       $Timer_Countdown -= 1
       $Timer_Countdown Init To $Timer_Countdown
       Run Program 'Evening Wait Timer' (If)
Else
       $Timer_Countdown  = 240
       $Timer_Countdown Init To 240
       $Timer_Today  = 0
       $Timer_Today Init To 0
       Run Program 'Set Evening Cool' (Then Path)
       Run Program 'Set Evening Heat' (Then Path)

As they are just variables, it does not matter what $Timer_Yesterday/Today are, but just if you are curious:

-When the AC turns on, I start a timer.

-When it stops, the timer is over.

-I average this with the previous timer and now we have the next day's wait.

Set Evening Cool:

If
  - No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
       $SP_Cooling  = 71
       $SP_Cooling Init To $SP_Cooling
       $Thermostat_Set_Cooling  = $SP_Cooling
       $Thermostat_Set_Cooling Init To $SP_Cooling
       Enable Program 'New Cooling Time'
       Wait  2 seconds
       Run Program 'Set Cooling Update' (Then Path)
       Wait  1 minute 
       Run Program 'New Cooling Time' (If)

New Cooling Time:

If
       Status  'Thermostat- Main' is Calling for Cool
Then
       Wait  1 minute 
       $Timer_Today += 1
       $Timer_Today Init To $Timer_Today
       Run Program 'New Cooling Time' (If)
Else
       Send Notification to 'Admin' content 'Reached Setpoint'
       $Timer_Yesterday += $Timer_Today
       $Timer_Yesterday /= 2
       $Timer_Yesterday Init To $Timer_Yesterday
       Disable Program 'New Cooling Time'

 

 

Now lets do some math:

- In your example you would like to add 4 degrees when you are away.

- Using the programs above, you could just add 4 degrees to the current SP and then have it set.

- In this way, it does not matter what the SP is, it will now be 4 degrees more.

- As a note, I do have a safety program that prevents the SP from going above 85 or below 55.

- Again, this example is not a cut and paste for you, but it gets the concept.

- In mine, I handle returning the SP to normal if someone were to go to the TStat and reduce or increase the SPs.

- This is useful for when we want to cool the house in the middle of the day.

If
       $SP_Cooling < $Thermostat_Setpoint_Cooling_State
Then
       $Thermostat_Set_Cooling  = $Thermostat_Setpoint_Cooling_State
       $Thermostat_Set_Cooling -= 1
       $Thermostat_Set_Cooling Init To $Thermostat_Set_Cooling
       Wait  1 hour 
       Run Program 'Set Cooling Update' (Then Path)

- So here, if we change the Thermstate Setpoint, this program gets called.

- If the Setpoint is not what it should be based on our time based setpoints, then we need to adjust it.

- Every hour, we move the SP closer to what it should be.

 

 

 

Recap Final:

- With the above concept, having SP Variables for what you want to set the TStat is easy.

- You could make a timer start at 3:30am (after the update) that lasts for 24 hours.

- When this timer reaches certain points, it could change your Set Points

- When the timer reaches 120 minutes (5:30am) then set Morning_Variables

- When the timer reaches 600 minutes (1:30pm) then set Afternoon_Variables

- When I leave the house, add 4 degrees to the current SP.

- When I'm on vacation, change the Morning/Afternoon_Variables to vacation mode

- When I'm home change the timers and the SPs.

 

 

Let me know if you have any questions.

Also let me know if you see some improvements to these suggestions as I'm always tinkering.

Link to comment

Wow! Thanks for that in depth reply! It's greatly appreciated. I'm on the road but will play with it when I return. I hadn't considered timers, homever that might be a viable option. I want to make it fairly easy to make the time changes simple through a user interface, so I will work on adding programs that convert clock times to timers.

 

Thanks again for going above and beyond with your response. It's was makes the ISY forum one of the best out there!

 

Matthew

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...