[OBSOLETE] Thermostat Manager - An alternative to Thermostat Mode Director

Thermostat Manager

Thermostat Manager is a SmartThings SmartApp that provides automated control over smart thermostats.

You can set temperature thresholds that define what mode you would like your thermostat to be in (heat/cool/etc.) for a specified temperature range. You use Energy Saver features to have your thermostat turn off temporarily if a contact sensor (such as a door or a window) stays open too long. Mode Based Temperature Enforcement allows you to set a specified temperature based on a SmartThings mode change (such as home or away mode). Emergency Heat Settings allow you to set emergency heat mode based on the temperature reading of an outdoor temperature sensor. You can also configure Notification Settings to give you a push notification or a text message when Thermostat Manager makes a change.

If you need any help, post here and I will respond as soon as I can. I always perform my own testing before I publish a new version, but ultimately I rely on you to report any problems. Please let me know if you notice that anything isn’t working right. Also, feel free to make recommendations or to request new features. My goal is to make Thermostat Manager one of the most versatile and reliable thermostat SmartApps and many of the features were added based on user requests.

Standard Installation

To Install Thermostat Manager Smart App:

  1. Login to the SmartThings IDE.
  2. Click My SmartApps.
  3. Click the New SmartApp button.
  4. Select the From Code tab.
  5. Copy all of the code from the thermostat-manager.groovy file into the box.
  6. Click the Create button.
  7. Click the Save button.
  8. Click the Publish button and click For Me.

GitHub Installation

If you would like to add the Thermostat Manager GitHub repository to your SmartThings IDE for easy updates, follow these steps:

  1. Login to the SmartThings IDE.
  2. Click My SmartApps.
  3. Click the Settings button.
  4. Click Add a new repository.
  5. Fill out the new line in the form using the following information:
  • Owner: jmarkwell
  • Name: thermostat-manager
  • Branch: master
  1. Click Save.

You can now update to the latest build by following these steps:

  1. Click Update from Repo.
  2. Click thermostat-manager (master).
  3. Select the Publish checkbox and click the Execute Update button.

If your Thermostat Manager build is current, it will appear in black text in your list of SmartApps.

6 Likes

Hey Jordan, Thanks for creating this app.
I seem to be having trouble with the app actually turning OFF the thermostat after door is left open for 1 min.
I receive the text stating “Therm Manager will shut thermos off” but therm keeps running. I have a Honeywell WIFI therm if that helps.
I can control the therm from Smartthings App with no issues.
Also how can I look in the debugging log? I turned on that option in the app.

Thanks.

Hi Jordon,
Lots of good things in your app. Here’s what I’m trying to do… (AZ electric rate structure quadruples between 3 pm and 8 pm)
8 pm to 3pm heat/ ac runs
3pm to 8 pm off

If any of 4 doors with sensors is open for more than 1 minute, heat/ac off. When all 4 doors are closed, heat/ac turn back on.

Because I don’t see time of day on your temp settings, I used thermostat mode manager to set the temps. I tried thermostat manager to shut off/on for doors open and closed (no temp set).
Thermostat manager shuts off when the door opens but does not turn it back on when it’s closed.

Do you have any suggestions?
Thanks!

nexxman, To access the debugging log, access the SmartThings IDE at https://account.smartthings.com/
Then click on the, “Live Logging” link at the top of the page.

I’ll take a look at the Honeywell system and see if there are any issues that might cause this to happen. In the meantime, I suggest trying changing the minutes left open to 2 minutes instead of 1 minute, just as a test. Let me know if you have any luck with that. If you do, I’ll know what code to look at.

Spurkat, that’s an interesting problem. I’ll look at incorporating time of day settings into the app…

