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


(Darc Ranger) #54

@ultrazero,

Try this app. I did qa quick test on the increase request through IFTTT and it seemed to work.
Let me know if you have any issues.


(Greg) #55

@DarcRanger I'll test it as soon as possible!

One questions: Should I be using standard momentary button or your custom momentary dimmers?


(Darc Ranger) #56

It should be the regular momentary, since I am not using any dimmer code in the script.


(Greg) #57

It works great! This is an excellent work around for IFTTT and useful for a number of things. Could be used on the web dashboards as well. You're famous in my book!

One thing I noticed while testing:
Started at 77.
Momentary button up 3 degrees went to 80. Great!
Momentary button down 3 degrees went to 74. Hmm.

I believe it was using the original setpoint of 77 instead of the new set point of 80 when I hit the second button. I tried again. This time I refreshed the Thermostat device first, and it worked. I'm guessing since I hit the second button so soon after changing the first button, ST hadn't gotten the refreshed setpoint back from the thermostat? Sounds right to me anyway. I don't know if it'll behave in the real world quite like this or if its just because I'm testing. Do we know how long it takes ST to refresh thermostats automatically?

Maybe there's a refresh function or something you can put in before each action? Don't know if this will add to your overhead. Also don't know it's necessary.

Great job!


(Darc Ranger) #58

There is a lag between the switch commands and the thermostat. Some of that lag is built into some of the device types for thermostats as a delay. If you change too fast you would see issue like you do.

The code is setup to always look for the current thermostat setpoints. What type of thermostat do you have and what device type are you using for it? As I stated earlier in this topic have a CT100 and the device type code I have gives two options to change setpoint, The standard command has a build-in delay for changes and an quickset, which changes without a delay once the command is trigged by the switch. The thermostat still needs time to process so a quick hit up/down will still replicate the quirk you saw.
My other setpoint apps give the user the option to swtich between the setpoint types, and I neglected to add that to this one.


(Greg) #59

I have a CT100 as well and using the custom device type from this thread:

I’m assuming in real world use the lag wouldn’t be an issue. I’d change the temp with the button (or ask Siri to!) and wait for it to get hot/cool before doing anything else.


(Darc Ranger) #60

I will have and update late tonight to take advantage of quicksetpoint with an option to choice it or standard setpoint command.

EDIT: App has been update to choose between standard setpoint with the programmed delay and the quickset which is a little faster when setting up the app.


(Jeremy Bryant) #61

@DarcRanger - thanks for all your work on this. I am totally new to SmartThings and all it's associated apps / community / etc. I have a CT100 that I successfully joined to my hub as well as an Amazon Echo that can control devices on my hub. I have tried as best I could to follow your directions listed throughout this thread but seem to be coming up short.

I was able to create the new Device Type in IDE and create a new device (although none of the types you reference in this thread are an exact match). I seem to be at a loss for where to go from there. You mentioned SmartTiles so not sure if that is required (or to be honest what it is).

At this point all I'm really trying to do as I swap over all my z-wave devices from an Alarm.com panel to ST is control the CT100 via voice using Echo. If you don't want to spend a bunch of time walking a total newbie through this I totally understand. Perhaps you could suggest some topics that I should read up on to learn more about the functionality of SmartApps and how to leverage the awesome work you and others have shared.

Thanks in advance.


(Darc Ranger) #62

@Jeremy_Bryant,

SmartTiles is not required, it was what prompted me to create the first app. Access to the Echo was a side benefit that expand to additional apps to get certain function accessible via switches.

Where exactly are you stuck in the process and which app Mode/Fan or one of the setpoint ones? What is the issue, using the app to select the type of switches then finding them through the app or selecting the thermostat? Or creating virtual switches based on device type.


(Jeremy Bryant) #63

@DarcRanger I'm looking at just Setpoint as I can change the mode myself. I created the Device Type with your code from Github and then created a device. I was a little confused on the Type setting in Device as I couldn't find one named "Virtual Momentary Dimmer". Closest I could find was just labled "Momentary Capability". I chose that, added my location and hub and created / published both.

At that point I'm not sure what to do and where the Echo integration comes into play. Do I need to create the virtual switches if I only want to use Setpoint?

**Updated - I should note I am using the V2 hub if that makes a difference.


(Darc Ranger) #64

