Better (different) Thermostat Device

can you tell me how to get to the web-based IDE?

Sorry - should have added that: http://ide.smartthings.com

Is there documentation for this process? I have no idea what to do next.

Cancel that. I don’t know how I did it but it worked! thanks.

@wackware, thank you for this code, it was exactly what I was looking for.

But there appears to be a bug in the way it handles Celsius temperatures. It looked like it was working but when it first ran but I tried to increase my cooling level and it jumped to down to 10 degrees. The problem is because the device returns temperatures in celsius and the code compares them against farenheit values.

Attached is a diff which fixed the problem for me. I’m not sure it’s the most elegant solution - I might look at converting celsius to farenheit on the way in and having the tile display celsius - but it worked for me.

--- better-thermostat.orig.groovy	2014-06-25 00:14:05.883380153 -0400
+++ better-thermostat.groovy	2014-06-25 00:15:34.851714180 -0400
@@ -135,11 +142,16 @@
 	}
 }
 
+def toTemperature(degreesF) {
+    return state.scale == 1 ? degreesF : fahrenheitToCelsius(degreesF)
+}
+
 def coolLevelUp(){
     int nextLevel = device.currentValue("coolingSetpoint") + 1
     
-    if( nextLevel > 99){
-    	nextLevel = 99
+    def max = toTemperature(99)
+    if( nextLevel > max){
+    	nextLevel = max
     }
     log.debug "Setting cool set point up to: ${nextLevel}"
     setCoolingSetpoint(nextLevel)
@@ -148,8 +160,9 @@
 def coolLevelDown(){
     int nextLevel = device.currentValue("coolingSetpoint") - 1
     
-    if( nextLevel < 50){
-    	nextLevel = 50
+    def min = toTemperature(50)
+    if( nextLevel < min){
+    	nextLevel = min
     }
     log.debug "Setting cool set point down to: ${nextLevel}"
     setCoolingSetpoint(nextLevel)
@@ -157,9 +170,10 @@
 
 def heatLevelUp(){
     int nextLevel = device.currentValue("heatingSetpoint") + 1
-    
-    if( nextLevel > 90){
-    	nextLevel = 90
+
+    def max = toTemperature(90)
+    if( nextLevel > max){
+    	nextLevel = max
     }
     log.debug "Setting heat set point up to: ${nextLevel}"
     setHeatingSetpoint(nextLevel)
@@ -167,9 +181,10 @@
 
 def heatLevelDown(){
     int nextLevel = device.currentValue("heatingSetpoint") - 1
-    
-    if( nextLevel < 40){
-    	nextLevel = 40
+
+    def min = toTemperature(40)
+    if( nextLevel < min){
+    	nextLevel = min
     }
     log.debug "Setting heat set point down to: ${nextLevel}"
     setHeatingSetpoint(nextLevel)
@@ -374,7 +389,7 @@
 def setHeatingSetpoint(Double degreesF) {
 	def p = (state.precision == null) ? 1 : state.precision
 	delayBetween([
-		zwave.thermostatSetpointV1.thermostatSetpointSet(setpointType: 1, scale: 1, precision: p, scaledValue: degreesF).format(),
+		zwave.thermostatSetpointV1.thermostatSetpointSet(setpointType: 1, scale: state.scale, precision: p, scaledValue: degreesF).format(),
 		zwave.thermostatSetpointV1.thermostatSetpointGet(setpointType: 1).format()
 	])
 }
@@ -386,7 +401,7 @@
 def setCoolingSetpoint(Double degreesF) {
 	def p = (state.precision == null) ? 1 : state.precision
 	delayBetween([
-		zwave.thermostatSetpointV1.thermostatSetpointSet(setpointType: 2, scale: 1, precision: p,  scaledValue: degreesF).format(),
+		zwave.thermostatSetpointV1.thermostatSetpointSet(setpointType: 2, scale: state.scale, precision: p,  scaledValue: degreesF).format(),
 		zwave.thermostatSetpointV1.thermostatSetpointGet(setpointType: 2).format()
 	])
 }

Steve

@sherrell,

Yeah, I did not test or implement any handling of Celsius devices in that hack. Thanks for picking it up. Let me know how it works over time.

Twack

This one looks pretty cool.

I loaded this code last night and it works great. I’m just starting to learn how to change the programming of devices. Is there anyway to have fan icon change colors or animate with rotation when the fan is operational?

Thanks

Thanks sherrell! I could never get this to work and I new it was a Celcius conversion issue. I messed with the C numbers but could never get it to work properly. Works like a charm now, no more slider, Woohoo!

Just added this device. Worked perfect.

Those sliders were driving me nuts. I’m surprised that they still haven’t changed the sliders after all this time. They are incredibly difficult to use.

I much prefer TWack’s thermostat. I’m sorry if someone has already addressed this, but I can’t find an answer. Is there code I can add to Better Thermostat to have it run off of my motion sensor temperature rather than the temperature read at my thermostat?

@spec485

I use Keep Me Kozy II. You may also need the Pollster polling daemon because every once in a while it seems not to update the temperature.

Thanks, I’ll check it out. Am I correct that Keep Me Kozy II will only allow for predetermined settings (Home/Away) rather than manual adjustments that I can make from the thermostat app. I am trying to be able to control the temperature based on temperature and comfort of the room we are in rather than where the thermostat is.

That is what it does, it ignores the thermostat temperature.

I’m no longer able to change my fan setting. In the logs it says:

warn Unexpected zwave command ThermostatFanStateReport(fanOperatingState: 0, reserved01: 0)

This warning has always been there but before I was able to change my fan to circulate.

I looked at the code but can’t seem to find where this is happening.

Has anyone or @wackware added the ability to cycle the HVAC fan either randomly, scheduled or by a existing temperature sensor temperature? I was going to attempt to write a smart app but decided that it would likly interfere with this device type in that the app would turn the fan on and this app would turn it right back off.

Cycling the fan should better circulate home air temps and allow the AC to run less often. Many thermostats have this built in these days.

I also made a post a few days ago because I’d like the ability to turn on a switch when the AC is running and off when it’s not running.

Anyone else having issues on Android with not being able to change the temperature? I press the button, but it doesn’t even indicate that it’s being pushed.

If your using Celsius then it doesn’t work, only works for that old, antiquated F system :slight_smile:
There is an updated version from another use that works for C if that’s where you are.

If you had said Metric and whatever the heck the US uses I would have agreed with you, but F is better system for temperature measurement for most parts of the earth. Just didn’t catch on.

I prefer Kelvin, 0 should be the coldest it can get…

2 Likes