Could you use Mariano’s virtual thermostat tied to a sensor (ZigBee sensor version here: (EDGE Driver-Mc): Zigbee Temp Sensor and Child Thermostat Mc, Zigbee Temp Sensor with Thermostat Mc), and then create routines to tie the actions of the virtual thermostat to turn on and off a plug?
He has a zwave sensor version of the same driver if needed.