1st, try turning on debug logging and perform the test again. What mode does the debug log say that your thermostat is in? Is it something other than, “heat” or “cool”? Maybe it says, “Thermostat Manager - Mode: auto?” When you close the doors, you should see something in the logs like, “Thermostat Manager - All contacts have been closed. Restoring cooling mode.”. If you see that log entry, but the thermostat isn’t coming on that’ll help me figure it out.

What kind of thermostat are you using?

EDIT: I may have guessed your problem. You are using Thermostat Manager in conjunction with Thermostat Mode Director, right? Thermostat Mode Director likes to set, “auto” mode sometimes. Thermostat Manager tends to ignore that mode because it is somewhat ambiguous and its behavior varies from device to device. Thinking of this exposed a loophole in my design that I didn’t intend. I have just patched this and uploaded an updated source code that should take care of this possibility should it arise. Give the new code a try and let me know if that solves your issue. If not, try the suggestions above and let me know how it goes.

Dear

I installed the smartapp and I also see problem when the device needs to switch off because of open door/ window. The termostat I use is Daikin Wifi:

No command is sent to the thermostat. Until now I have been using built in routines to switch on/off or change setpoint and it works OK, so according me the Daikin DTH works

Here is the log from Thermostat manager:

d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:25: debug Thermostat Manager standing by.
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:25: debug Thermostat Manager - Temperature: 22.5
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:25: debug Thermostat Manager - Cooling Setpoint: 28 | Heating Setpoint: 22.0
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:25: debug Thermostat Manager - Mode: heat
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:25: debug Thermostat Manager - Fan Mode: auto
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:25: debug Thermostat Manager - Hello Home Mode: Home
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:25: debug Thermostat Manager - Smart Home Monitor Status: off
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:25: debug Thermostat Manager - At least one contact is open: null
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:01: error groovy.lang.MissingMethodException: No signature of method: script_app_Thermostat_c8b78d6a_c9a3_4de7_a006_b9ba4611c5ff_ver_0_1.sendpush() is applicable for argument types: (java.lang.String) values: [Thermostat Manager is turning the thermostat off temporarily due to an open contact.]
Possible solutions: sendPush(java.lang.String), sendPush(java.lang.String, java.util.Map), sendSms(java.lang.String, java.lang.String), input(java.lang.String), sendSms(java.lang.String, java.lang.String, java.util.Map) @line 300 (logNNotify)
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:58:01: info Thermostat Manager is turning the thermostat off temporarily due to an open contact.
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:56:01: debug Thermostat Manager - A contact has been opened. Initiating countdown to thermostat pause.
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:56:01: debug Thermostat Manager - A contact has been opened.
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:55:25: debug Thermostat Manager standing by.
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:55:25: debug Thermostat Manager - Temperature: 23.0
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:55:25: debug Thermostat Manager - Cooling Setpoint: 28 | Heating Setpoint: 22.0
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:55:25: debug Thermostat Manager - Mode: heat
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:55:25: debug Thermostat Manager - Fan Mode: auto
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:55:25: debug Thermostat Manager - Hello Home Mode: Home
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:55:25: debug Thermostat Manager - Smart Home Monitor Status: off
d4b32df4-8018-414a-a1f6-be5bae0ca47f 19:55:25: debug Thermostat Manager - At least one contact is open: null

Below is the log from the airco

