Thanks for the quick answer.
I measure the temperature in the greenhouse, and everything has been working fine for a long time. Now I wanted to incorporate eventn into the project, so that it would warn me for sure, wake me up if there was a problem. When the temperature is too high or too low.
I know about the limit and it is currently not a problem and should not be a problem. Because if the event is activated, then something is not good, because it should almost never happen.
What I wanted to do was to use the “Number input” to specify the value that I want to activate the event and send to virtual pin and save to EEPROM
float alarmKotaoMin = EEPROM.read(7); ///v40
float alarmKotaoMax = EEPROM.read(8); // v41
float alarmPlastenik = EEPROM.read(9);//v42
int alarmKotaoOn = EEPROM.read(10); // 43
int alarmPlastenikOn = EEPROM.read(12);//45
BLYNK_WRITE(V40) {
alarmKotaoMin = param.asFloat();
EEPROM.write(7, alarmKotaoMin);
}
BLYNK_WRITE(V41) {
alarmKotaoMax = param.asFloat();
EEPROM.write(8, alarmKotaoMax);
}
BLYNK_WRITE(V42) {
alarmPlastenik = param.asFloat();
EEPROM.write(9, alarmPlastenik);
}
BLYNK_WRITE(V43) {
alarmKotaoOn = param.asFloat();
EEPROM.write(10, alarmKotaoOn);
}
BLYNK_WRITE(V45) {
alarmPlastenikOn = param.asFloat();
EEPROM.write(12, alarmPlastenikOn);
}
Void ocitanjeTemperature works well, reads the temperature but does not turn on the event.
“If” is set in case of an error with a sensor that knows how to throw out the error, it gives -120 or 85, and that these values are ignored.
and the second IF condition activates the event when “alarmPlastenikOn == 1” (v45) and the temperature is less than “alarmPlastenik” (v42)
void ocitanjeTemperature(void) {
sensors.requestTemperatures(); // Send the command to get temperaturessensors.requestTemperatures(1);
temperatura = sensors.getTempCByIndex(temperaturaSenzor);
temperatura1 = sensors.getTempCByIndex(temperaturaSenzor1);
temperatura2 = sensors.getTempCByIndex(temperaturaSenzor2);
temperatura3 = sensors.getTempCByIndex(temperaturaSenzor3);
if (temperatura > -120 && temperatura != 85) {
Blynk.virtualWrite(V1, temperatura);
if (temperatura < alarmPlastenik && alarmPlastenikOn == 1) {
Blynk.logEvent("hladan_plastenik_10");
}
The temperature is read and displayed, the relays turn on and off as I want, the only thing is that the event is not activated.