View Full Version : Program outlet to be on for seconds
djbetterly
06/13/2012, 01:32 PM
How do I program an outlet to be on for a few seconds every day at the same time?
Ripperj
06/13/2012, 02:16 PM
Use the OSC function
Example OSC 0/0:15/59:45 would turn the outlet on for 15 sec every hour
I'm not sure what the max off time is though
Keith
jdander2
06/13/2012, 02:25 PM
To do every day for a few seconds, then you can add an If Time statement to the OSC command. So if you only wanted to run it for 15 seconds at 11pm, then:
Fallback OFF
Set OFF
OSC 0/0:15/59:45 Then ON
If Time 00:00 to 23:00 Then OFF
djbetterly
06/13/2012, 02:38 PM
hmmm...jdander2, just tested and its not working.
AquaticFarmer
06/13/2012, 02:45 PM
How many seconds are you setting it for?
If the program takes 1 or 2 seconds, then you need something bigger than that. In their example, 15 seconds would be a long time and should work. Maybe even 5 or 6 seconds should work ??
I don't know how often your Apex program runs, but I don't think setting it to be ON for 1 or 2 seconds would work.
Just wondering how many seconds you are setting it for?
Jim
djbetterly
06/13/2012, 02:48 PM
I just spoke with Neptune direct, here is the program they gave me, I'll let you know if it works.
Fallback Off
Set Off
OSC 0:00/0:06/59:54 Then ON
If Time 10:05 to 9:55 Then Off
djbetterly
06/13/2012, 02:55 PM
Ok, so this worked successfully,
Fallback OFF
Set OFF
OSC 000:00/000:08/059:52 Then ON
If Time 10:05 to 09:55 Then OFF
This is great, I was able to wire my eheim feeder into my controller. Seems to work well so far. Time will tell now!
jdander2
06/13/2012, 03:29 PM
hmmm...jdander2, just tested and its not working.
It's cause it wasn't 11pm yet maybe? :) you're new programming looks good!
RussM
06/13/2012, 06:31 PM
To do every day for a few seconds, then you can add an If Time statement to the OSC command. So if you only wanted to run it for 15 seconds at 11pm, then:
Fallback OFF
Set OFF
OSC 0/0:15/59:45 Then ON
If Time 00:00 to 23:00 Then OFF
This should work with one tiny change:
Fallback OFF
Set OFF
OSC 0/0:15/59:45 Then ON
If Time 00:00 to 22:59 Then OFF
The quoted code doesn't work because the If time statement will keep it off from 0:00:00 to 23:00:59, therefore the OSC ON period at exactly 23:00:00 will not happen.
Personally, for a single 15-second daily run, I would use:
Fallback OFF
Set OFF
If Time 23:00 to 23:01 Then ON
Defer 1:45 Then ON
jdander2
06/13/2012, 06:42 PM
The quoted code doesn't work because the If time statement will keep it off from 0:00:00 to 23:00:59, therefore the OSC ON period at exactly 23:00:00 will not happen.
Ah, that makes sense. And your revised code is super clear and much less jargon laden!
RussM
06/13/2012, 07:00 PM
OSC is a powerful command, but it's best used for events which occur at multiple fixed intervals throughout the day.
For events which only need to happen once or twice a day, or at irregular/aperiodic intervals, using just If Time is usually the easier solution. Since the minimum run time for If Time is two minutes (If Time 0:00 to 0:01 Then ON is actually on for 2 minutes - outlet will turn off at 0:02 sharp), using the Defer is needed for events of shorter (< 2 minute) duration.
jdander2
06/14/2012, 09:28 AM
Yeah, I graphed my mistake in this chart (lord knows why but I love charts) where the OSC will never let the outlet turn on without changing my time to 22:59 instead of 23:00. Regardless, in this case, I see how it's inefficient to have the OSC calculating in the background when you only need it for a short window of time.
http://i302.photobucket.com/albums/nn90/jdander2/aq/ScreenShot2012-06-14at112338AM.png
vBulletin® v3.8.4, Copyright ©2000-2024, Jelsoft Enterprises Ltd.