Virtual Thermostat utilising a temperature sensor to control a device (enhanced)

Hi all,

This code is based on the excellent work that Eliotstocker has done here:

Full credit and recognition to him :slight_smile:

Forgive me give, as I am new to Smartthings and groovy(?), so I have probably done something wrong …

I have only tested this for a UK based heating system (ie: for heat only and in centigrade, we don’t really use cooling here).

I have added/corrected the following to Eliots version:

Timed zones - Now supports 4 time zones for weekdays and 4 time zones for weekends
Presence aware - Will change the temperature if everyone leaves (after a predetermined time) and resets it if someone returns
Contact senor - Will change the temperature if a contact sensor is open (and resets it if closed)
Motion aware - Will change the temperature if it detects no motion (after a predetermined time) and resets it if motion is detected
Minimum (frost) temperature - Even if the heating is off, if the temperature drops below this value then the heating turns on
Minimum on time - Will keep the outlet/boiler on for a minimum period of time
0.5 degree temperature support
Boost mode - Will temporarily increase the temperature by a set amount for a configurable time period
Adjustable temperature variation - Allows the user to specify the amount the temperature can deviate from the set temperature before triggering the outlet
Classic App - Has a label/field that displays the state of the thermostat (Away/Motion/Presence/Zone,/etc)
User override - If a user alters the zone temperature, then that temperature is remembered until the next zone change (even the thermostat changes temp because of Away/No motion/Open contact then it restores the temperature to the user custom one and not the zone specified one.

I’m purely posting this here as a basis for someone to enhance/modify/use :slight_smile: