How can i chage if value in loop with Firebase?

Hello Everyone

I need to know

How can i chage if value in loop with Firebase?

i’m try many thing it dosen’t work

how can i do this

and this is my code

#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#include <DHT.h>
#include <time.h>
#include <EEPROM.h>

// Config Firebase
#define FIREBASE_HOST “iotfarm-bb4c9.firebaseio.com
#define FIREBASE_AUTH “1OtD5A5xWBUOunvV6Tocq5DbcLwyBnRE06Fa9Vdf”

// Config connect WiFi
#define WIFI_SSID “Junior”
#define WIFI_PASSWORD “d0813492287”

// Config Sensor
int sensorpin=A0;
int outputpin=13;
int fanrelaypin=D8;
int airrelaypin=D6;
int moistureLevel;

// Config DHT
#define DHTPIN 4
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

void setup() {
Serial.begin(9600);
EEPROM.begin(512);
//config pin,relay
pinMode(sensorpin, INPUT);
pinMode(outputpin, OUTPUT);
pinMode(fanrelaypin, OUTPUT);
pinMode(airrelaypin, OUTPUT);

SetMoisture = EEPROM.read(0);

// config wifi
WiFi.mode(WIFI_STA);
// connect to wifi.
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print(“connecting”);

while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println();
Serial.print("connected: ");
Serial.println(WiFi.localIP());

// config firebase
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
dht.begin();

}

void loop() {
float moistureLevel = map(analogRead(sensorpin),0,1023,100,0);
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial.print("sensor = " );

if (isnan(moistureLevel) ) {
Serial.println(“Failed to read from sensors!”);
delay(3000);
return;}

if(moistureLevel > SetMoisture){ //the critical value to trigger the solenoid
digitalWrite(outputpin,LOW); //you can alternate it depends on yourself
}
else{
digitalWrite(outputpin,HIGH);
}
// if(h > 50)
// {
// digitalWrite(fanrelaypin,LOW);
// }
// else
// {
// digitalWrite(fanrelaypin,HIGH);
// }
// if(t < 30)
// {
// digitalWrite(airrelaypin,LOW);
// }
// else
// {
// digitalWrite(airrelaypin,HIGH);
// }

// append a new value to /logSensor
Firebase.setInt(“SoilSensor”, moistureLevel);
Firebase.setFloat(“Humidity”, h);
Firebase.setFloat(“Temperature”, t);

Serial.print(moistureLevel);
Serial.println("%");
Serial.print(“Humidity: “);
Serial.print(h);
Serial.print(” %\t”);
Serial.print("Temperature: “);
Serial.print(t);
Serial.print(” *C ");
Serial.println();
delay(500);

}

How can i chage if value in loop with Firebase?

You need to describe what Firebase is, and what "if value" you want to "chage".

PaulS:
You need to describe what Firebase is, and what “if value” you want to “chage”.

if(moistureLevel > 60) <---- change this number over cloud

and this Firebase

if(moistureLevel > 60) <---- change this number over cloud

You can not change a constant.

You could make that statement

  if(moistureLevel > tooWet)

where tooWet has an initial value of 60, and then change the value in tooWet.

I have no idea how you would use Firebase to do that, though.