The normal Momentary switch in the IDE is called Momentary Button Tile. You should be able to go to the IDE under "My Devices" and edit the switch to change the device type "Momentary Button Tile" without the need to create new switches. My device type is called "Momentary Dimmer and it would appear near the bottom of the list. The device list in not quite in alphabetical order. The original device types are, but any custom device types appear near the bottom of the list.

Once you edit the device types of your switches to either the ones listed above, the you need to find and install my app from your phone app. In the phone app select the last icon and the bottom of the screen that looks like the sun. On that screen you will see Things and SmartApps at the top of the page. Select the SmartApp option. Then scroll to the bottom of the page and select My Apps. On that page you should see a list of smart apps that have been published to your app list. Select the app that you published in the IDE for the SetPoint.

If you only save and not published your app in the IDE, go back there ans select the "My SmartApps" link and fine the app. Open that link and when the code appears click the publish button on the upper right portion of the screen.

As for the Echo integration, the Echo can only interact with switches and dimmers, so using virtual ones brings the control through the Echo. Also to add SmartThings to the Echo, you need to go into the Echo settings via the app or website and go to Home Automation. From there you should see the SmartThings option. Select that and follow the prompts to select the switches that can be used by the Echo. Once that selections is done either push the Discover my devices link in the app or ask the Echo to discover you devices.

I do not have V2 hub yet, but no has come to me with capability issues yet.

Let me know if you need more information.


(Jeremy Bryant) #65

Thanks - I think I'm almost there. I've created the two devices for heat / air but based on your recent reply I'm confused on whether I paste your code into the "My Device Types" or "My Smart Apps" sections of the IDE or both. I ended up with it in both, went through the MyApps section and configured it. Alexa can see the devices but says that command isn't available on "insert my device name here".. I created two and named them "Heat" and "Air".


(Darc Ranger) #66

In the IDE paste my SmartApp to control the thermostat under your smartapps. Paste my device code "Momentary Dimmer" into your Device types. The IDE will give you an error message if the code is entered in the wrong location. The phone app will let you populate the app with your selection of thermostat and switches.


(Jeremy Bryant) #67

I really appreciate all the hand holding - I've often thought I was fairly technical until I started trying to figure this stuff out.

I've pasted "DR: Thermostat Setpoints: V-Momentary Dimmers v2.1" into My Device Types and "DR: Thermostat Mode/Fan:V-Switches v1.1" into "My SmartApps". I've also created two devices named "Air" and "Heat" that are set up as "Momentary Button Tile". All are published and assigned to my only location / hub.

I've opened the "My Smart Apps" section of the iPhone App and selected the "Heat" switch and "Air" switch I created for their corresponding switches in the App setup. I left the "Auto" section blank. I've selected my thermostat labeled "Downstairs Thermostat" which is controllable through the ST hub on it's own.

I've had Alexa search new devices and it can see 4 devices (two are fans I have on Z-Wave switches). The other two devices are the "Air" and "Heat" switches. When I say "Alexa, set Air to 70" it tells me "That command doesn't work on device Air".

I feel like an idiot :smiley:

What did I screw up?


(Darc Ranger) #68

Only thing I can think of is not saying degree or say turn instead of set?


(Jeremy Bryant) #69

Thanks for all the support. I will mess around with it and see what I come up with.


(Stephen) #70

My Alexa control recently stopped working. The momentary switch is reflecting the correct percentage. For some reason th thermostat never receives the command. Any suggestions?


#71

Fantastic job! I've been thinking of getting a nest or ecobee thermostat. Do you think a program like yours could control either of these thermostats with echo? I've been trying forever to figure this out for myself and eventually my Mother who is getting older and needs help moving about the house. If I could figure out how to connect echo to a thermostat it would help tremendously!


(Darc Ranger) #72

@drake0508,

If it was once working there are a few basic steps to try. The only thing I can think to check is to verify if you selected regular setpoint or the quickset option. Also ask Alexa to rediscover you devices. The other option could be delete install app and re-install with rediscovery by Alexa.


(Darc Ranger) #73

@Jwjbs,

I have been told ecobee works with this, although I do not know which version they have. Nest should work, if it can use the HeatSetpoint and CoolSetpoint commands. No one has gotten back to me about using it with Nest. If not I can try to look into the code to see what commands they are using, and try to add that command option, like I did with the quickSet option.