Hi,
I noticed that when I input the value to “numeric input” by using the “keyboard” (without using the - and +), it doesn´t update the variable to hardware. By using those - and + Blynk updates the variable just fine. Code was too long here so i left important stuff only.
-NodeMcu1.0 / ESP8266
-Android 8.1.0
-Blynk Server
-Blynk Library ver. 0.6.1
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
#include <SPI.h>
SimpleTimer timer;
WidgetRTC rtc;
WidgetTerminal terminal(V3);
#define server "blynk.cloud-com" // or "blynk.cloud-com" for Blynk's cloud server
char Date[16];
char Time[16];
char auth[] = "++++";
char ssid[] = "++++";
char pass[] = "++++";
long startsecondswd; // weekday start time in seconds
long stopsecondswd; // weekday stop time in seconds
long nowseconds; // time now in seconds
bool isFirstConnect = true;
unsigned long DrainValvePeriod = 0; //Set Drain Valve Open Time
unsigned long PumpAVPeriod = 0; //Fertilizer Pump 1 Fertilizer A (GROW) ON Vegetative State period
unsigned long PumpBVPeriod = 0; //Fertilizer Pump 2 Fertilizer B (BLOOM) ON Vegetative State period
unsigned long PumpCVPeriod = 0; //Fertilizer Pump 3 Fertilizer C (MICRO) ON Vegetative State period
unsigned long PumpABPeriod = 0; //Fertilizer Pump 1 Fertilizer A (GROW) ON BLOOM 1 State period
unsigned long PumpBBPeriod = 0; //Fertilizer Pump 2 Fertilizer B (BLOOM) ON BLOOM 1 State period
unsigned long PumpCBPeriod = 0; //Fertilizer Pump 3 Fertilizer C (MICRO) ON BLOOM 1 State period
unsigned long PumpABFPeriod = 0; //Fertilizer Pump 1 Fertilizer A (GROW) ON BLOOM 2 State period
unsigned long PumpBBFPeriod = 0; //Fertilizer Pump 2 Fertilizer B (BLOOM) ON BLOOM 2 State period
unsigned long PumpCBFPeriod = 0; //Fertilizer Pump 3 Fertilizer C (MICRO) ON BLOOM 2 State period
void setup()
{
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);
pinMode(RELAY5, OUTPUT);
pinMode(RELAY6, OUTPUT);
pinMode(RELAY7, OUTPUT);
digitalWrite(RELAY1, LOW); // set Main Valve OFF
digitalWrite(RELAY2, LOW); // set LIGHTS OFF
digitalWrite(RELAY3, LOW); // set Fertilizer Pump 1 GROW OFF
digitalWrite(RELAY4, LOW); // set Fertilizer Pump 2 BLOOM OFF
digitalWrite(RELAY5, LOW); // set Fertilizer Pump 3 MICRO OFF
digitalWrite(RELAY6, LOW); // set Drain Valve OFF
digitalWrite(RELAY7, LOW); // set Water Pump OFF
pinMode(ultraSoundSignal, OUTPUT);
pinMode(ultraSoundSignalIN, INPUT); Serial.begin(115200);
Serial.println("\Starting");
Blynk.begin(auth, ssid, pass, IPAddress(139, 59, 206, 133), 80);
int mytimeout = millis() / 1000;
WaterPumpStartMillis = millis(); //initial start time of Water Pump
while (Blynk.connect() == false) { // try to connect to server for 10 seconds
if ((millis() / 1000) > mytimeout + 8) { // try local server if not connected within 9 seconds
break;
}
}
rtc.begin();
timer.setInterval(10000L, activetoday); // check every 10 SECONDS if schedule should run today
timer.setInterval(30000L, reconnectBlynk); // check every 30s if still connected to server
timer.setInterval(5000L, clockvalue); // check value for time
timer.setInterval(5000L, sendWifi); // Wi-Fi singal
timer.setInterval(1000L, ultrasoundsensor_send); //ultrasoundsensorvalue
timer.setInterval(2000L, MoistureSensor); // Moisture Sensor Value
}
BLYNK_WRITE(V6) //Water Capacity Value Input
{
int capacityValueIn = param.asInt(); //Get value as integer
capacityAdjustValue = capacityValueIn * 100.00 / 10000.00; //Calculate User Water Capacity Adjusting Value
}
BLYNK_WRITE(V9) //Drain Time Value Input
{
int DrainTimeValueIn = param.asInt(); //Get value as integer
DrainValvePeriod = DrainTimeValueIn * 60000; //Calculate User Drain Time Value
}
BLYNK_WRITE(V14) //Vegetative State Fertilizer A (Grow) Value Calculations
{
int VegFertAValueIn = param.asInt(); //Get value as integer
float VegFertAAdjustValue = VegFertAValueIn * 100.00 / 10000.00; //Calculate User Vegetative State Fertilizer A (Grow) Adjusting Value
PumpAVPeriod = (VegFertAAdjustValue * 55000) * capacityAdjustValue; //Calculate User Vegetative State Fertilizer A (Grow) Output Value (55000 = 100Ml)
}
BLYNK_WRITE(V15) //Vegetative State Fertilizer B (Bloom) Value Calculations
{
int VegFertBValueIn = param.asInt(); //Get value as integer
float VegFertBAdjustValue = VegFertBValueIn * 100.00 / 10000.00; //Calculate User Vegetative State Fertilizer B (Bloom) Adjusting Value
PumpBVPeriod = (VegFertBAdjustValue * 55000) * capacityAdjustValue; //Calculate User Vegetative State Fertilizer B (Bloom) Output Value (55000 = 100Ml)
}
BLYNK_WRITE(V16) //Vegetative State Fertilizer C (Micro) Value Calculations
{
int VegFertCValueIn = param.asInt(); //Get value as integer
float VegFertCAdjustValue = VegFertCValueIn * 100.00 / 10000.00; //Calculate User Vegetative State Fertilizer C (Micro) Adjusting Value
PumpCVPeriod = (VegFertCAdjustValue * 55000) * capacityAdjustValue; //Calculate User Vegetative State Fertilizer C (Micro) Output Value (55000 = 100Ml)
}
//Bloom 1 State Fertilizer Calculations
BLYNK_WRITE(V17) //Bloom 1 State Fertilizer A (Grow) Value Calculations
{
int Bloom1FertAValueIn = param.asInt(); //Get value as integer
float Bloom1FertAAdjustValue = Bloom1FertAValueIn * 100.00 / 10000.00; //Calculate User Bloom 1 State Fertilizer A (Grow) Adjusting Value
PumpABPeriod = (Bloom1FertAAdjustValue * 55000) * capacityAdjustValue; //Calculate User Bloom 1 State Fertilizer A (Grow) Output Value (55000 = 100Ml)
}
BLYNK_WRITE(V18) //Bloom 1 State Fertilizer B (Bloom) Value Calculations
{
int Bloom1FertBValueIn = param.asInt(); //Get value as integer
float Bloom1FertBAdjustValue = Bloom1FertBValueIn * 100.00 / 10000.00; //Calculate User Bloom 1 State Fertilizer B (Bloom) Adjusting Value
PumpBBPeriod = (Bloom1FertBAdjustValue * 55000) * capacityAdjustValue; //Calculate User Bloom 1 State Fertilizer B (Bloom) Output Value (55000 = 100Ml)
}
BLYNK_WRITE(V19) //Bloom 1 State Fertilizer C (Micro) Value Calculations
{
int Bloom1FertCValueIn = param.asInt(); //Get value as integer
float Bloom1FertCAdjustValue = Bloom1FertCValueIn * 100.00 / 10000.00; //Calculate User Bloom 1 State Fertilizer C (Micro) Adjusting Value
PumpCBPeriod = (Bloom1FertCAdjustValue * 55000) * capacityAdjustValue; //Calculate User Bloom 1 State Fertilizer C (Micro) Output Value (55000 = 100Ml)
}
//Bloom 2 State Fertilizer Calculations
BLYNK_WRITE(V20) //Bloom 2 State Fertilizer A (Grow) Value Calculations
{
int Bloom2FertAValueIn = param.asInt(); //Get value as integer
float Bloom2FertAAdjustValue = Bloom2FertAValueIn * 100.00 / 10000.00; //Calculate User Bloom 2 State Fertilizer A (Grow) Adjusting Value
PumpABFPeriod = (Bloom2FertAAdjustValue * 55000) * capacityAdjustValue; //Calculate User Bloom 2 State Fertilizer A (Grow) Output Value (55000 = 100Ml)
}
BLYNK_WRITE(V21) //Bloom 2 State Fertilizer B (Bloom) Value Calculations
{
int Bloom2FertBValueIn = param.asInt(); //Get value as integer
float Bloom2FertBAdjustValue = Bloom2FertBValueIn * 100.00 / 10000.00; //Calculate User Bloom 2 State Fertilizer B (Bloom) Adjusting Value
PumpBBFPeriod = (Bloom2FertBAdjustValue * 55000) * capacityAdjustValue; //Calculate User Bloom 2 State Fertilizer B (Bloom) Output Value (55000 = 100Ml)
}
BLYNK_WRITE(V22) //Bloom 2 State Fertilizer C (Micro) Value Calculations
{
int Bloom2FertCValueIn = param.asInt(); //Get value as integer
float Bloom2FertCAdjustValue = Bloom2FertCValueIn * 100.00 / 10000.00; //Calculate User Bloom 2 State Fertilizer C (Micro) Adjusting Value
PumpCBFPeriod = (Bloom2FertCAdjustValue * 55000) * capacityAdjustValue; //Calculate User Bloom 2 State Fertilizer C (Micro) Output Value (55000 = 100Ml)
}
Something wrong with the Blynk-app or something wrong with me?
Does anyone know something about this “value input”-issue?
Thanks.
,Tomi