c4751f06-9e5a-4dec-adad-ded6962ccfce 19:58:26: debug Executing ‘updateEvents’ with heat, 22.0 and false
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:58:25: debug Parsing Response: [ret:OK, pow:1, f_rate:A, dfrh:5, dfd7:0, dfd6:0, b_f_rate:A, b_shum:0, dfd3:0, dfd2:0, shum:0, dfd5:0, f_dir:0, dfd4:0, b_f_dir:0, mode:4, dfd1:0, stemp:22.0, dfdh:0, b_stemp:22.0, adv:, dh7:AUTO, dh4:0, dh5:0, alert:255, dt1:25.0, dt2:M, dt3:25.0, b_mode:4, dt4:22.0, dt5:22.0, dt7:25.0, dhh:50, dfr4:A, dfr5:A, dfr6:5, dfr7:5, dh3:0, dfr1:5, dh2:50, dfr2:5, dh1:AUTO, dfr3:5]
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:58:25: debug Parsing Response: [ret:OK, err:0, otemp:7.0, htemp:22.5, cmpfreq:30, hhum:-]
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:58:25: debug Executing hubaction on 192.168.1.241:80/aircon/get_control_info
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:58:25: debug Delay for ‘500’
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:58:25: debug Executing hubaction on 192.168.1.241:80/aircon/get_sensor_info
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:58:25: debug Refreshing
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:57:25: debug Executing ‘updateEvents’ with heat, 22.0 and false
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:57:25: debug Parsing Response: [ret:OK, pow:1, f_rate:A, dfrh:5, dfd7:0, dfd6:0, b_f_rate:A, b_shum:0, dfd3:0, dfd2:0, shum:0, dfd5:0, f_dir:0, dfd4:0, b_f_dir:0, mode:4, dfd1:0, stemp:22.0, dfdh:0, b_stemp:22.0, adv:, dh7:AUTO, dh4:0, dh5:0, alert:255, dt1:25.0, dt2:M, dt3:25.0, b_mode:4, dt4:22.0, dt5:22.0, dt7:25.0, dhh:50, dfr4:A, dfr5:A, dfr6:5, dfr7:5, dh3:0, dfr1:5, dh2:50, dfr2:5, dh1:AUTO, dfr3:5]
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:57:25: debug Parsing Response: [ret:OK, err:0, otemp:7.0, htemp:23.0, cmpfreq:30, hhum:-]
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:57:25: debug Executing hubaction on 192.168.1.241:80/aircon/get_control_info
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:57:25: debug Delay for ‘500’
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:57:25: debug Executing hubaction on 192.168.1.241:80/aircon/get_sensor_info
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:57:25: debug Refreshing
c4751f06-9e5a-4dec-adad-ded6962ccfce 19:56:25: debug Executing ‘updateEvents’ with heat, 22.0 and false

D_Gjorgjievski, thank you! And thank you for posting the logs. It appears that you’ve discovered a typo in my code that was causing a problem to happen. I have corrected the code and you shouldn’t have any problems now. Let me know if I can be of further assistance.

Dear Jordan

Thanks, great app
It seems it works now. I have tested it in one room and it was OK.

I have some suggestions for improvements:

  1. The Thermostat Manager disable functionality: it would be nice if I could link virtual switch to it so as in my case where I have 9 thermostats I can disable the manager with one click.
  2. Setting setpoints per mode: my alarm is interfaced to the smartthings so I can use the functionality that you already built in the smart app, but it doesn’t cover all situations. For example if there is nobody home the heating is set to bit lower temperature than normally, but when I am on holiday I would decrease the set-point even lower than that
  3. Include delay for starting on the thermostat. Sometimes you (or maybe draft/wind) may close a door for a short time and open it again and that will prevent starting the unit too often
  4. Possibility to override the temperature set-point manually (I am no sure if this is possible, but sometimes can be useful)

Would be great if you can include some of the above suggestions
Greetings

D_Gjorgjievski,

Hello again. Make sure you’re using the latest revision. I also changed something else in the app. In particular the build number is 2018040102 and line 218 should look like this:

def openContact = contact?.currentValue("contact")?.contains("open")

