[OBSOLETE] Thermostat Mode Director

Hey guys! I am pleased to announce a new app into my “Director Series” of apps.

Pretty simple one here. Basically it controls your thermostat mode (heat, cool, off, auto) from a customizable temperature range from a external sensor. So if you want it to be in a “cooling” state when it is warm outside you can do that! If you want to have it off when it is between 40 and 70 degree (like i do) you can do that, and of course if it is below 40 degrees you can put it into a “heating” state.

The exciting part here is I have added the ability to check contact sensors as well! So if you want to open your doors during the warmer months my app will see that and turn off your thermostat for you! I tested this the best I could but please give it a whirl and let me know if you see any issues!

Also, if you see anywhere it can be improved, or any cool features added, let me know!

God bless!



Very cool. Great ideas here for thermostat control. I’ll definitely be giving this a try. Thanks Tim.

1 Like

I was working on something like this a while back. It had a lot of the same functions. I decided I didn’t like where mine was going and had to do a complete rewrite, but haven’t gotten around to it. I was planning on working on it this summer. Thanks for your hard work!

1 Like

@tslagle13, the github link on the OP is wrong. Can you update it?

Sure is. Fixed.

Don’t know what happened lol

One thing I noticed while installing it is that picking a contact sensor to turn off the thermostat if it’s open is required in the original code. I added a “, required: false” to the section about those sensors in the code I’m using. Hopefully, that won’t cause any other issues in the code. I wasn’t sure if that was intentional or not.

I have storm doors, so I tend to open my doors to let more light into the house, but they don’t really lose cool/heat through the doors, so I keep the air/heat on. Plus, I don’t have sensors on the windows. Not sure if anyone else has that use case or not.

I guess they aren’t “required”… i just didn’t add that comment. Good catch

just doens’t give you the whole “hands off” aprach i was going for.

Why not just add some sensors you would want to monitor?

1 Like

Updated code to not require contact sensors.

I’m going to be submitting this for official support soon. Please let me know if you see any issues or any features you think I could add.

Mainly a money issue. I’m trying to add all the pieces slowly. I’m working on lighting at the moment, so I only have door sensors just to cover the basics for now. Thanks!

1 Like

@tslagle13, I’m pretty pleased with this SmartApp. You’ve pretty much covered my needs. It’s really nice to have all of the logic in a single SmartApp.

SMS notifications would be a nice to have feature. Adding the ability to set the thermostat mode to off when smoke is detected would pretty useful too.


@tslagle13, I just submitted a pull request on GitHub that you might be interested in. It includes the changes below.

  • Fix for multiple thermostats
  • Add SMS notifications
  • Fix indentations
1 Like

My initial code is noramlly really ugly. I hate fixing it… So thanks… :wink: haha!

EDIT: Merged. Good work man :smile:

I will be adding a few more features soonish as well.

Stay tuned :wink:


Reverted one of your changes. Your switch to “bool” for the Push Message input broke push messages.

Just as a FYI, the “bool” switches suck around here lol. I would never recommend using them.

All your other changes seem to check out though.

@tslagle13, no worries. What issues have you seen with bool?

It never works lol:p

Hrm. It worked for me, but with a sample size of 1, that doesn’t really mean much… I changed it primarily because I think there should be a default value. How about either making it required or setting default value to no?

Default is yes I believe if its not it should be;)

Updated to Version 2.0

  • Added section descriptions
  • Added “thermostat boost” mode
  • Changed default value of push notification to “yes”

Just installed it. Excited to see how it works! :grinning:

1 Like

With a warm day I got to test this today for reals. Thanks for doing these!

One thing I noticed when the temp reached the set hot temp outside, the app turned off my thermostat just great, but then continued to send the off command every couple of minutes to the thermostat all day long. I’m guessing with weather station polling frequency. Anybody else see this frequency? Relevant contact sensors were closed.

It’s not like this is a serious issue approaching rate limits. But thinking I should be able to have the app check if already off, do nothing. Something like this change at line 170

if (currentTemp > setHigh) {
                if ((state.lastStatus == "${hot}") 
                     def msg = "Current temp above set high, thermostat already ${hot}. Doing nothing"
            	     if ((state.lastStatus == "${cold}") || (state.lastStatus == "${neutral}") || (state.lastStatus == null)){

with similar change for Cold and Neutral above and below those lines.

Note, I have the app set to turn off thermostat when Hot or Neutral, back on when temp falls below Cold threshold. I don’t have AC or Cooling mode.

Testing the above seems to work. But then when I open the contact sensor, less frequent but similar repeating off commands are still logged even though the thermostat is already off. I figured I would mess with DoorCheck code next to try to prevent that repetition.

I then closed the contact sensor and noticed the Thermostat did not get a command to turn back on even though the temp outside was below threshold to turn back on. So I reverted back to your original code and waited a long while. But with fresh app load and new subscription the app never sent the command to turn back on the thermostat into heat mode. Temp of relevant temp sensor was more than 10 degrees below the threshold it should be to turn on heat mode. Wondering if that is just smartapp flakyness from republishing or perhaps a bug that if you open a contact sensor when hot outside after app changed to Hot mode/Off and then close when cold outside, it might not trigger the mode change to Cold/Heat as it should.

Just wanted to write this down before I go to bed. I’ll try again when I find more time to test and check.

1 Like