hello everyone. i have made an MQTT connection between my raspberry pi3 and ESP8266. My aim is to send the actual data generated by my soil sensor to the raspberry pi3 and if the value is below to 30 it execute the python program wich make the led lighting up for 5 seconds and when the value is above 30 (after putting the sensor in water) the led switch off. the programm work well. the problem is when i take out the sensor from water the led light up for 5 seconds and then without puting the sensor in water normaly the led should switch off and then light up for 5 seconds again isnt ? but instead of that the led keep blinking for 1 seconds of delay until i put the sensor in water again to switch it off
how can i solve this problem ?