@zarthan had encouraged me to post the rule machine automations that I use for my thermostat in this thread, and I finally got around to it. Here are the rules that have worked pretty well for me.
I don't make use of a virtual thermostat, but use Private Booleans to make sure there are no rapid changes in set-points to prevent short-cycling.
Enjoy .....
Background:
My thermostat is not in a good location. While it is close to (and above) the return register, it does not accurately reflect the temperature in the living space. To get around this, I had used an ecobee3 with multiple room sensors for ~4.5 years until I switched to a z-wave thermostat about 2 months ago. I wanted to control the new thermostat based on temperature in living space, and dependent on mode.
So I got eight temperature/humidity sensors. Different subsets of these are averaged using @bravenel’s Average Temperatures app into an Away Temp, Home Temp, and Sleep Temp.
Based on ecobee data, I knew that my average compressor run times were about 16-18 minutes, and I wanted to recapitulate that with the new setup to avoid short-cycling and over-humidity.
Global variables:
My rules require 4 global variables.
AvTemp: the average sensor temperature (set based on Away, Home or Sleep Hubitat modes)
Temp: desired temperature for the specified Hubitat mode and either heating or cooling thermostat modes
TempMin: temperature used to turn off heating or turn on cooling
TempMax: temperature used to turn on heating or turn off cooling
TempMax and TempMin are calculated from Temp (as +/- 2)
So far, I’ve only tested the rules extensively for heating. The heat pump compressor run times are about 18-22 minutes (data from Sense monitor).
For heating, the average temperature in home and sleep Hubitat modes is about 0.25-0.5F higher than the desired temperature for that mode (i.e. GV Temp).
Here are the rules:
Rule 1:
Pause/resume rules based on the status of a virtual switch called “Thermostat Hold”. I use this when I have guests come over and need to change the temperature from whatever the current mode is set at. The temperature is set using Alexa and a virtual dimmer (see Rule 4). When “Thermostat Hold is turned off, Rule 3a/3b are run to return “Temp”, “TempMax”, and “TempMin” to the appropriate values for that mode.
Rule 2:
This rule uses DarkSky temperature to set the thermostat into heat or cool mode. I use a private boolean to prevent rapid fluctuation in the setting.
Rules 3a and 3b:
When the mode changes, these two rules set the GV Temp, TempMin, and TempMax. To prevent short-cycling, these variables are set with a delay of 15 minutes if the thermostat is not in idle mode.
Rule 4:
Alexa voice commands use this rule to set a local variable called Dimmer based on a virtual dimmer called “Virtual Dimmer - Thermostat Dimmer”. The LV Dimmer is used to set the GV Temp. There is a bound check on the LV Dimmer so that it is between 65-75F before setting the value of the GV Temp. “sms_payload” and “tts_payload” are just GV that I use to send notifications via SMS or TTS.
Rule 5:
This rule sets the GV AvTemp when the calculated sensor averages change (on a per Hubitat mode basis).
Rule 6:
Controls the thermostat in heat mode using TempMax to turn it on and TempMin to turn it off. I chose the values of TempMax and TempMin as “Temp +/- 2” based on values that work well to condition my house. The average temperature per Hubitat mode never gets below the setting of Temp, and the warmest it has gotten after a 20 minute run time is about 1.5-1.7 degrees above Temp.
Rule 7:
This is the flip side of the heating rules. TempMin is used to turn on cooling and TempMax is used to turn it off. I have not used this as much as Rule 6. But the rules are easy to tweak.