Thermostat SmartApps that uses Virtual Switches to control Mode/Fan/SetPoints


(Darc Ranger) #1

I currently own a CT100 Thermostat and like to use the SmartTiles app.

I know that SmartTiles will let you change the set-point temperatures, but at this time it does not have a method of switching the modes or the fan though the dashboard, I created an app that lets me use Virtual Switches to control the fan mode [fanOn/fanAuto] and each of the thermostat mode [HEAT/COOL/AUTO/OFF].

Currently you will need to create 4 virtual switches; one switch for the fan and three more switches for HEAT/COOL/AUTO] modes.

I also set up the app so that the switches will reflect the state of the actual thermostat. For example you switch the fan mode to fanAuto through the virtual switch on the dashboard, but then change it to fanOn from the device on the phone APP or physically change it on the thermostat, the virtual switch will change to reflect the current state. There is a short lag between cross events, but so far it has been about a second at most.

Also with mode switching, if you turn the active mode from COOL to HEAT, the COOL switches to OFF and the Heating switch activated.

I have setup separate push notification for the fan mode switching and the thermostat mode switching, and you to turn either one on/off. I just added an appTouch command on the app to show the state of the fan and the current thermostat mode via a push notification. This is always on

I have been using this app version for a about a month. and have not run into any issues. Originally I was using two separate apps, one for Thermo-Mode and another for Thermo-Fan. I was using that for about a month before combining them.

Since I only have the CT100 Thermostat I limited the app for the modes I have. This app will only use one thermostat, instead of the multiple option. Although you would need to create multiple virtual switches you should be able to create a version of the app for each thermostat you have. Also there nothing stopping you from reusing the same switches for each version of the app for place with multiple units if one desires.

Another side benefit is mode switching [HEAT/COOL/AUTO/OFF]. The SmartThings phone app for the device has one button to switch modes. For me the lag between switches meant that I sometimes got impatient and press one to many and missed my intended mode.
Another may be the use of IFTTT for those with thermostats without any IFTTT integration.

Feedback/suggestions are welcome, though I am not a groovy expert by any stretch of the imagination. I have posted it on my GitHub site for any one that is interested.

This is what my thermo-dash section looks like in SmartTiles.


How to create a virtual dimmer?
How could our Amazon Echo control a thermostat? My idea
Ecobee Cool/Heat/Off control with Amazon Echo
Space Heater + Temp Sensor. Virtual Thermostat for Alexa?
Volume control of third-party device via Amazon Echo (Alexa)
Amazon Echo
Amazon Echo
Controlling CT100 Fan Mode
(Tim Slagle) #2

and yet another reason this community adds value to our product. Nice job man!


Amazon Echo
(Darc Ranger) #3

@swindmiller,

I finished this draft version of my Smart app that uses Virtual Dimmers to adjust a thermostat’s temperature setpoints for heating and cooling. Although there is a short lag, the app will also adjust the dimmer level of the virtual dimmers if the setpoints are changed directly from the device. I also added options for a setPoint limiter for maximum/minimum. This way temperature setPoint request is out of range it will reset to the preset maximum/minimum.

As you know you will still need to create your own virtual dimmers switches to link to this app,

https://github.com/DarcRanger/DR-SmartThings/blob/master/Thermostat/Thermostat%20Setpoints:%20V-Dimmers%20v2

Please let me know how it works for you.


SmartThings + Amazon Echo Official Integration
FAQ: Amazon Echo: The Official SmartThings Integration is here! (Initial SetUp FAQ)
(Scott Windmiller) #4

Thanks!!! I am going to give this a go later on today.
Thanks for posting it.
Scott


(Scott Windmiller) #5

Oh my, this works great!
I added 2 virtual dimmers, I had to find a device type for them on here since I did not show any in the templates. I added the smartapp and assigned cooling to one of the dimmers and heat to the other. Testing with just adjusting the dimmers in the mobile app worked great. There is about a 40 second delay (which is perfectly fine) and it toggled the dimmer switch on and off twice, I assume that is how it works, then the thermostat changed :smile:
I added the 2 switches to the Echo but still want to figure out how I want to invoke it. For now I just created a group called “the Thermostat” and will manually added either the cooling or heating switch when needed. I had the switches named “thermostat cooling (heating) dimmer” but with the group named “the Thermostat” the echo saw multiple devices. I just changed the name of the switches and will test again tomorrow, I don’t want to wake anyone up :smile:

“Alexa, set the Thermostat to 75”…priceless!!
Thank you, thank you, thank you.
Scott


(Darc Ranger) #6

@swindmiller,

I glad it works for you. You are right it does trigger twice, but that is normal. Mainly it due to the thermostat change and the dimmer switch making sure it matches the setting. This way if you change the thermostat directly, the dimmer will reflect that.

I am also still looking for the best name for either the group or the switches that will make Echo understand things consistently. Let me know what you end up using.


(Scott Windmiller) #7