I’ll take a look at some of your suggestions. The toggle widget isn’t a bad idea. As far as further setpoint settings, I am looking at making some enhancements in this area but there are so many situations that people have, it is difficult to come up with one that suits everyone. But I will continue to work on it. On #3, I should be able to do this with little difficulty, I’ll take a look at it. On number 4, this may be already possible, depending on your meaning. If you don’t want any thermostat mode changes to occur, just set your thresholds to zero, “0”. If you set it at zero, that particular threshold will be ignored and heat/cool will not be set based on it. If you’re talking about overriding the thermostat temperature by setting the temperature manually, you can already do this as well. The setpoints are only set when a thermostat mode change takes place. Cool to heat, heat to cool etc. The reason it works like this is because I wanted to be able to maintain manual functionality as much as possible, but I also discovered that sometimes when a mode change occurs, unusual things can happen. For example, say during winter you have your thermostat set to 65F for heating, 79 for cooling (while not home for example). But then summer comes around and to save money you want it set at 73 for cooling. Well when the mode change occurs (while you aren’t home), it takes the value that you set it at last, which could have been months ago. If this is a house that you only reside at 6 months out of the year, or you are on vacation and are not home, this could be a problem. Your electronics may overheat or any animals in the house may end up getting very hot (at 79F). It’s a bit of a safeguard. It is possible to disable these by disabling setpoint enforcement however. Another alternative is to experiment with mode rules. At the bottom of the settings, you will see options for, “set for specific mode(s)”. You could try creating various instances for various modes. Thanks your thoughts. I am always open to input and will continue looking at expanding flexibility.

Dear Jordan

I already have installed the last version and I already tested that the energy saver mode is working (I connected to your github repository).

If I correctly understand you, the setpoints will only change if the thermostat mode is changed(heat to cool) or if the alarm changes state. In the meantime I could manually or via other routine/smartapp modify the set-point without the smart app setting it back. That is great and that is what I wanted.

The “Holiday” set-point can also be covered if I change the mode to Holiday and disable the manager for the holiday mode, or alternatively if you decide to implement the manager disable functionality, I could set a a virtual switch to disable the manager and then set the set-points via some other app/routine.

I think that the On delay will be useful to have but on the other hand it is also something I can also live without

Great job in any case
Greetings

Dear Jordan

I just realised that the setpoint is not sent when the alarm status is changed. Can you please include this functionality?
You can update the set-points only when the alarm armed status is changed and it will still keep the functionality to manually override the manager.

Additionally I was thinking that it is not bad idea in energy saver mode to have an option to set the heating/cooling thermostat setpoint to the outside temperature in order to avoid too often start/stop of the unit which will increase the reliability of the airco system i general. Things fail most often during switching them on.

thanks for taking this in consideration

D_Gjorgjievski, have you tried using the, “Hello Home” (I’m Back, Goodbye, etc.) tiles to set the temperature/security mode? That’s what most people do. They are more convenient because you can set multiple settings with one button. You can also make widgets out of them.

Yes, I currently use the routines you describe, but I looked for single smartapp that will integrate all functions for the airco. I have 9 units at this moment (and 3 more to come), so it is quite messy knowing I have several smartapps for one unit and also prone to errors.

I might also modify your code for the functions I need as soon I have more time. It is a very good starting point for what I need.

Greeetings
Darko

Hi JMark,

