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

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?

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.

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

@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.

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?

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.

Awesome, thank you , I will give it a go

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

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

“Alexa, set thermostat to 72”

Absolutely amazing

1 Like

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.

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!

I was hoping for some time savings and shorting sone processing steps by using another method for on/off. Have you notes any decrease in response time?

Plus I did like the on off visual for a virtual device that was just glorified slider.

I also have another non thermostat app I am thinking about that could that new switch.

1 Like

That’s cool, I was just curious. I am still learning about all the different buttons. I can test the time tomorrow, everyone is sleeping now…lol

@swindmiller,

Whose/Which device type are you using with your thermostat? I am not sure if these are custom commands or build in options.

The one I am using has two command methods to change the setpoint. The one the app uses have a 30-40 second delay before updating code. There another command code that changes the thermostat much faster. My modified code that I am testing now has about 1 or 2 second delay once the dimmer switch is changed for the thermostat to update. I have an inquiry out to the community to see what the risk/benefits are to switch to the faster command. This way only the app is changed and not the device type for the thermostat or dimmers.

If things turn out OK to switch, I will update both the standard dimmer option app and the momentary dimmer app. Although, I may consider one app with the option to use either dimmer device type

I am using a CT101 which I believe is just a lowes brand of the ct100 and the device type from here:

The 40 second delay is really not that big of a deal but quicker is always better though :smile:

OK we both have the same device and use the same device type.
I chatted with RBoy and he said there is no issue using the setQuick commands. I will update both the setpoint app using the regular dimmer and the new momentary dimmer this evening on gitHub.

1 Like

Sweet!!! Thanks for all your hard work!

The new versions of the Thermostat Setpoints apps are in my gitHub repository. The links above should take you to the updated files.

The original app uses the regular dimmer device type. The alternate version of the app uses the new/custom device type, Momentary Dimmer".

1 Like

Ill try it out tonight

@DarcRanger- this should work the same with the Ecobee 3 correct? I am using it on the stock device type but when I tell Alexa to change it, the command never makes it to the thermostat. It does show the action in the hello home section though except it only shows the set point for heat. Any ideas? It’s probably something I did wrong