For now I changed the dimmers to “Cooling Dimmer” and “Heating Dimmer” and re-added them to the Echo. I set the group to “the Thermostat” and just put the cooling dimmer in it for now. This all worked fine and felt natural, “Alexa, set the thermostat to 75”.
On a side note I tried “Alexa, set the thermostat to 75 degrees” just to see what would happen and it added that to the To-do list :frowning: I tried again and got the same thing, then tried the original phrase and once again got the same thing :frowning:
I cleared all three entries from the To-Do list and the original phrase worked fine from then on, it also could have been because I waited a few minutes before trying again…weird.
I look forward to using this from now on, thanks!


(Steve Frangadakis) #8

Has anyone tried these with the Honeywell thermostat?


(Darc Ranger) #9

Thinking of creating a virtual momentary dimmer switch to use for the set-point controls. I think I will add the option to display the current level of dimmer, instead of the button, since you still need to go into the device to manually set level.


(Scott Windmiller) #10

Was trying to figure out the benefit of the momentary vs the button but it just clicked :smile: That sounds good, is there something you need me to try? I can try the momentary button now or do you want me to wait until you get it to display the level?


(Darc Ranger) #11

I should have the new switch up this evening. I need to finish modifying the original smart app to use the momentary dimmer instead of the standard dimmer. Replacing that command is easy, just going in to “//” the extra on/off commands will take a little longer. I will get both on Github tonight, and let you know.

Still looking for a good name of the Heating setpoint switch, but “The a.c.” seems to work well for the cooling setpoint.


(Scott Windmiller) #12

Yeah, “the Heat” is the only thing that comes to mind right away.


(Darc Ranger) #13

@swindmiller,

This is a beta version of a new device, a Momentary Dimmer Switch.

This is a revision to my original thermostat setpoint app that will use the custom Momentary Dimmer, listed above.

https://github.com/DarcRanger/DR-SmartThings/blob/master/Thermostat/Thermostat%20Setpoints:%20V-Momentary%20Dimmers%20v2.1

Please test to see how this new version works. I have not had a chance to fully test the new app or momentary dimmer but in to work, but the initial testing with my first draft versions seem to work fine. Hopefully I have enough details in the live log to help with any trouble shooting.


#14

I would love to use this but have no idea how to create the virtual dimmers and where to put the code. When you get a free moment would you post a step by step from the beginning so us newbies can try it out?


(Darc Ranger) #15

Need t create a new Device Type handler in the IDE.

Installation:

Create the Device Type:

  1. Create a new device type, the name can be anything
  2. Paste this code into the new device and save
  3. Publish the device type, “For Me”

Add a new Device:

  1. Create a new device, name it something appropriate
  2. Give it a unique Device Network ID
  3. Select “Virtual Momentary Dimmer” as the Type (should be near the bottom)
  4. Make sure “Published” is selected as the Version
  5. Select the Location, Hub, etc.
  6. Click Create

At this time I found a posting on creating a virtual switch.


#16

Awesome, thank you , I will give it a go


(Scott Windmiller) #17

It looks like it worked but seem to work the same way as the button with the on/off, is there an advantage to using the momentary button?

Also this is what my log shows, is that ok:

7:56:07 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:56:07 PM: error java.lang.NumberFormatException: For input string: "off" @ line 141
7:56:07 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:56:07 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:56:07 PM: error java.lang.NumberFormatException: For input string: "off" @ line 141
7:56:07 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:56:06 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:56:06 PM: error java.lang.NumberFormatException: For input string: "off" @ line 141
7:56:06 PM: debug current coolingsetpoint is 75
7:56:06 PM: debug coolingSetpoint Event Name: coolingSetpoint
7:56:06 PM: debug coolingSetpoint Event Value: 75
7:56:06 PM: debug
7:56:06 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:55:34 PM: error java.lang.NumberFormatException: For input string: "off" @ line 141
7:55:34 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:55:34 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:55:33 PM: debug switchSetLevelHandler Event: 75 | TempMode: Cooling
7:55:33 PM: error java.lang.NumberFormatException: For input string: "off" @ line 141
7:55:33 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:55:33 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:55:33 PM: error java.lang.NumberFormatException: For input string: "off" @ line 141
7:55:33 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141
7:55:33 PM: error java.lang.NumberFormatException: For input string: "on" @ line 141

(John O) #18

@kgofswg1973 this works great with the Honeywell thermostat. @DarcRanger thank you for sharing this!!

“Alexa, set thermostat to 72”

Absolutely amazing


(Darc Ranger) #19

I know what to fix in the app. Remove the “//” from lines 112 and 113 and lines 139 and 140.

if ((evt.value == "on") || (evt.value == "off" ))
	return

This line is in both places and need to be active.

The Github will be updated in a few minutes.


(Scott Windmiller) #20

That helped :smile:
What’s the impact of using the momentary vs the regular button, just trying to understand the differences.

Thanks for your work!