I actually changed the timing to 3 mins but that did not work either. Let me know if I should try anything else.
BTW I do recieve the text notification stating Therm Manager is going to shutoff the therm so I know that part works.
Really would like to get this to work. Wife keeps forgetting patio door open when dog goes out. (-; TIA

nexxman,

I took a look at the Honeywell Wifi code and didn’t see anything that should cause a problem. I recently released a new version of Thermostat Manager that has a couple of fixes in it. Make sure you are using the latest revision (2018040102) just in case this may solve your problem. Did you see anything in the debug logs? If you haven’t done it yet, just turn on debug logging, log into the SmartThings IDE, click on, “Live Logging” and then run a test by opening and closing some doors over a period of minutes. Copy and paste the logs here and that will help me find the problem.

1 Like

Awesome work Sir! Work flawlessly
Turns therm off then turns back on after door is closed.
Thanks very much!

Hi, clueless newbie alert. I’m just getting started with SmartThings and home automation in general.

I’ve got the ST V1 hub. My HVAC system has three Honeywell WiFi thermostats for a single system with baffles to direct air to three zones. The thermostats are defined and working in both the “classic” SmartThings Android app and the “new” SmartThings app.

Things I’d like to do are:

  1. Swap between heating and cooling mode on all three thermostats with one tap (currently have to go thru several taps for each thermostat individually).

  2. Use the external temperature to automatically change between heating and cooling mode.

I think the thermostats retain separate heating and cooling setpoints as well as schedules.

I’ve got the Thermostat Manager SmartApp installed and need to make sure I’m setting it up correctly.

Do I have to create an instance of the app for each thermostat? I don’t see any way to select multiple thermostats for one instance of the app.

How do I create … something … that will react to external temperature? Is that what the “Cooling Threshold” and “Heating Threshold” settings do or are those inside temperatures as reported by the thermostats?

Thanks for any help,
–Hal

Hi Jordan,

I have a 2-stage heating system and 4 modes: OFF, COOL, HEAT, and EMERG HEAT. I was wondering if there is an option (or could there be an option) to have the Thermostat Manager switch the thermostat from HEAT to EMERG HEAT when the outside air temperature (as measured either from an outdoor sensor or from the cloud) was below 30 degrees or some selectable setpoint? This would prevent my system from constantly turning on the HEAT PUMP first and then switching over to EMERG HEAT when it figures out it needs it. I’m not sure what algorithm it uses, but it’s annoying when the temperature gets really cold and I usually just manually switch the system to EMERG HEAT to avoid the cycling.

Currently, yes. I only have a single thermostat home with which to perform testing and I generally don’t like to implement anything that I can’t test. It is not a difficult thing to setup multiple instances, but if you would like to use the same settings for the 3 thermostats, I could work with you to modify the system to allow for multiple thermostats. If you could do the testing for me and report back the results, I’d be willing to make the modifications.

Cooling and heating thresholds are user defined variables that define when Thermostat Manager will send a command to the thermostat to switch modes. For example, a cooling threshold of 76F will tell Thermostat Manager to send a command to your thermostat to switch it into cooling mode (if it is not in cooling mode already) so that it will start cooling your house at a temperature above 76F. A heating threshold of 68F will tell Thermostat Manager to switch to heating mode if the temperature falls below 68F.

The short answer is, you can’t. That is unless the thermostat you have came with a system that includes remote sensors like an Ecobee, or your thermostat allows you use other thermostats as remote sensors. The reason for this is that although we may have something like a SmartThings temperature sensor readily available for reporting the temperature in a given area, your thermostat uses its own internal thermometer to decide whether or not to activate. For example, you could have an outside sensor report that it is 90F outside and then have an app tell the thermostat to switch to cool mode based on that report. But the thermostat’s internal thermometer will read the temperature of its own area, in this case let’s say its 75F. If your cooling setpoint is 76F, the AC won’t kick on because the thermostat’s internal thermometer says that it doesn’t need to. It will be set to cooling mode as instructed by the app, but the AC won’t kick on. The only way around this would be to use an app that automatically adjusts the cooling and heating setpoints in order to make the unit kick on when you want it to. Thermostat Manager wasn’t designed to work like this and so I won’t be implementing this feature but, SmartThings already has an app in their library that does this, called, “Keep Me Cozy” if I remember right. And you should be able to use it in combination with Thermostat Manager.

An alternative method to achieve #1 on your wish list may be to simply use a SmartThings tile. You should be able to create a simple button that sets all 3 thermometers relatively easily using this method. But if you do want to add the capability for Thermostat Manager to control multiple thermostats, let me know and I’ll work with you on that.

Thermostat Manager does not currently have this functionality, but something like this is possible. I would not be able to test this modification myself as I do not have a unit that has an emergency heat mode, but I would be willing to make these modifications if you wouldn’t mind testing them and reporting the results to me. This seems like a desirable feature.