 
 PubSubClient client(mqtt_server, 1883, callback, wifiClient);
 
+//
 volatile float H, T1, T2, OT, PW;
 volatile int NW, PIR, HO, HL, unihost, rsphost, unitot, rsptot;
+volatile bool T2_UPDATE, OT_UPDATE, PW_UPDATE, NW_UPDATE, PIR_UPDATE, HO_UPDATE, HL_UPDATE;
 volatile bool msgcallback;
 
+//
 int sleepmode = LOW ;
 int o_sleepmode = LOW ;
 


  if ( receivedtopic == substopic[0] ) {
    if (root.containsKey("DS18B20")) {
      T2  = root["DS18B20"];
    }
  }

  if ( receivedtopic == substopic[1] ) {
    if (root.containsKey("data1")) {
      OT  = root["data1"];
    }
  }

  if ( receivedtopic == substopic[2] ) {
    if (root.containsKey("powerAvg")) {
      PW  = root["powerAvg"];
    }
  }

  if ( receivedtopic == substopic[3] ) {
    if (root.containsKey("WeightAvg")) {
      NW  = root["WeightAvg"];
    }
  }

  if ( receivedtopic == substopic[4] )
  {
    if (root.containsKey("DOORPIR")) {
      PIR = root["DOORPIR"];
    }
  }


      rsptot = atoi(temprsptot);
    }
  }

  if (HO != (unihost + rsphost)) {
    HO = unihost + rsphost;
    HO_UPDATE = true;
  }

  if (HL != (unitot + rsptot)) {
    HL = unitot + rsptot;
    HL_UPDATE = true;

  }

  msgcallback = !msgcallback;
}

