Nodered connection for PIR with LDR

we are trying to create a node red to see the out of PIR with LDR through the cloud. I can’t see the LDR output in the node red. Some one please help me to change the code in below.

#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const int ledPin = 5;
const int pirPin = 16;
const int ldrPin = A0;

// Change the credentials below, so your ESP8266 connects to your router
const char* ssid = “";
const char
password = "
****”;

// Change the variable to your Raspberry Pi IP address, so it connects to your MQTT broker
IPAddress mqtt_server (0,0,0,0);

// Initializes the espClient. You should change the espClient name if you have multiple ESPs running in your home automation system
WiFiClient espClient;
PubSubClient client(espClient);

// Don’t change the function below. This functions connects your ESP8266 to your router
void setup_wifi() {
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.print(“Connecting to “);
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(”.”);
}
Serial.println("");
Serial.print("WiFi connected - ESP IP address: ");
Serial.println(WiFi.localIP());
}

// This functions is executed when some device publishes a message to a topic that your ESP8266 is subscribed to
// Change the function below to add logic to your program, so when a device publishes a message to a topic that
// your ESP8266 is subscribed you can actually do something
void callback(String topic, byte* message, unsigned int length) {
Serial.print("Message arrived on topic: “);
Serial.print(topic);
Serial.print(”. Message: ");
String messageLight1;

for (int i = 0; i < length; i++) {
Serial.print((char)message*);*
_ messageLight1 += (char)message*;_
_
}_
_
Serial.println();_
_
// Feel free to add more if statements to control more GPIOs with MQTT*_
* // If a message is received on the topic room/lamp, you check if the message is either on or off. Turns the lamp GPIO according to the message*
* if(topic==“Light1”){*
* Serial.print("Changing Light1 to ");*
* if(messageLight1 == “on”)*
* {*
* digitalWrite(ledPin, HIGH);*
* Serial.print(“On”);*
* }*
* else if(messageLight1 == “off”)*
* {*
* digitalWrite(ledPin, LOW);*
* Serial.print(“Off”);*
* }*
* }*
* Serial.println();*
}
// This functions reconnects your ESP8266 to your MQTT broker
// Change the function below if you want to subscribe to more topics with your ESP8266
void reconnect() {
* // Loop until we’re reconnected*
* while (!client.connected()) {*
* Serial.print(“Attempting MQTT connection…”);*
* // Attempt to connect*
_ /_
_
YOU MIGHT NEED TO CHANGE THIS LINE, IF YOU’RE HAVING PROBLEMS WITH MQTT MULTIPLE CONNECTIONS*_
* To change the ESP device ID, you will have to give a new name to the ESP8266.*
* Here’s how it looks:*
* if (client.connect(“ESP8266Client”)) {*
* You can do it like this:*
* if (client.connect(“ESP1_Office”)) {
_
Then, for the other ESP:_
if (client.connect(“ESP2_Garage”)) {
_
That should solve your MQTT multiple connections problem*_
_ /_
_
if (client.connect(“ESP8266Client”)) {_
_
Serial.println(“connected”); _
_
// Subscribe or resubscribe to a topic*_
* // You can subscribe to more topics (to control more LEDs in this example)*
* client.subscribe(“Light1”);*
* } else {*
* Serial.print(“failed, rc=”);*
* Serial.print(client.state());*
* Serial.println(" try again in 5 seconds");*
* // Wait 5 seconds before retrying*
* delay(5000);*
* }*
* }*
}
// The setup function sets your ESP GPIOs to Outputs, starts the serial communication at a baud rate of 115200
// Sets your mqtt broker and sets the callback function
// The callback function is what receives messages and actually controls the LEDs
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(pirPin, INPUT);
pinMode(ldrPin, INPUT);
client.setServer(mqtt_server, 1883);
* client.setCallback(callback);*
}
void loop() {
if (!client.connected()) {
* reconnect();*
* }*
* if(!client.loop())*
* client.connect(“ESP8266Client”);*
int pirStatus = digitalRead(pirPin);
int ldrStatus = analogRead(ldrPin);
//int Brightness1=analogRead(ldrPin);
digitalWrite(ledPin,LOW);
//Serial.print(ldrStatus);
///float hic = ldrStatus(Brightness1, false);
static char Light1[7];
* // dtostrf(hic, 6, 2, Brightness1);*
* // Publishes Temperature and Humidity values*
client.publish(“Light1”, Light1);
/*if (pirStatus==HIGH && temperature>24 )
* {*
* digitalWrite(ledPin,HIGH);*
* delay(600000);*
* Serial.print(temperature);*
_ Serial.println("C");_
_
Serial.println(“LED ON”);_
_
}_
_
else if (pirStatus==LOW)_
_
{_
_
digitalWrite(ledPin,LOW);_
_
Serial.print(temperature);_
_ Serial.println("C");_
_
Serial.println(“LED OFF”);
_

_ }/_
if (pirStatus==HIGH && ldrStatus>=200)
_
{_
_
digitalWrite(ledPin,HIGH);_
_
Serial.println(ldrStatus);_
_
Serial.println(“LED ON”);_
_
}_
else if (pirStatus==LOW )
_
{_
_
digitalWrite(ledPin,LOW);_
_
Serial.println(“LED OFF”);_
_
}_
_
delay(1000);_
_
}*_