@zodiac I’m not sure which corrections you refer to…
This one.
I’m confused!
Can you pls post your Time input part of the code?
BLYNK_WRITE(V10) { // Scheduler #1 Time Input widget
TimeInputParam t(param);
unsigned int nowseconds = ((hour() * 3600) + (minute() * 60) + second());
unsigned int startseconds = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);
unsigned int stopseconds = (t.getStopHour() * 3600) + (t.getStopMinute() * 60);
int dayadjustment = -1;
if(weekday() == 1){
dayadjustment = 6; // needed for Sunday Time library is day 1 and Blynk is day 7
}
if(t.isWeekdaySelected((weekday() + dayadjustment))){ //Time library starts week on Sunday, Blynk on Monday
//Schedule is ACTIVE today
if(nowseconds >= startseconds - 31 && nowseconds <= startseconds + 31 ){ // 62s on 60s timer ensures 1 trigger command is sent
digitalWrite(signalPin, HIGH); // Tells SLAVE to ignore transmission
transmitter.deviceOn(TRANSMITTER_ID, 15); // Doesnt always work for some reason
Blynk.virtualWrite(V0, 1); // This however always work as long as it's connected to internet
Blynk.syncVirtual(V0);
Serial.println("Schedule 1 started");
terminal.println("Schedule 1 started");
terminal.flush();
timeStamp();
digitalWrite(signalPin, LOW); // OK for SLAVE to receive again
}
if(nowseconds >= stopseconds - 31 && nowseconds <= stopseconds + 31 ){ // 62s on 60s timer ensures 1 trigger command is sent
digitalWrite(signalPin, HIGH);
transmitter.deviceOff(TRANSMITTER_ID, 15);
Blynk.virtualWrite(V0, 0);
Blynk.syncVirtual(V0);
Serial.println("Schedule 1 finished");
terminal.println("Schedule 1 finished");
terminal.flush();
timeStamp();
digitalWrite(signalPin, LOW);
}
}
}
Edit: Removed some indents
Looks like latest Costas code. I have never used this one.