PDA

View Full Version : What am I doing wrong?


ostrow
12/04/2015, 06:16 PM
i am trying to automate my vodka dosing.

Need my doser on for 5 sec daily.

Fallback OFF
OSC 000:00/000:05/059:55 Then ON
If Time 18:07 to 18:06 Then OFF

It didn't go on between 18:06 and 18:07 at all. Why not? I expected it on for the last 5 sec (at 18:06:55)

fas77
12/04/2015, 08:43 PM
First thing is the OSC command. It starts at midnight every night. So your OSC would be On for the first 5 seconds at the top of every hour.

Example:
at 8 in the morning it would be on starting at 08:00:00 to 08:00:05
at 9 in the morning it would be on starting at 09:00:00 to 09:00:05
This would happen at the top of every hour using the current OSC settings.

With this is mind your time should be.
If Time 18:01 to 18:00 Then OFF

Your whole code would be:
Fallback OFF
OSC 000:00/000:05/059:55 Then ON
If Time 18:01 to 18:00 Then OFF

With this you outlet would be on at 18:00:00 to 18:00:05

As always I would test this with a dummy outlet to verify.

ostrow
12/04/2015, 08:54 PM
All you did was change 18:07 and 18:06 to 18:01 and 18:00.

I don't think that will solve the problem....

What am I not getting?

nvladik
12/04/2015, 09:03 PM
Since your timer is on the hour for 5 seconds, and then off the rest of the day, it has to be on the hour. So dosing should start at 18:00, but you have it as off cause you only allow it to run between 18:06 - 18:07.

Setting it to 18:01 to 18:00 will allow it to run once during the day at 6pm.

ostrow
12/04/2015, 09:16 PM
Ahh. I did that to test it and it was past 00. OK will do that and test at top!

fas77
12/04/2015, 09:21 PM
The OSC is always running it ON OFF Cycle.

So your OSC command is:
OSC 000:00/000:05/059:55 Then ON

This means OFF/ON/OFF Then ON
So the first number is OFF Time. (000:00)
The second number is ON Time. (000:05)
The third number is OFF Time. (059:55)

So starting at midnight the Osc cycle will be:
OFF for 0 seconds
ON for 5 seconds
OFF for 59 minutes and 55 seconds.

The cycle will repeat after the third time is done. If you add your three times up they equal 60 minutes. So the cycle would repeat every 60 minutes.

Like I said the OSC command is always running so if you want to keep the outlet OFF at certain times you need the If Time statement to keep it OFF.

Your OSC command was telling the outlet to open at 18:00:00 to 18:00:05.
Your original "If Time 18:07 to 18:06 Then OFF" was keep the outlet OFF during that time.

The time statement I gave is wrong after I thought about it. It should be
"If Time 18:01 to 17:59 Then OFF" Because of the way the IF TIME statement works.
With this the "IF Time" statement will be OFF from 18:01:00 to 17:59:59

I hope I'm not being to confusing.

Your code should be:
Fallback OFF
OSC 000:00/000:05/059:55 Then ON
If Time 18:01 to 17:59 Then OFF

ostrow
12/04/2015, 09:49 PM
Actually, isn't it instead that if I want it on between 18:06 and 18:07 that the error was in the OSC?

Should have been
OSC 000:06:00/000:06:05/000:06:55

And the rest as I had it. Would have gone on at 18:06:00 for 5 sec then been off until the next day at 18:06. Yah?

fas77
12/04/2015, 10:01 PM
I thought you were trying to get it to run at the top of the hour. To have it run at your original time, the code would be:

Fallback OFF
OSC 006:00/000:05/053:55 Then ON
If Time 18:07 to 18:05 Then OFF

So the OSC command will be:
OFF for 6 minutes
ON for 5 seconds
OFF for 53 minutes and 55 seconds.
This will happen at the top of every hour.

The time command will only let it turn on from 18:06 to 18:07.

The time command may look wrong because it says 18:05, but this is because of the way the time command works.

The command "If Time 18:07 to 18:05 Then OFF" will be holding the outlet OFF from 18:07:00 to 18:05:59.