   delay(10);
   Blynk.begin(auth);
   Bridge.begin();
+
+  pubSubClient.setServer("<MQTT-SERVER>", 1883);
 
   timer.setInterval(10 * 1000, sendValues); //every 10 seconds
 }

#include <Bridge.h>
#include <BridgeClient.h>

BridgeClient client;

#include <BlynkSimpleYun.h>

#define VPIN_HUMIDITY V1
#define VPIN_TEMP V2

char auth[] = "<BLYNK-AUTH-KEY>";

#include <SimpleTimer.h>

SimpleTimer timer;

#include <DHT.h>
#include <DHT_U.h>
#include <Adafruit_Sensor.h>

#define DHTPIN 2
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"

#define AIO_SERVER      "<MQTT-SERVER>"
#define AIO_SERVERPORT  1883

#define ROOT_TOPIC "arduino/yun"

Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT);
Adafruit_MQTT_Publish yun = Adafruit_MQTT_Publish(&mqtt, ROOT_TOPIC);
Adafruit_MQTT_Publish humidity = Adafruit_MQTT_Publish(&mqtt, ROOT_TOPIC "/humidity");
Adafruit_MQTT_Publish temperature = Adafruit_MQTT_Publish(&mqtt, ROOT_TOPIC "/temperature");
Adafruit_MQTT_Publish heatIndex = Adafruit_MQTT_Publish(&mqtt, ROOT_TOPIC "/heatIndex");

void setup()
{

  Blynk.virtualWrite(2, (int)t);
  Blynk.virtualWrite(3, hic);

  String payload = "{\"humidity\":";
  payload += (int)h;
  payload += ",\"temperature\":";
  payload += (int)t;
  payload += ",\"heatIndex\":";
  payload += hic;
  payload += "}";
  int payload_length = payload.length() + 1;
  char payload_data[payload_length];
  payload.toCharArray(payload_data, payload_length);
  pubSubClient.publish(ROOT_TOPIC, payload_data);

  String humidity = String((int)h);
  int humidity_length = humidity.length() + 1;
  char humidity_data[humidity_length];
  humidity.toCharArray(humidity_data, humidity_length);
  pubSubClient.publish(ROOT_TOPIC "/humidity", humidity_data);

  String temperature = String((int)t);
  int temperature_length = temperature.length() + 1;
  char temperature_data[temperature_length];
  temperature.toCharArray(temperature_data, temperature_length);
  pubSubClient.publish(ROOT_TOPIC "/temperature", temperature_data);

  String heatIndex = String(hic);
  int heatIndex_length = heatIndex.length() + 1;
  char heatIndex_data[heatIndex_length];
  heatIndex.toCharArray(heatIndex_data, heatIndex_length);
  pubSubClient.publish(ROOT_TOPIC "/heatIndex", heatIndex_data);
}

void loop()
{
  if (!pubSubClient.connected()) {
    reconnect();
  }
  pubSubClient.loop();

  Blynk.run();
  timer.run();
}

void reconnect() {
  // Loop until we're reconnected
  while (!pubSubClient.connected()) {
    // Attempt to connect
    if (!pubSubClient.connect("arduinoYun")) {
      // Wait 5 seconds before retrying
      delay(5 * 1000);
    }
  }
}
