Temperature Sensor Subscriptions

Hi everyone! I am having some difficulty getting events related to the temperature sensor to work. Any help? I have my code here. It is supposed to turn a fan on when a temperature is too hot:

Sorry that the last part got cut off. It basically says else turn the switch off. When i run the program, nothing happens. :frowning:

Take a look at this code. It is available in the Marketplace by the way under SmartApps -> Climate Control -> Virtual Thermostat. I think it does what you are asking it to do.