How to update schedule table from Blynk for sprinkler controller

I’m programming a sprinkler controller on a NodeMCU attached to a relay board. I want the schedule to reside on the NodeMCU, and not use Blynk commands to enact every On/Off command. I’m thinking of using two arrays to handle the schedule. One for day of the week, with a 0 or 1 in each position, corresponding to whether the program should run on that day or not. The second array would hold run times for each zone. So an array like [10,10,25,20] would run zone 1,2 for 10 minutes, zone 3 for 25 minutes, and zone 4 for 20 minutes. I think this is a simple enough way to handle it in my code, my curiosity is if there is a better way to save a “timetable” on the NodeMCU that is easily altered from the App.

edit: I should add how I am considering updating them now. I can use a switch in the app for each day, turning a day on/off in the app would override the hard-coded schedule in the array. For each zone, I’ll have a simple time input in minutes. When it’s entered in the app, it will update the zone time in the array. I still haven’t figured out the simple way to read back the current schedule into the app, so you can see when changes are made. Maybe use a table?

I see that the scheduler might offer more flexibility, but I’m looking for something with the least amount of daily interaction with the server, to make the system function even if it loses wifi or server connection.

Well, since this is the Blynk forum, we do tend to refer to Blynk methods :stuck_out_tongue:

You could look at the Time Input widget… Which does exactly that, takes your schedule settings from the App and sends them to the MCU device to do all the timing and action… And it (the MCU) will continue to process based on those once received settings until you either reboot it (and resync the last settings from server or eeprom, etc.) or you send a new set of timing schedules from the App.

Set up a few of them, one for each “zone”

And a bit more info on how it works…

1 Like

Awesome, that made something click that hadn’t before. Have the timer input up and running, should do the job perfectly!

Thank for the reply!

1 Like