Results 1 to 17 of 17

Thread: How to turn outlet on every other day

  1. #1
    Regular Vistor
    Join Date
    Aug 2013
    Location
    United States
    Posts
    21

    How to turn outlet on every other day

    What I want to do is to turn on an outlet for 60 seconds or so *every other day* at a particular time regardless of the day of the week. Think of it like odd/even lawn watering.

    I can think of a few ways to do this with multiple virtual outlets, DEFER and MIN TIME statements, but that seems messy. Also, I'm not quite sure what would happen after a power outage, etc.

  2. #2
    Frequent Contributor
    Join Date
    Apr 2013
    Location
    Santa Cruz, CA
    Posts
    1,842
    This Should do what you are looking for...
    OSC 000:00/001:00/1439:00 Then ON
    If DoW -M-W-F- Then OFF
    Jon

  3. #3
    Regular Vistor
    Join Date
    Aug 2013
    Location
    United States
    Posts
    21
    That's pretty much what I have now (I use a time of day instead of OSC). The problem is that it's not every other day...it's ON for Saturday and Sunday.

    What I'm looking for is a way (if anyone has already done it) to do every other day...regardless of the day of the week. Or every 3rd day (or 4th day)...essentially "turn on for X seconds every Y days".

  4. #4
    Frequent Contributor Alain B's Avatar
    Join Date
    Mar 2013
    Location
    Montreal, Canada
    Posts
    2,568
    What's the purpose of this outlet ?
    Alain

  5. #5
    Regular Vistor
    Join Date
    Aug 2013
    Location
    United States
    Posts
    21
    In *this* use case, I want a pump from my RODI reservoir to recharge/remix a kalkwasser reservoir. I do this every other day (I currently use the DoW instruction in conjunction with occasional manual intervention on Sundays). It's important to do it "not every day" as I want the reservoir to be low so that I get the maximum remix of kalk powder from the bottom. I have a small customized DIY reservoir that I built out of acrylic (I've done several of these the years...this is the best yet), as I don't want a honkin' large reservoir for space reasons. I don't want a mechanical stirrer (something else to break), so I am automating what would otherwise be a periodic manual addition of RODI and stirring. The design of the bottom of the reservoir takes care of the "stirring" with high-rate water addition (big whoosh of water pumped in for a good mix, then sits two days until I do it again). I do have a timer to prevent kalkwasser addition to the system immediately after the RODI recharge/remix.

    There are other uses I have in mind as well, but this is the key one.

    So, what I really need is a 48 hour timer of sorts (another way of thinking about it).

  6. #6
    Regular Vistor
    Join Date
    Aug 2013
    Location
    United States
    Posts
    21
    Quote Originally Posted by jonmos75 View Post
    This Should do what you are looking for...
    OSC 000:00/001:00/1439:00 Then ON
    If DoW -M-W-F- Then OFF
    By the way, this won't work...you can't have more than 999 minutes in an OSC instruction. However, you could have:
    OSC 720:00/001:00/719:00 Then ON
    which would come on for 1 minute every 24 hours. The limitation here is that you are limited to 999 minutes on either "side" of the ON, so it could not be any later than [approximately] 16:00, or any earlier than [approximately] 08:00 each day (for my purpose it would not matter).

    Regardless, it still does not get to every other day.

  7. #7
    Regular Vistor
    Join Date
    Aug 2013
    Location
    United States
    Posts
    21
    I think I figured it out...and if correct it will work for any number of "every X days" scenarios (so, every 2 days, or every 3 days, or whatever). I'm running some tests for the next few days to make sure (I wish there was a simulator).

  8. #8
    Frequent Visitor LobsterOfJustice's Avatar
    Join Date
    Jun 2013
    Location
    Cary, NC
    Posts
    859
    There is a way to do this, it takes some trial and error (or you have to be smarter than me to figure out the math), and you might not be able to get it to EXACTLY every 48 hours, but you can get close. What you have to do is layer multiple oscillating vitrual outlets and then have an additional virtual outlet that is only activated when the multiple oscillating outlets are activated. For example, if you have an outlet that is activated every 7 hours, and one that is activated every 6 hours, you can make a third outlet to turn on when those two times happen to line up, which is only once every 42 hours. I have used this technique to program pseudo-random cloudy days occuring every about every 9 and 13 days.
    180g reef with all the bells and whistles

  9. #9
    Regular Vistor
    Join Date
    Aug 2013
    Location
    United States
    Posts
    21
    Quote Originally Posted by LobsterOfJustice View Post
    There is a way to do this, it takes some trial and error (or you have to be smarter than me to figure out the math), and you might not be able to get it to EXACTLY every 48 hours, but you can get close. What you have to do is layer multiple oscillating vitrual outlets and then have an additional virtual outlet that is only activated when the multiple oscillating outlets are activated. For example, if you have an outlet that is activated every 7 hours, and one that is activated every 6 hours, you can make a third outlet to turn on when those two times happen to line up, which is only once every 42 hours. I have used this technique to program pseudo-random cloudy days occuring every about every 9 and 13 days.
    Your approach, to get to 42, has the advantage of being the Answer to the Ultimate Question of Life, the Universe, and Everything.

    I tried this at the very start (I'm an engineer so I can do the matherizationistics), and I could get it to work for a specific time "when the OSC planets were in alignment". The only problem is that if I want to change "when" something happens it's back to the pen and pencil to figure out new OSC times.

    I think I may have this almost figured out (how to alternate between Day1 being true, then Day2 being true). I'm stuck on a bit of logic I need to ponder for a bit. If not, then the OSC approach is what I'll use (and post here).

  10. #10
    Frequent Visitor
    Join Date
    May 2013
    Location
    Winnipeg, MB, Canada
    Posts
    524
    Just spitballing here;


    Pumpstir
    Set Off
    If Outlet VO1 = On Then On


    VO1
    Set On
    Osc 001/719/0 Then Off
    If Outlet VO2 = On Then Off
    If Outlet VO3 = On Then Off
    If Outlet VO4 = On Then Off

    VO2
    Set Off
    Osc 000/720/000 Then On
    If Outlet VO1 = On Then On
    Defer 720 Then On

    VO3
    Set Off
    Osc 000/720/000 Then On
    If Outlet VO2 = On Then On
    Defer 720 Then On

    VO4
    Set Off
    Osc 000/720/000 Then On
    If Outlet VO3 = On Then On
    Defer 720 Then On

    Some adjustments to timing on Defer or OSC statements may be require.

    Let me know how it goes. Best of luck.

  11. #11
    Regular Vistor
    Join Date
    Aug 2013
    Location
    United States
    Posts
    21
    Here is where I ended up. This was actually where I originally started. It's not perfect (if there is a power-cycle then which day "Day1" starts on is that day...the day of the power cycle), but it does do "every other day", alternating between Day1 and Day1 (which I call TmrDay1 and TmrDay1 in my naming convention). I was trying to get it to deterministicly have Day1 always be on an "even" day (as calculated from 1/1/1996), but that proved to be brain-splitting. I have very few unintentional reboots issues, so I can live with this approach.

    How it works:
    • TmrDay1AM through TmrDay2PM are timers that act as a "state machine" that loops every 48 hours.
    • Since each OSC period is limited to 999 minutes, I've broken it into four separate 720 minute AM and PM periods. If OSC could handle 1440 minutes in each part this would not be necessary, and this could be done with only one virtual outlet.
      EDIT: This is essentially a 48 hour OSC program due to limitations of OSC duration times.
    • TmrDay1AM is always where the state machine starts after a reboot, as the the Apex [apparently] seems to scan outlets in order, and this is the first outlet in the state machine.
    • TmrDay1AM always starts is ON for the first 12 hours (720 minutes), then OFF for the remainder of the day.
    • TmrDay1PM always starts is OFF for the first 12 hours, then is ON for 12 hours.
    • TmrDay2AM and TmrDay2PM are just duplicates of their Day1 counterparts.
    • All TmrDayXAM/PM's are OFF if any of the others are on.
    • Since TmrDay1AM and TmrDay1PM are the first and second outlets in what the Apex [apparently] scans, only one of those will be ON after a reboot.
    • TmrDay1 and TmrDay2 are not actually necessary...they are a convenience. If all that is needed is to know if Day1 or Day2 AM or PM, then they would not be needed. But with virtual outlets they are "free".


    [ TmrDay1 ] ( Cntl_E3 )
    Fallback OFF Set OFF
    If Outlet TmrDay1AM = ON Then ON
    If Outlet TmrDay1PM = ON Then ON

    [ TmrDay2 ] ( Cntl_E4 )

    Fallback OFF
    Set OFF
    If Outlet TmrDay2AM = ON Then ON
    If Outlet TmrDay2PM = ON Then ON


    [ TmrDay1AM ] ( Cntl_E5 )

    Fallback OFF
    Set OFF
    OSC 000:00/720:00/720:00 Then ON
    If Outlet TmrDay2PM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    Min Time 000:05 Then ON


    [ TmrDay1PM ] ( Cntl_E6 )

    Fallback OFF
    Set OFF
    OSC 720:00/720:00/000:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    If Outlet TmrDay2PM = ON Then OFF
    Min Time 000:05 Then ON

    [ TmrDay2AM ] ( Cntl_E7 )

    Fallback OFF
    Set OFF
    OSC 000:00/720:00/720:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2PM = ON Then OFF
    Min Time 000:05 Then ON

    [ TmrDay2PM ] ( Cntl_E8 )

    Fallback OFF
    Set OFF
    OSC 720:00/720:00/000:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    Min Time 000:05 Then ON


    This could be used in the following manner to turn on a pump for 45 seconds at 17:01 every other day on Day 1.

    [ PmpRODI2Kalk ]
    Fallback OFF
    Set OFF
    If Time 17:01 to 17:02 Then ON
    If Outlet TmrDay2 = ON Then OFF
    Defer 001:15 Then ON

  12. #12
    Regular Vistor
    Join Date
    Aug 2013
    Location
    United States
    Posts
    21
    So, this went very well this evening (my Day1)...exactly as planned. Tomorrow it if does not go off (Day2) then I'll call this "done".

    Thanks to everyone for your input...it caused me to think about a few things differently.

  13. #13
    New User
    Join Date
    Mar 2014
    Location
    Leesburg, VA
    Posts
    9

    I found this old post

    Quote Originally Posted by hilgert View Post
    Here is where I ended up. This was actually where I originally started. It's not perfect (if there is a power-cycle then which day "Day1" starts on is that day...the day of the power cycle), but it does do "every other day", alternating between Day1 and Day1 (which I call TmrDay1 and TmrDay1 in my naming convention). I was trying to get it to deterministicly have Day1 always be on an "even" day (as calculated from 1/1/1996), but that proved to be brain-splitting. I have very few unintentional reboots issues, so I can live with this approach.

    How it works:
    • TmrDay1AM through TmrDay2PM are timers that act as a "state machine" that loops every 48 hours.
    • Since each OSC period is limited to 999 minutes, I've broken it into four separate 720 minute AM and PM periods. If OSC could handle 1440 minutes in each part this would not be necessary, and this could be done with only one virtual outlet.
      EDIT: This is essentially a 48 hour OSC program due to limitations of OSC duration times.
    • TmrDay1AM is always where the state machine starts after a reboot, as the the Apex [apparently] seems to scan outlets in order, and this is the first outlet in the state machine.
    • TmrDay1AM always starts is ON for the first 12 hours (720 minutes), then OFF for the remainder of the day.
    • TmrDay1PM always starts is OFF for the first 12 hours, then is ON for 12 hours.
    • TmrDay2AM and TmrDay2PM are just duplicates of their Day1 counterparts.
    • All TmrDayXAM/PM's are OFF if any of the others are on.
    • Since TmrDay1AM and TmrDay1PM are the first and second outlets in what the Apex [apparently] scans, only one of those will be ON after a reboot.
    • TmrDay1 and TmrDay2 are not actually necessary...they are a convenience. If all that is needed is to know if Day1 or Day2 AM or PM, then they would not be needed. But with virtual outlets they are "free".


    [ TmrDay1 ] ( Cntl_E3 )
    Fallback OFF Set OFF
    If Outlet TmrDay1AM = ON Then ON
    If Outlet TmrDay1PM = ON Then ON

    [ TmrDay2 ] ( Cntl_E4 )

    Fallback OFF
    Set OFF
    If Outlet TmrDay2AM = ON Then ON
    If Outlet TmrDay2PM = ON Then ON


    [ TmrDay1AM ] ( Cntl_E5 )

    Fallback OFF
    Set OFF
    OSC 000:00/720:00/720:00 Then ON
    If Outlet TmrDay2PM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    Min Time 000:05 Then ON


    [ TmrDay1PM ] ( Cntl_E6 )

    Fallback OFF
    Set OFF
    OSC 720:00/720:00/000:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    If Outlet TmrDay2PM = ON Then OFF
    Min Time 000:05 Then ON

    [ TmrDay2AM ] ( Cntl_E7 )

    Fallback OFF
    Set OFF
    OSC 000:00/720:00/720:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2PM = ON Then OFF
    Min Time 000:05 Then ON

    [ TmrDay2PM ] ( Cntl_E8 )

    Fallback OFF
    Set OFF
    OSC 720:00/720:00/000:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    Min Time 000:05 Then ON


    This could be used in the following manner to turn on a pump for 45 seconds at 17:01 every other day on Day 1.

    [ PmpRODI2Kalk ]
    Fallback OFF
    Set OFF
    If Time 17:01 to 17:02 Then ON
    If Outlet TmrDay2 = ON Then OFF
    Defer 001:15 Then ON
    One stupid question. The way I read it the on state hits at 1701. Waits till 17.02 and 15 sec and then what? Not sure how you get 45 sec. should not the defer on be 000:15

  14. #14
    Master Control Freak RussM's Avatar
    Join Date
    Dec 2012
    Location
    California - US Pacific
    Posts
    22,463
    Quote Originally Posted by adamsfour View Post
    One stupid question. The way I read it the on state hits at 1701. Waits till 17.02 and 15 sec and then what? Not sure how you get 45 sec. should not the defer on be 000:15
    If Time 17:01 to 17:02 Then ON
    Defer 001:15 Then ON

    In the above code taken from the PmpRODI2Kalk program, the If Time statement is true for two minutes, not 1 minute. In an If Time statement, the second time value is included in the period the statement will be true. Think of it as "Take the specified action starting at time AA:bb and do so until the time IS NO LONGER YY:zz" So, the 2-minute ON combined with the 1:15 defer results in an ON time of 45 seconds.

    See this sticky post for a fuller explanation: https://forum.neptunesystems.com/sho...ll=1#post97230
    Please do not send me PMs with technical questions or requesting assistance - use the forums for Apex help. PM me ONLY if the matter is of a private or personal nature. Thanks.

  15. #15
    New User
    Join Date
    Mar 2014
    Location
    Leesburg, VA
    Posts
    9

    Thank you.

    Quote Originally Posted by RussM View Post
    If Time 17:01 to 17:02 Then ON
    Defer 001:15 Then ON

    In the above code taken from the PmpRODI2Kalk program, the If Time statement is true for two minutes, not 1 minute. In an If Time statement, the second time value is included in the period the statement will be true. Think of it as "Take the specified action starting at time AA:bb and do so until the time IS NO LONGER YY:zz" So, the 2-minute ON combined with the 1:15 defer results in an ON time of 45 seconds.

    See this sticky post for a fuller explanation: https://forum.neptunesystems.com/sho...ll=1#post97230
    Thank you

  16. #16
    New User
    Join Date
    Mar 2014
    Location
    Leesburg, VA
    Posts
    9
    Quote Originally Posted by hilgert View Post
    Here is where I ended up. This was actually where I originally started. It's not perfect (if there is a power-cycle then which day "Day1" starts on is that day...the day of the power cycle), but it does do "every other day", alternating between Day1 and Day1 (which I call TmrDay1 and TmrDay1 in my naming convention). I was trying to get it to deterministicly have Day1 always be on an "even" day (as calculated from 1/1/1996), but that proved to be brain-splitting. I have very few unintentional reboots issues, so I can live with this approach.

    How it works:
    • TmrDay1AM through TmrDay2PM are timers that act as a "state machine" that loops every 48 hours.
    • Since each OSC period is limited to 999 minutes, I've broken it into four separate 720 minute AM and PM periods. If OSC could handle 1440 minutes in each part this would not be necessary, and this could be done with only one virtual outlet.
      EDIT: This is essentially a 48 hour OSC program due to limitations of OSC duration times.
    • TmrDay1AM is always where the state machine starts after a reboot, as the the Apex [apparently] seems to scan outlets in order, and this is the first outlet in the state machine.
    • TmrDay1AM always starts is ON for the first 12 hours (720 minutes), then OFF for the remainder of the day.
    • TmrDay1PM always starts is OFF for the first 12 hours, then is ON for 12 hours.
    • TmrDay2AM and TmrDay2PM are just duplicates of their Day1 counterparts.
    • All TmrDayXAM/PM's are OFF if any of the others are on.
    • Since TmrDay1AM and TmrDay1PM are the first and second outlets in what the Apex [apparently] scans, only one of those will be ON after a reboot.
    • TmrDay1 and TmrDay2 are not actually necessary...they are a convenience. If all that is needed is to know if Day1 or Day2 AM or PM, then they would not be needed. But with virtual outlets they are "free".


    [ TmrDay1 ] ( Cntl_E3 )
    Fallback OFF Set OFF
    If Outlet TmrDay1AM = ON Then ON
    If Outlet TmrDay1PM = ON Then ON

    [ TmrDay2 ] ( Cntl_E4 )

    Fallback OFF
    Set OFF
    If Outlet TmrDay2AM = ON Then ON
    If Outlet TmrDay2PM = ON Then ON


    [ TmrDay1AM ] ( Cntl_E5 )

    Fallback OFF
    Set OFF
    OSC 000:00/720:00/720:00 Then ON
    If Outlet TmrDay2PM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    Min Time 000:05 Then ON


    [ TmrDay1PM ] ( Cntl_E6 )

    Fallback OFF
    Set OFF
    OSC 720:00/720:00/000:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    If Outlet TmrDay2PM = ON Then OFF
    Min Time 000:05 Then ON

    [ TmrDay2AM ] ( Cntl_E7 )

    Fallback OFF
    Set OFF
    OSC 000:00/720:00/720:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2PM = ON Then OFF
    Min Time 000:05 Then ON

    [ TmrDay2PM ] ( Cntl_E8 )

    Fallback OFF
    Set OFF
    OSC 720:00/720:00/000:00 Then ON
    If Outlet TmrDay1AM = ON Then OFF
    If Outlet TmrDay1PM = ON Then OFF
    If Outlet TmrDay2AM = ON Then OFF
    Min Time 000:05 Then ON


    This could be used in the following manner to turn on a pump for 45 seconds at 17:01 every other day on Day 1.

    [ PmpRODI2Kalk ]
    Fallback OFF
    Set OFF
    If Time 17:01 to 17:02 Then ON
    If Outlet TmrDay2 = ON Then OFF
    Defer 001:15 Then ON
    I implemented the code above and it works perfectly, Many thanks as I have wondered for ages if this was possible. Just so I better understand. On day 1 when the clock reaches midnight how does it know o go to day 2 and not restart day 1. Is it related to the way Apex scans each control in order. Again thanks for this code its prefect.

  17. #17
    Frequent Visitor rkpetersen's Avatar
    Join Date
    Jun 2017
    Location
    Near Seattle
    Posts
    940
    Quote Originally Posted by adamsfour View Post
    I implemented the code above and it works perfectly, Many thanks as I have wondered for ages if this was possible. Just so I better understand. On day 1 when the clock reaches midnight how does it know o go to day 2 and not restart day 1. Is it related to the way Apex scans each control in order. Again thanks for this code its prefect.
    I have a folder of bookmarks to threads like this. Don't need this programming now, but might someday and it's good to have it ready and waiting.

Similar Threads

  1. Help! Turn ON on specific day and time
    By pawelc in forum Misc Apex Usage & Programming
    Replies: 1
    Last Post: 04-14-2019, 13:57
  2. Question: Is there a quick way to turn my Gyre off a few times per day?
    By Wiljuchi in forum Apex Programming for Vortech, Tunze, & Other Controllable Pumps
    Replies: 11
    Last Post: 06-07-2017, 06:51
  3. Question: Turn powerhead on twice a day for an hour
    By DrBoxedWine in forum Misc Apex Usage & Programming
    Replies: 4
    Last Post: 03-16-2017, 11:35
  4. Review My Program Have an outlet turn on twice a day for a set amount of time.
    By coryjac0b in forum Misc Apex Usage & Programming
    Replies: 2
    Last Post: 02-12-2017, 09:40
  5. Program pump to turn on 5 times a day
    By Fishcrazy06 in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 15
    Last Post: 07-09-2014, 23:58

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •