IoT by ESP8266

I have two arduino codes for (ESP8266-Thinger.io) iot project, a code for ESP8266 server one and a code for ESP8266 client one, as shown below, the problem is value of sensor1 displays on serial monitor normally but on thinger.io is always zero
and i use on-off widget on thinger.io to control a led at D2 pin of the ESP and it operates normally
so, what is the solution for the above problem
thank you in advance.

Client code is:
#include <ESP8266WiFi.h>
#include <ThingerESP8266.h>
byte ledPin = 2;
char ssid[] = "smamsa";           // SSID of your home WiFi
char pass[] = "SmAmSa13579";            // password of your home WiFi
IPAddress staticIP(192, 168, 1, 90); //ESP static ip
IPAddress gateway(192, 168, 1, 1);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask
IPAddress DNS(8, 8, 8, 8);  //DNS
unsigned long askTimer = 0;
IPAddress server1(192,168,1,80);
WiFiClient client;
String answer1;
int sensor1;
int moistureset=116;
boolean motor1;
#define USERNAME "mohamed929"
#define DEVICE_ID "stce"
#define DEVICE_CREDENTIAL "DBdFhPBIoG+J"
ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
int analogPin = A0;
void setup() {
Serial.begin(115200);               // only for debug
WiFi.config(staticIP, subnet, gateway, DNS);
WiFi.begin(ssid, pass);             // connects to the WiFi router
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
    
// digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
  // resource output example (i.e. reading a sensor value)
thing["Motor1 status"] >> outputValue(motor1);
thing["sensor1"] >> outputValue(sensor1);
pinMode(D2,OUTPUT);
thing["D2"] << digitalPin(D2);
thing["led"] << digitalPin(ledPin);
}
}

void loop() {
    client.connect(server1, 80);   // Connection to the server
  //digitalWrite(ledPin, LOW);    // to show the communication only (inverted logic)
  Serial.println(".");
  client.println("Hi server1 give me the reading of sensor1 \r");  // sends the message to the server
  answer1 = client.readStringUntil('\r');   // receives the answer from the sever
  Serial.println("from server1: " + answer1);
  sensor1=answer1.toInt();
  Serial.println(String(sensor1));
 client.flush();
 // digitalWrite(ledPin, HIGH);
  //delay(100);                  // client will trigger the communication after two seconds
if(sensor1 < moistureset)
{
 digitalWrite(D2,LOW); 
}
else
{
 digitalWrite(D2,HIGH); 
}

  thing.handle();

}

Server code is:

#include <SPI.h>
#include <ESP8266WiFi.h>

char ssid[] = "smamsa";               // SSID of your home WiFi
char pass[] = "SmAmSa13579";               // password of your home WiFi
WiFiServer server1(80);                    

IPAddress ip(192, 168, 1, 80);            // IP address of the server
IPAddress gateway(192,168,1,1);           // gateway of your network
IPAddress subnet(255,255,255,0);          // subnet mask of your network
void setup() {
  Serial.begin(115200);                   // only for debug
  WiFi.config(ip, gateway, subnet);       // forces to use the fix IP
  WiFi.begin(ssid, pass);                 // connects to the WiFi router
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  server1.begin();                         // starts the server
/*  Serial.println("Connected to wifi");
  Serial.print("Status: "); Serial.println(WiFi.status());  // some parameters from the network
  Serial.print("IP: ");     Serial.println(WiFi.localIP());
  Serial.print("Subnet: "); Serial.println(WiFi.subnetMask());
  Serial.print("Gateway: "); Serial.println(WiFi.gatewayIP());
  Serial.print("SSID: "); Serial.println(WiFi.SSID());
  Serial.print("Signal: "); Serial.println(WiFi.RSSI());
  Serial.print("Networks: "); Serial.println(WiFi.scanNetworks());*/
  pinMode(A0, INPUT);
}
void loop () {
  WiFiClient client = server1.available();
  if (client) {
    if (client.connected()) {
      Serial.println(".");
      String request = client.readStringUntil('\r');    // receives the message from the client
      Serial.print("From client: "); Serial.println(request);
      client.flush();
      client.println("Hi client! sensor1 reading is:"+ String(analogRead(A0)) + "\r"); // sends the answer to the client
    }
    client.stop();                // tarminates the connection with the client
    delay(2000);
  }
}