Every Other Day Message

Hey all, trying to figure out how to do an "every other day" time schedule that will trigger a message. Certain days and every days are easy of course, but can't figure this one out. Anyone have any ideas?

Thank you in advance for the advice and help.
 
I have thought more about this, and thought about maybe trying to an Every 48 hour action, or something to the effect, but I'm looking for something more specific, like
"every other day @ 30 minutes past sunset"

Thought I would clarify a little better, thanks again for any help you can offer. I'm still pretty new to HAI as you can imagine.
 
Define a flag OTHER_DAY
In the HAI code you can do

WHEN 30 minutes past sunset
and IF OTHER_DAY is OFF
then OTHER_DAY ON
then (do whatever you want)

WHEN 30 minutes past sunset
and IF OTHER_DAY is ON
then OTHER_DAY OFF
 
Define the flag "OTHER_DAY"
Decide if today is supposed to be on or off.
Manually set it to ON if appropriate, do this in PCAccess.
Connect to the controller and go to the flags page.
1 = ON, 0 = OFF.

Code:
WHEN 30 minutes after SUNSET
TOGGLE OTHER_DAY

This will turn the flag on and off at the same time very day forever.

I use this for irrigation since I can only water on Odd days.
 
This is not going to work if you want to switch only on odd days, since some months end on 31st, which is odd and the day after is going to be the 1st, odd again.
You should put in a condition to check that on february 1st and so on, plus a check for leap years that also have feb 29th followed by mar 1st. I can't see a way to do that only thru programming, you'll have to manually manage every month
 
This is not going to work if you want to switch only on odd days, since some months end on 31st, which is odd and the day after is going to be the 1st, odd again.
You should put in a condition to check that on february 1st and so on, plus a check for leap years that also have feb 29th followed by mar 1st. I can't see a way to do that only thru programming, you'll have to manually manage every month

I don't know about HAI, but I will tell you how I manage this in ISY and maybe it will give you some ideas.

In ISY, you can divide a number by a number and post the remainder to a variable. So, if you divide the day of month by two, and the remainder is 0, it is an even day, and of course 1 on an odd day. Then, as you would imagine, you use that 0/1 as a flag.
 
That can't be done in hai, but I thoughtof another way to do it: create a flag named like YesterdayWasEven, then on the 1st of every month set it to 1 and everyday at, say, 00.10 switch its value (there's an action for that in the HAI conteoller, or a simple IF on THEN off and IF off THEN on would do.

Prior to that at, say, 00.05, the 1st of every month the central would check if the last of the previous month was odd or even and set the main even/odd variable accordingly.

Hope it was clear.

Maybe in this particular case doing it in automatic is not shorter than manually set every month, but I can think of cases where this may me in handy. I'm thinking of irrigation that must start every other day and so can't be setup using weekdays (that are odd) or things like that, who knows?

Also I would consider setting a flag to 31 and decrease it everyday: if it's 0 (off) at the end of the month then it had 31 days, else it had 30 (or 28, or 29 the leap year must be taken in account separately) and the flag is considered 'on' (you can't directly check the value unfortunately).

It' getting complicated, maybe if he tells us what must be done we can put down some code.
 
Extremely simple:

Code:
6. // Set Odd Day Flag
7. TIMED 12:00 AM MTWTFSS
		 THEN fOdd Day TOGGLE
8. TIMED 12:00 AM MTWTFSS
	 AND IF DAY IS 1
		 THEN fOdd Day ON

Explanation:

7. Toggle the odd day flag (fOdd Day) every morning.
8. On the first day of every month set it to ON.
 
Fred - Surprised you suggested to do it that way with a flag. There is already an option in PCACCESS to program this without needing to use a flag to track it.


Here is my every other day sprinkler event.

32. TIMED 7:00 AM MTWTFSS
AND IF DAY IS EVEN
THEN RUN Button 012 - Sprinkler Cycle On
 
Wouldn't the first and last day be odd, so there'd be a 2-day window in there?
Sometimes. ;)

Fred's example was doing odd tracking, so I was just showing another way to accomplish that using built in functions.

I think to really get an every other day action, you'll need to use a variable that toggles each day at midnight.
 
That's great, I didn't know of that function, it makes everything much more simple if you just need even/odd.

The more tricky thing is doing watering for one day every three, that is watering on day 1, then stop for days 2 and 3 and again on day 4 and so on.
In that case the flag decrement technique would come in handy.
 
Back
Top