I have tried many times but the results are not as good as my expectations. I want to display a notification only once according to the time I have programmed.
I can only bring up notifications at 9 am but at other hours the notification doesn’t appear. I have tried almost the same programmers in this community, but I always fail.
maybe friends can help me in solving my problem.
thank you
void notification() {
DateTime now = rtc.now();
if ( now.hour() == 8 && now.minute() == 0 && sm <= 30 && !notified ) {
notified = true;
Blynk.notify ("watering is done");
}else if ( now.hour() == 8 && now.minute() == 0 && sm > 30) {
notified = false;
}
else if ( now.hour() == 10 && now.minute() == 0 && sm <= 30 && !notified ) {
notified = true;
Blynk.notify ("watering is done");
}else if ( now.hour() == 10 && now.minute() == 0 && sm > 30) {
notified = false;
}
}