 /****************************** Topics ***************************************/
 // Setup a feed called 'photocell' for publishing.
 // Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
-Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/photocell");
+Adafruit_MQTT_Publish temp_topic = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/temp");
 /****************************** Subscriptions*********************************/
 // Setup a feed called 'photocell' for subscribing to changes.
-Adafruit_MQTT_Subscribe photocell_subsc = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/photocell");
+Adafruit_MQTT_Subscribe temp_subscription = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/temp");
 
 /***************************  MQTT Conn   ************************************/
 
 // Bug workaround for Arduino 1.6.6, it seems to need a function declaration
 // for some reason (only affects ESP8266, likely an arduino-builder bug).
 void MQTT_connect();
+
+/*************************** DHT Init   **************************************/
+// Initialize DHT sensor
+// NOTE: For working with a faster than ATmega328p 16 MHz Arduino chip, like an ESP8266,
+// you need to increase the threshold for cycle counts considered a 1 or 0.
+// You can do this by passing a 3rd parameter for this threshold.  It's a bit
+// of fiddling to find the right value, but in general the faster the CPU the
+// higher the value.  The default for a 16mhz AVR is a value of 6.  For an
+// Arduino Due that runs at 84mhz a value of 30 works.
+// This is for the ESP8266 processor on ESP-01
+DHT dht(DHTPIN, DHTTYPE, 11); // 11 works fine for ESP8266
+/*************************** DHT Data   **************************************/
+//float humidity, temp_f;  // Values read from sensor Fahrenheit
+float humidity, temp_c;  // Values read from sensor as Celsius
+String tempString = "";   // String to display
+/*************************** DHT Timing   ************************************/
+// Generally, you should use "unsigned long" for variables that hold time
+unsigned long previousMillis = 0;        // will store last temp was read
+const long interval = 2000;              // interval at which to read sensor
 
 /****************************** Setup  ***************************************/
 void setup() {

  }
  Serial.println("MQTT Connected!");
}

  Serial.println("IP address: "); Serial.println(WiFi.localIP());

  // Setup MQTT subscription for onoff feed.
  mqtt.subscribe(&temp_subscription);
}

//uint32_t x=0;    // Mock data

/****************************** Loop  ***************************************/
void loop() {
  gettemperature() ;
  // Ensure the connection to the MQTT server is alive (this will make the first
  // connection and automatically reconnect when disconnected).  See the MQTT_connect
  // function definition further below.
