[OBSOLETE] New Virtual Thermostat With Device

Any way to put a limit on time it runs, or perhaps setup notifications if running longer then a specified time period?

1 Like

Any chance you could post more info about you homegrown ESP8266 thermostat?

I use a couple - DHT22 and DS1821, I am using them ST_Anything. Its a fairly straight forward setup 3 wires, power, ground and data pin goes to any of the GPIO pins. Then rest of the magic is in ST_Anything, just read the instructions in that thread and code examples

1 Like

Gotcha, those should be easy enough to throw together.

Has there been any headway on using this for cooling, for Window Air Conditioners?

Our home has several window units, and I’d like the ability to use a thermostat tile in ActionTiles to control the window units, or use Alexa to adjust the temperature.

1 Like

I modified mine to work, but just quick and dirty for now.

It’s two lines to change in the “Virtual Thermostat with Device” smart app. I’ve included them below. Each line is preceded with its original commented out with //. Note that this is dirty in that the whole UI still displays as if you were heating but instead it turns on the device if the sensor temp is above the setpoint.

//if ( (desiredTemp - currentTemp >= threshold)) {
if ( (desiredTemp - currentTemp <= threshold)) {
heatingOn()
// } else if ( (currentTemp - desiredTemp >= threshold)) {
} else if ( (currentTemp - desiredTemp <= threshold))

4 Likes
private evaluate(currentTemp, desiredTemp)
{
	log.debug "EVALUATE($currentTemp, $desiredTemp)"
	// heater
	//if ( (desiredTemp - currentTemp >= threshold)) {
	if ( (desiredTemp - currentTemp <= threshold)) {
		heatingOn()
	//	} else if ( (currentTemp - desiredTemp >= threshold)) {
	} else if ( (currentTemp - desiredTemp <= threshold))
		heatingOff()
	} else if(state.current == "on") {
        updateTimings()
    }
}

I get an error on this with line 182, the line reads:
} else if(state.current == “on”) {

Do I remove this line? I have no coding experience, so I’m not sure what to do.

1 Like

I think I got it… Missing a { at the end of the modified line.

1 Like

So I’m noticing that the units aren’t cycling off at all, even with the modified code.

Is there a way to convert the entire device/smartapp to cooling only?
Is it as simple as replacing every instance of “heat” or “heating” with “cool” or “cooling” respectively?

Reversing the logic for the on/off in the modified code makes sense, but beyond that I get lost in syntax, so I don’t know what to change.

Finally, the thermostat temperature shows in F, but the adjustment for the thermostat shows in C. Any way to make it all F for us US savages?

1 Like

Line 161 of the DTH and down has the Centigrade/Fahrenheit adjustment.

def shouldReportInCentigrade() {
//there is no way to do this dynamically right now, a number of the functions that call this function are compile time evaluated :(
return false //Set this to true for Centigrade, false for Fahrenheit  so that enums and colors are correct (due to ST issue of compile time evaluation)
/*try {
	def ts = getTemperatureScale();
	retVal = ts == "C"
} finally {
	return retVal
}*/

I’d like to echo the request for cooling support, and tweak the temperature setpoint to allow for 0.1 increments.

@eliotstocker happy to help with the above to the best of my ability, feel free to pm me!

Exactly what I am looking for using door sensor and temperature sensor to turn heater switch on/off.

Hi All :slight_smile: Great looking app, will come in handy for sure but now, being one of the hottest summers EVER in Belgium for me, Cooling mode would be fantastic! Any news when thats ready or being worked?

I like your thinking :slight_smile:

+1 on this - I’d like the heater option to be made optional too. My use case would be reporting only, it would be great if this could be implemented :slight_smile:

Sorry to be a bit dim, but can someone explain how to set this up. I’ve copied the code for both device type handler and smartapp and published it. I added the device from within the IDE. Then the smart app from within smartthings app on my phone. When I add the app I get a page that says Thermostat Manager, Devices, New Thermostat. If I click on “New Thermostat” it just hangs waiting for ages then does nothing. I can click save.
I see the thermostat device, but don’t see how it works.
I was expecting at some point to say which device I am using to measure the temperature and which device it swhould turn on and off but haven’t done that anywhere.
I guess I’m missing something basic about the installation and setup process.

1 Like

same issue; doesn’t appear to work; creates the virtual thermostat and captures the temperature from the sensor, but doesn’t record or save or allow me to set values / temp for the threshold

Anybody having issues with this? It doesn’t seem to turn off my heater outlet or turn it on.

It’s working for me. though I have been screwing with it for days. I finally just linked the repository then imported it and over wrote the piratemedia/smartthings : Virtual Thermostat With Device code with this

saved and published then

modified the handler to have this code at line 163 to get fahrenheit

return **false** //Set this to true for Centigrade, false for Fahrenheit  so that enums and colors are correct (due to ST issue of compile time evaluation)

Very happy to find this solution!

Though, it does not seem to respect the “Door open” function. It just keeps on heating to the set temp even if the door is open. Anyone any thoughts on this?

Thanks!