No help with your rule, but for an already made thermostat (with safety measures)... This is what I use with my office space heater.