How to handle a fan through the temperature.

Hello, Am designing my domotic home and I’m asking for help on a part …
For example: Ago 30 °C and want my house to this constantly at 25 °C, Run a fan and the temperature drops to 25°.
This is the code I’m working:

#include <dht11.h>

dht11 DHT11;

void setup() 
{
  Serial.begin(9600);
}

void getdata(int iPuerto)
{
  int chk = DHT11.read(iPuerto);

  Serial.print("Sensor ");
  Serial.print(iPuerto);
  Serial.print(" ");
  switch (chk)
  {
    case 0:   
      Serial.print((float)DHT11.humidity, 2);
      Serial.print(" % ");
      Serial.print((float)DHT11.temperature, 2);
      Serial.println(" o C");
        break;
    case -1: Serial.println(" Checksum error"); break;
    case -2: Serial.println(" Time out error"); break;
    default: Serial.println(" Unknown error"); break;
  }

  
}

void loop() 
{
  getdata(2);
  delay(200);
}

I'm going to provide "too much" information because PID controllers are a complex subject. You can oar down the concept and adapt it to your needs. https://groups.google.com/forum/#!topic/diy-pid-control/ucNXtYd7XxM

But, read thus first: http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/ To build a bit of background.

Ray