Linking variable to widget to be monitored on Dashboard

Hi All,
Being a new bee, I am trying to link a variable to a temperature gauge in my widget in order , however having problem linking the right code, can anyone please help, I have shared the code on here .
regards

type or paste code here
//
// 

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include "max6675.h"

LiquidCrystal_I2C lcd(0x27,16,2);

volatile unsigned int encoderPos = 60;  // Inital value for set temp 

static boolean MesLessThanSet;
static boolean rotating = false;    // debounce management
// interrupt service routine vars
boolean A_set = false;
boolean B_set = false;

//TemSensor
int CLK = 13;
int CS = 10;
int SO = 12;
int relay = 7;

//Encoder
int dt_pin = 3;
int clk_pin = 2;
int clk_old = 0;

static int SetTemp;
int MesTemp;

MAX6675 temp_sensor(CLK, CS, SO);
struct debState
{
  boolean InpOld;
  int timer;
};
struct debCnt
{
  int LtH;
  int HtL;
};

debState St1 = {0};
debCnt Ct1 = {0};

//Definining Termometer Icon
byte tempchar1[8]={B00000, B00001, B00010, B00100, //Row 0, Col 2
                  B00100, B00100, B00100, B00111,};
byte tempchar2[8]={B00111, B00111, B00111, B01111, //Row 1, Col 2
                  B11111, B11111, B01111, B00011,};
byte tempchar3[8]={B00000, B10000, B01011, B00100, //ROW 0, Col 3
                  B00111, B00100, B00111, B11100,};
byte tempchar4[8]={B11111, B11100, B11100, B11110, //Row 1, Col 3
                  B11111, B11111, B11110, B11000,};

void setup() 
{
  Serial.begin(9600);
  pinMode(dt_pin, INPUT);
  pinMode(clk_pin, INPUT);
  pinMode(relay, OUTPUT);

  digitalWrite(relay,HIGH);
  lcd.init();                      // initialize the lcd 
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("Welcome To Cinch ");
  lcd.setCursor(2,1);
  lcd.print ("Connectivity");
  delay(3500);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Oven ID QC XXXX ");  
  lcd.setCursor(1,1);
  lcd.print("Auto Temp Ctrl");  
  delay(5000);
  lcd.clear(); 

  Ct1.LtH = 80;
  Ct1.HtL = 80;
  St1.InpOld = false; 

  attachInterrupt(digitalPinToInterrupt(2), doEncoderA, CHANGE);
  attachInterrupt(digitalPinToInterrupt(3), doEncoderB, CHANGE);

  MesTemp = temp_sensor.readCelsius();
  delay(2000);
}

void loop() 
{  
  int State;
  rotating = true;  // reset the debouncer

  lcd.setCursor(0,0);
  lcd.print("Set_Temp:");
  lcd.setCursor(9,0);
  SetTemp = encoderPos;
  lcd.print(SetTemp); 
  lcd.print(char(223));
  lcd.print("C"); 
  lcd.print(" "); 
  
  lcd.setCursor(0,1);
  lcd.print("Mes_Temp:");
  lcd.setCursor(9,1);
  MesTemp = temp_sensor.readCelsius();
  delay(400);
  lcd.print(MesTemp); 
  lcd.print(char(223));
  lcd.print("C"); 
  lcd.print(" ");  

  if(MesTemp <= SetTemp)
  {
    State = true;
  }
  else if(MesTemp > SetTemp)
  {
    State = false;
  }

  MesLessThanSet = debounce(State,&St1,&Ct1, 10); 
  
//  Serial.print(MesLessThanSet);
//  Serial.print("\t  ");
//  Serial.println(St1.timer);

  if(MesLessThanSet == true)
  {
   digitalWrite(relay,LOW);
   printCustom(MesLessThanSet);
  }
  else if(MesLessThanSet == false)
  {
   digitalWrite(relay,HIGH);
   printCustom(MesLessThanSet);
  }
}


//Debounce
boolean debounce(boolean x, debState *st, debCnt *cn, int rtr)
{
  if(x == st->InpOld)
  {
    st->timer = 0;
  }
  else
  {
    if(st->timer >= ((x!=false) ? cn->LtH : cn->HtL))
    {
      st->timer = 0;
      st->InpOld = x;
    }
    else
    {
      st->timer += rtr;
    }
  }

  return st->InpOld;
}

// Interrupt on A changing state
void doEncoderA() {
  // debounce
  if ( rotating ) delay (1);  // wait a little until the bouncing is done

  // Test transition, did things really change?
  if ( digitalRead(2) != A_set ) { // debounce once more
    A_set = !A_set;

    // adjust counter + if A leads B
    if ( A_set && !B_set )
      encoderPos += 1;
    rotating = false;  // no more debouncing until loop() hits again
  }
}

// Interrupt on B changing state, same as A above
void doEncoderB()
{
  if ( rotating ) delay (1);
  if ( digitalRead(3) != B_set ) {
    B_set = !B_set;
    //  adjust counter - 1 if B leads A
    if ( B_set && !A_set )
    {
      if(encoderPos > 0)
      {
        encoderPos -= 1;
      }
    }
    rotating = false;
  }
}

void printCustom(boolean x)
{
  if(x == true)
  {
    lcd.createChar(1,tempchar1);
    lcd.createChar(2,tempchar2);
    lcd.createChar(3,tempchar3);
    lcd.createChar(4,tempchar4);
    lcd.setCursor(14,0);
    lcd.write(1);
    lcd.setCursor(14,1);
    lcd.write(2);
    lcd.setCursor(15,0);
    lcd.write(3);
    lcd.setCursor(15,1);
    lcd.write(4);
  }
  else if(x == false)
  {
    lcd.setCursor(14,0);
    lcd.print(" "); 
    lcd.setCursor(14,1);
    lcd.print(" "); 
    lcd.setCursor(15,0);
    lcd.print(" "); 
    lcd.setCursor(15,1);
    lcd.print(" "); 
  }
  
  
 }

Hi @berlinss. Start by creating an Arduino Cloud IoT "Thing":

https://docs.arduino.cc/arduino-cloud/cloud-interface/things

Add a "Variable" to the Thing:

https://docs.arduino.cc/arduino-cloud/cloud-interface/variables

Next, click the "Sketch" tab at the top of the Thing page. Arduino Cloud will automatically generate the skeleton of a Thing sketch and open that sketch in Arduino Cloud Editor.

The next task is to integrate your custom code into the code of the Thing sketch. That code should set the value of the Variable you added to the Thing.

Give that your best try. Hopefully you will find it fairly straightforward to accomplish. If you run into any problems along the way, just come back here and provide your Thing sketch code along with a detailed description of the problem you encountered.