# Help making most basic app ever: select thermostat setpoints for both above and below a specific sensor's reading

**URL:** <https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855>\
**Category:** Automation Ideas\
**Created:** [May 20, 2018, 1:34pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855 "2018-05-20T13:34:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 1:34pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/1 "2018-05-20T13:34:28Z")

</div>

Hi.

I’ve been suspecting it for a while, but I’m starting to become convinced I’m actually a moron. I’ve been trying on and off for 3 years now to get an app to do something that I see as super basic but I can’t get anywhere with it. Everything I edit breaks. Nothing seems to work. I don’t get it.

I want to make a smartapp that:

1. Asks you to select a temperature sensor
2. Asks you for the temperature you want to keep that sensor below
3. Asks you to select a thermostat
4. Asks you to set the cooling setpoint when the temperature sensor is above the temp in 2.
5. Asks you to set the cooling setpoint when the temperature sensor is below the temp in 2.

That’s it. That’s all. I’ve been trying for years and I can’t crack that nut. I suck.

---

<div class="post-metadata">

**Author:** ![Bry](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@Bry](https://community.smartthings.com/u/Bry)\
**Post date:** [May 20, 2018, 1:38pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/2 "2018-05-20T13:38:53Z")

</div>

Do you contantly need to select the sensors and thermostats on the fly, or do you just need to select them once?

If you can hard code the sensors and thermostats, you can easily do that in webCore.

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 1:39pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/3 "2018-05-20T13:39:46Z")

</div>

Everything set once on setup, then it just sits there and runs until the hardware breaks.

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [May 20, 2018, 1:56pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/4 "2018-05-20T13:56:20Z")

</div>

Sorry, I’m confused about the purpose of your points four and five.

Why do you need two different setpoints, one for when the sensor reading is higher than your target and one for when the sensor reading is lower?

Why don’t you just have a target temperature on the sensor and turn on the air-conditioner if the temperature is higher than that? That’s a classic thermostat.

I agree that it’s likely that webcore can do everything that you were asking for, I’m just not quite sure what you are asking for. 🕶

> [@FAQ: What is WebCoRE? (And what was CoRE?)](https://community.smartthings.com/t/faq-what-is-webcore-and-what-was-core/59981):
>
> CoRE (now WebCore) is a very powerful community – created rules engine for SmartThings. It allows you to set up stacked conditionals like “If A then B but only while C and not if D.” Setting it up can be quite complex, but there are many community members who will be glad to help you. For example, here is a piston that one member created to notify him if the dog had already been fed twice that day and he picked up the dog bowl for a third time. He needed this because he has a large family and people didn’t always remember whose turn it was to feed the dog. dogblush [image] The original version of CoRE Has now been replaced by a new version, WebCoRE, which moves the data entry to a web interface. This allows for flexibility and an architecture that requires more memory than is av…

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 3:00pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/5 "2018-05-20T15:00:42Z")

</div>

I’ve tried setting up and building it in webcore. Now I just need to figure out how to get the code out of webcore and into smartthings so it actually updates the setpoint on the t-stat. Feels like progress. I can’t find anything that shows me how to get the code out though.

The points for 4 and 5 is I don’t want to give cart blanche control to another temp device. Smartthings in my experience is a really unrobust platform. I don’t want to have a simple loss of internet connectivity putting the AC on full throttle full time and trying to make icecubes in my livingroom. The solution is basically the temp sensor saying it’s warm and putting the AC set point to some lower but still reasonable level either until it’s not warm or whatever it gets with the lower setpoint.

---

<div class="post-metadata">

**Author:** ![HA\_fanatic](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ha_fanatic/32/93722_2.png) [@HA\_fanatic](https://community.smartthings.com/u/HA_fanatic)\
**Post date:** [May 20, 2018, 3:01pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/6 "2018-05-20T15:01:53Z")

</div>

> [@davekeil](#):
>
> I’ve been trying for years and I can’t crack that nut. I suck.

What have you tried and didn’t work? Post the code you have and people might be able to help. Or search the community for similar apps and follow their code. What you are asking has been done many times before.

[Thermosts app search]([Search results for 'Thermostat' - SmartThings Community](https://community.smartthings.com/search?context=topic&context_id=13599&q=Thermostat) manager&skip\_context=true)

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 3:04pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/7 "2018-05-20T15:04:11Z")

</div>

Send me a link to something that’s remotely close. I’ve searched the community and tried various code snippets for 8+ hours every 3-4 months. I’m finding a lot of things are broken now. Keep Me Cosy II doesn’t work anymore for example.

---

<div class="post-metadata">

**Author:** ![HA\_fanatic](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ha_fanatic/32/93722_2.png) [@HA\_fanatic](https://community.smartthings.com/u/HA_fanatic)\
**Post date:** [May 20, 2018, 3:05pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/8 "2018-05-20T15:05:49Z")

</div>

> [@davekeil](#):
>
> to something that’s remotely close.

Don’t know why the link breaks, but search for thermostat manager. Those are all apps that change setpoints.

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 3:12pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/9 "2018-05-20T15:12:00Z")

</div>

![image](https://global.discourse-cdn.com/smartthings/original/3X/d/7/d7034f05049f88c0afe5c5229342764fe92b9d6d.png)

I’ve made this in webcore. I don’t see how to get it to start executing and updating the tstat settings.

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 3:16pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/10 "2018-05-20T15:16:28Z")

</div>

jmarkwell : Thermostat Manager

doesn’t use any external temp sensors. I’m not actually sure what the use case of that app is.

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 3:20pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/11 "2018-05-20T15:20:00Z")

</div>

> [@Keep Me Kozy2 change needed](https://community.smartthings.com/t/keep-me-kozy2-change-needed/10225/2):
>
> I just wrote this the other day. This works similar to Keep my cozy except it uses the temperature set on the thermostat as the starting point. This means you can use other apps / modes / hello, home commands to switch temperatures at different times / events and this application automatically adjusts. I’ve only written this to work for heating but I’ll make an update over the next few months for AC as well. definition( name: "Climate Control", namespace: "", author: "Craig Lyons", description: "Uses external themostat to run HVAC", category: "My Apps", iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/temp\_thermo.png", iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/temp\_thermo@2x.png", iconX3Url: "https://s3.amazonaws.com/smartapp-icons/M…

This one throws some kinda of “can’t subscribe to null events” error on line 50 that I don’t understand.

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [May 20, 2018, 3:26pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/12 "2018-05-20T15:26:31Z")

</div>

Webcore has their own forum where most of the experts hang out. They should be able to help you. ( this is a clickable link)

[https://community.smartthings.com/t/introducing-the-new-webcore-community-forum/96259](https://community.smartthings.com/t/introducing-the-new-webcore-community-forum/96259)

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 3:32pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/13 "2018-05-20T15:32:28Z")

</div>

Thanks JDRoberts - I’ll follow up with the webcore thread over there. I would still like to have something in the smartthings IDE naively.

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 4:06pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/14 "2018-05-20T16:06:03Z")

</div>

I’ve tried editing 'It’s too cool" to be it’s too hot. I still get the null error on line 50 I don’t understand.

definition(  
name: “Climate Control Cool II”,  
namespace: “”,  
author: “Dave Keil”,  
description: “Uses external themostat to run HVAC”,  
category: “My Apps”,  
iconUrl: “[https://s3.amazonaws.com/smartapp-icons/Meta/temp\_thermo.png](https://s3.amazonaws.com/smartapp-icons/Meta/temp_thermo.png)”,  
iconX2Url: “[https://s3.amazonaws.com/smartapp-icons/Meta/temp\_thermo@2x.png](https://s3.amazonaws.com/smartapp-icons/Meta/temp_thermo@2x.png)”,  
iconX3Url: “[https://s3.amazonaws.com/smartapp-icons/Meta/temp\_thermo@2x.png](https://s3.amazonaws.com/smartapp-icons/Meta/temp_thermo@2x.png)”  
)

preferences() {  
section("Choose Thermostat… ") {  
input “thermostat”, “capability.thermostat”

```
}

section("Choose Sensor... " ) {
	input "sensor", "capability.temperatureMeasurement", multiple: false
}

section("Set threshold " ) {
	input "tempThreshold", "decimal"
}

```

}

def installed()  
{  
log.debug “enter installed, state: $state”  
subscribeToEvents()  
}

def updated()  
{  
log.debug “enter updated, state: $state”  
unsubscribe()  
subscribeToEvents()  
}

def subscribeToEvents()  
{  
subscribe(sensor, “Temperature”, sensorHandler)  
subscribe(thermostat, “temperature”, coolingSetpointHandler)  
subscribe(thermostat, “thermostatMode”, coolingSetpointHandler)  
subscribe(thermostat, “coolingSetpoint”, coolingSetpointHandler)

```
state.realCoolSetPoint = thermostat.currentCoolingSetpoint
state.tempCoolSetPoint = thermostat.currentCoolingSetpoint - 2

runIn(5,checkTemp)

```

}

def coolingSetpointHandler(evt)  
{  
log.trace “coolingSetPoint”  
log.info “thermoSetPoint: ‘${thermostat.currentCoolingSetpoint}’ / tempSetPoint: ‘${state.tempCoolSetPoint}’”

```
if (state.tempCoolSetPoint != thermostat.currentCoolingSetpoint)
{
	log.trace "Setting realCoolSetPoint: '${thermostat.currentCoolingSetpoint}'"
    state.realCoolSetPoint = thermostat.currentCoolingSetpoint
}

checkTemp()

```

}

def sensorHandler(evt)  
{  
checkTemp()  
}

def checkTemp()  
{  
def tm = thermostat.currentThermostatMode  
def ctThermo = thermostat.currentTemperature  
def ctSensor = sensor.currentTemperature  
def sp = state.realCoolSetPoint

```
if (needCool())
{
	if (incrCoolSetPoint())
    {
    	state.tempCoolSetPoint = ctThermo - 2
        log.info "Changing Thermostat from '${sp}' to '${state.tempCoolSetPoint}' because sensor is '${ctSensor}'"
        thermostat.setCoolingSetpoint(state.tempCoolSetPoint)
    }
    else
    {
    	log.info "Thermostat set to '${sp}' and current themostat temp is '${ctThermo}'. Not changing anything."
    }
}
else 
{
	if (coolGood() && thermoNotRight()) 
	{
		log.info "Changing Thermostat to '${sp}' because Thermostat is '${ctThermo}' and Sensor is '${ctSensor}'"
    	thermostat.setCoolingSetpoint(sp)
    	state.tempCoolSetPoint = -99
	}
	else
	{
		log.info "Everything is correct"
	}
}

```

}

private coolGood()  
{  
def ctSensor = sensor.currentTemperature  
def sp = state.realCoolSetPoint  
def result=false

```
if (((ctSensor - tempThreshold) <= sp))
{
 	result = true
}
    
log.trace "checking if cool is Good"
log.info "[RETURN: '${result}'] -- ${ctSensor} - ${tempThreshold} ('${ctSensor - tempThreshold}') <= ${sp}"
    
return result

```

}

private thermoNotRight()  
{  
def sp = state.realCoolSetPoint  
def csp = thermostat.currentCoolingSetpoint  
def result = false

```
if (sp != csp)
{
	result = true
}

log.trace "thermoNotRight"
log.info "[RETURN: '${result}'] -- ${sp} != ${csp}"

return result

```

}

private needCool()  
{  
def tm = thermostat.currentThermostatMode  
def ctSensor = sensor.currentTemperature  
def sp = state.realCoolSetPoint  
def result=false

```
    if (((ctSensor + tempThreshold) > sp) && (tm in ["cool","auto"]))
    {
    	result = true
    }
    
    log.trace "checking if we Need Cool"
    log.info "[RETURN: '${result}'] -- ${ctSensor} + ${tempThreshold} ('${ctSensor + tempThreshold}')> ${sp} && ${tm} in ['cool', 'auto']"
    
    return result

```

}

private incrCoolSetPoint()  
{

```
def sp = state.realCoolSetPoint
def ctThermo = thermostat.currentTemperature
def result = false

	
if (ctThermo >= sp)
{
	result = true
}

log.trace "checking if we Need to increase cool"
log.info "[RETURN: '${result}'] -- ${ctThermo} <= ${sp}"

return result

```

}

---

<div class="post-metadata">

**Author:** ![HA\_fanatic](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ha_fanatic/32/93722_2.png) [@HA\_fanatic](https://community.smartthings.com/u/HA_fanatic)\
**Post date:** [May 20, 2018, 4:31pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/15 "2018-05-20T16:31:07Z")

</div>

> [@davekeil](#):
>
> still get the null error on line 50 I don’t understand.

What is on line 50? Can you post that?

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 20, 2018, 4:33pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/16 "2018-05-20T16:33:41Z")

</div>

30db269b-6d24-4858-a759-846c4b0ec4d8 12:32:56 PM: error java.lang.NullPointerException: Cannot invoke method minus() on null object @line 50 (subscribeToEvents)  
30db269b-6d24-4858-a759-846c4b0ec4d8 12:32:56 PM: debug enter installed, state: [:]

state.tempCoolSetPoint = thermostat.currentCoolingSetpoint - 2

---

<div class="post-metadata">

**Author:** ![HA\_fanatic](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ha_fanatic/32/93722_2.png) [@HA\_fanatic](https://community.smartthings.com/u/HA_fanatic)\
**Post date:** [May 20, 2018, 4:44pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/17 "2018-05-20T16:44:20Z")

</div>

> [@davekeil](#):
>
> thermostat.currentCoolingSetpoint

Try latestValue or currentValue followed by (“coolingSetPoint”)…

---

<div class="post-metadata">

**Author:** ![RBoy](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rboy/32/62677_2.png) [@RBoy](https://community.smartthings.com/u/RBoy)\
**Post date:** [May 22, 2018, 12:25am UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/18 "2018-05-22T00:25:29Z")

</div>

Sounds like you’re looking for temperature management app that controls the thermostat using a remote temperature sensor. If you have access to RBoy Apps check out our range of temperature management SmartApps, most of them support remote temperature sensors to use with a thermostat and other heating/cooling devices as well.

Here are a few:

> [@\[RELEASE\] 5-2 Day Programmable Thermostat Scheduler (Weekday, Weekend) with Remote Temperature Sensor for each Schedule](https://community.smartthings.com/t/release-5-2-day-programmable-thermostat-scheduler-weekday-weekend-with-remote-temperature-sensor-for-each-schedule/6780):
>
> This is a [5-2 Day Thermostat with Remote Sensor](http://smartthings.rboyapps.com) Scheduler with advanced features SmartApp This advanced version includes support for using multiple Remote Temperature Sensors (e.g. different rooms) to control the thermostat and also using cooling/heating appliances. (See below for basic version) Key Features Include: 4 schedules per day for weekdays and 4 schedules per day for a weekend Use remote temperature sensors average multiple temperature sensors set target temperature for each schedule or globally for all schedules Use thermostat or heating/cooling appliances (heaters, window A/C, fans, etc) Set fan mode for each schedule Supports tempe…

> [@\[RELEASE\] Mode Based Thermostat - Control Multiple Thermostats Temperature / Remote Temperature Sensors when Changing Modes](https://community.smartthings.com/t/release-ultimate-mode-based-thermostat-control-multiple-thermostats-temperature-remote-temperature-sensors-when-changing-modes/6652):
>
> The [Mode Based Thermostat](http://smartthings.rboyapps.com) SmartApp There are 2 version of this app, the free single mode change app and the premium ultimate mode app with multi modes, remote sensors and more The Ultimate Mode Change Thermostat Temperature (premium) This is the utmost flexible app for configuring thermostats and mode changes.This app can be used to change the temperature of multiple thermostats when the mode is changed. KEY FEATURES Compatible with a variety of thermostats including Z-Wave, ZigBee, WiFi and C2C thermostats Configure multiple thermostats individually or in groups (single mode) Configure settings for each mode individually or in groups Support for multiple remote temperature sensors, per thermostat or grouped Support for temporary hold Open door/window sensor (to shutdown down HVAC) Veri…

> [@\[RELEASE\] Motion Sensor Thermostat with Remote temperature sensors, Presence detection and Schedules](https://community.smartthings.com/t/release-motion-sensor-thermostat-detect-presence-based-temperature/6929):
>
> A [Motion Sensor based Thermostat](http://smartthings.rboyapps.com) SmartApp with advanced features This thermostat app features the ability to turn on a thermostat only when motion is detected. It also allows the use of Remote Temperature sensors. You can define a target operating mode temperature (Heat/Cool) and Idle mode temperatures and a active period. It works with any thermostat that complies with SmartThings thermostat capabilities. (See below for a detailed list of features) [IMG\_2220] [IMG\_2221] Key Features of Advanced Version of app: Set operating and idle heat/cool temperatures Set active detection period (minutes) Supports multiple motion sensors Use remote temperature sensors to set target operating temperature Flexible operating schedule Modes Days of week with Start/End times Battery saver mode Wo…

> [@\[RELEASE\] Humidity and Temperature Management with Scheduling (homes without HVAC/thermostats / using heaters and cooling appliances / vacation home / remote homes)](https://community.smartthings.com/t/release-humidity-and-temperature-management-with-scheduling-homes-without-hvac-thermostats-using-heaters-and-cooling-appliances-vacation-home-remote-homes/35556):
>
> [Humidity and Temperature Management with Scheduling](http://smartthings.rboyapps.com) Automatically manage and schedule the climate (humidity and temperature) for your rental homes and vacation homes using HVAC’s, heaters, coolers, fans, humidifiers, dehumidifiers and more appliances. Also useful for older homes without a thermostat or for rooms which have heating and cooling appliances in them with no HVAC or homes with WiFi thermostats. See below for a full list of features: FEATURE SUMMARY: Use different devices to control temperature Thermostats Heaters Cooler/fans Use different devices to control humidity HVAC’s Humidifiers Dehumidifiers/exhaust fans Temperature Management Set high/low temperature thresholds Set high/low humidity thresho…

---

<div class="post-metadata">

**Author:** ![craig](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/craig/32/100014_2.png) [@craig](https://community.smartthings.com/u/craig)\
**Post date:** [May 28, 2018, 8:47pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/19 "2018-05-28T20:47:08Z")

</div>

I see you are using some old code I wrote a million years ago. It’s been a long time since I looked at this code, but I Can tell you I had to re-write it several times (no idea where the latest version is) before it even remotely started working correctly. Many times I work up to the house being 80 degrees in the dead of winter because I got stuck in a loop.

I’d hate for you to spend a ton of time looking at some cut rate code I wrote 3-4 years ago!

---

<div class="post-metadata">

**Author:** ![davekeil](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/davekeil/32/56347_2.png) [@davekeil](https://community.smartthings.com/u/davekeil)\
**Post date:** [May 28, 2018, 9:29pm UTC](https://community.smartthings.com/t/help-making-most-basic-app-ever-select-thermostat-setpoints-for-both-above-and-below-a-specific-sensors-reading/126855/20 "2018-05-28T21:29:47Z")

</div>

Thanks for following up craig.

I’ve got something working through WebCoRE, it took ages because some changes I made to the tstats DTH broke the setpoint setting function in apps.
