Simple 4 relay irrigation scheduler


@hagay I set timer start 1:05 emd 1:06 but start time 1:05 timer Start and finish at the same time. i see from debug. I removed slider and fix it.

  // MAX DURATION SLIDER INPUT                                                      //
  else if (pin >= VP_MAX_DUR_SCHD0) {                                       //V24..V27
     if (pin < VP_MAX_DUR_SCHD0+SCHEDULER_CNT){ 
         max_duration_sec[pin-VP_MAX_DUR_SCHD0] = 86400;
         max_duration_sec[pin-VP_MAX_DUR_SCHD0] = 864000; // set to 10 days is equivalent to not setting max duration
  else if (pin >= VP_IMMD_ACTV_SCHD0) {                                     //V20..V23
    if ( pin <(VP_IMMD_ACTV_SCHD0+SCHEDULER_CNT) ) {
      if (param.asInt()==0)
        scheduler_turn_off(pin-VP_IMMD_ACTV_SCHD0, 0);
        (pin-VP_IMMD_ACTV_SCHD0,TIME_CNT); // immediate turn on using duration from slider
  // DEFAULT ACTIVE DURATION SLIDER INPUT                                          //
  else if (pin >= VP_ACTV_DUR_SCHD0) {                                       //V16..V19
    // default duration is written in extra "timer"
    if (pin <VP_ACTV_DUR_SCHD0+SCHEDULER_CNT) active_duration_sec[pin-VP_ACTV_DUR_SCHD0][TIME_CNT] = 86400;


@hagay I’ve been studying your code trying to understand its operation. Am I correct that pressing System Sleep will prevent any events from turning on until system sleep button is pressed again? Schedule timers are still running but can’t turn anything on.
However system disable shuts down schedule timers but has limited duration based on shutdown duration?


Yes the sleep mode will temporally turn off all tasks keeping them (and schedule events) live in the background. For example if I use this to control my garden irrigation I may want to temporally prevent the sprinklers while I am out, but once I go in again I want everything to return to it’s prev state.

System disable will shut down everything (turn off every active device and all schedulers) and after end of “disable time” it will only activate devices when reaching start time (not due to old schedules). For example if I connect this to my boiler and am going out to the weekend. Then I will disable the system for the next few days.

The duration of both (if not manually deactivated) is defined by the Disable Days slider.

I see the sleep mode as a more short term then the disable mode. Therefore for my sprinklers I will set the disable days to 0 (Or I can remove it from my app) so that if I forget to activate the system again it will still operate the next day.
Of course you may have your own use case where you can see differently.


A post was merged into an existing topic: How to make Blynk.sync ALL after the power loss?