Elk M1 and Sprinkler system

KB4OB

Member
I have been designing a complete 6 zone sprinkler system around my Elk M1-G using a Relay expansion card remotely mounted in garage. :) Today I started looking at rules to use for same and promptly hit a snag trying to develop a rule that will allow watering on odd days only, as required by the city.
I may be missing something but it looks as though the system is not capable of working with time periods over 24 hours.
I am beginning to wonder if I wouldn't be better off just using a simple dedicated controller which is separate from the MI.
 
I do this... rule looks like:

whenever time = X
and days of the week are (check the ones you want)
then water the yard

Don't have elkrp up right now, I think the key is day can't be your event driver, but it can be in an and condition (again not 100%)

hope that helps
 
Using the example David did on Elk Forum I created a preliminary set of rules that look like they may work but I wont be sure until I get everything together.

elk_rules1.jpg[
 
fleetz, if I understand this correctly, that's what this does.

If you wanted even numbered days, you'd start off with something like

WHENEVER THE TIME IS 3:00 AM
AND THE DAY OF THE MONTH IS A MULTIPLE OF 2

What the code shown does is start a 24 hour timer at the beginning of each even numbered day. When that timer elapses, you're now at the beginning of the odd day and then the rest of the logic picks up..

At least that's what I get from the original thread on the Elk site that I posted.
 
fleetz, if I understand this correctly, that's what this does.

If you wanted even numbered days, you'd start off with something like

WHENEVER THE TIME IS 3:00 AM
AND THE DAY OF THE MONTH IS A MULTIPLE OF 2

What the code shown does is start a 24 hour timer at the beginning of each even numbered day. When that timer elapses, you're now at the beginning of the odd day and then the rest of the logic picks up..

At least that's what I get from the original thread on the Elk site that I posted.


Here were my basic requirements:
1. Six Zone Sprinkler control system
2. Ability to modify the timer in each zone without re-writing the rules for same
3. Ability to water on even or odd dasy of the month
4. Ability to incorpoate a rain sensor in the system

I added a M1XOVR Relay Expansion module in metal enclosure in garage to provide NO Contacts for the Valves and started to test my code and finally got it working today but had to really tinker with the rules to get the M1 to do what I wanted.

The Odd/Even day suggestion worked great and the External Rain Sensor can be connected to an un-used Input Zone and programmed for non-Alarm function. My real problem was using the WHEN statements to activate the Valves (Output Relays) in succession because the M1 aparrently looks at every WHEN statement concurrently.
I finally had to set up a loop timer that toggles every 10 seconds as a Zone toggle, then use phantom outputs (as suggested on the ElK Forum to actually control the Valves in sucession.
I used Custom Values for Valve timers so I can change individual zone times without having to modify my rules. By using a different Custom Value for each Zone you can change any zone time without tinkering with the Rules NOTE: From my testing, The Custom time value appears to be in Seconds.
The 10 second counter also provides some time delay between sucessive valve activation to prevent water hammer.

Below is the Complete 6 Zone Sprinkler Valve Code which I have Tested. (Updated with final code 9/12/2007)

WHENEVER TIME IS 12:01 AM ( Check at 12:01 AM)
AND THE DAY OF THE MONTH IS MULTIPLE OF 2 (if Even Numbered Day of Month)
THEN TURN OUTPUT 200 ON FOR 23 HOURS 59 MINUTES (Turn Output 200 flag ON for 23 Hours 59 Minutes- then it turns off )
WHENEVER TIME is 12:01 AM
AND THE DAY OF THE MONTH IS 1 (use this to catch 1st day of month and insure that output 200 is off)
THEN TURN OUTPUT 200 OFF

WHENEVER EVERY 10 SECONDS (Establish a counter to trigger each zone in order)
THEN TOGGLE SPRINKLER (Counter 5) BETWEEN 0 and 1

WHENEVER RF KEYFOB BUTTON 4 IS ACTIVATED (I used an RF Keyfob to test it, an absolute time value goes here)
AND OUTPUT 200 STATE IS OFF (only run if Odd Numbered day of Month, ie OUTPUT 200 OFF)
AND ZONE 32 IS SECURE ( Only run if rain sensor is not triggered on input zone )
THEN TURN Sprinkler Z1 (Out 17) ON FOR (Cust Set 1), RESTART TIMER IF RUNNING (Turn on Zone 1 for Custom set time #1)
THEN TURN OUTPUT 201 ON (Turn on Output 201 as flag for Zone 2)

WHENEVER Sprinkler (Counter 5) CHANGES TO 1 (When the Sprinkler counter toggles to 1)
AND OUTPUT Output 201 STATE IS ON (And the Z2 flag is set)
AND Sprinkler Z1 (Out 17) STATE IS OFF (And Z1 has timed out and turned off)
THEN TURN Sprinkler Z2 (Out 18) ON FOR Sprinkler 1 (Cust Set 1), RESTART TIMER IF RUNNING(Then turn on Zone 2 Custom Set Time)
THEN TURN OUTPUT 201 OFF (Then turn 201 flag off)
THEN TURN OUTPUT 202 ON (Then turn on 202 flag for Zone 3)

WHENEVER Sprinkler (Counter 5) CHANGES TO 1
AND OUTPUT Output 202 STATE IS ON
AND Sprinkler Z2 (Out 18) STATE IS OFF (And Z2 has timed out and turned off)
THEN TURN Sprinkler Z3 (Out 19) ON FOR Sprinkler 1 (Cust Set 1), RESTART TIMER IF RUNNING(Then turn on Zone 3 Custom Set Time)
THEN TURN OUTPUT 202 OFF (Then turn 202 flag off)
THEN TURN OUTPUT 203 ON

WHENEVER Sprinkler (Counter 5) CHANGES TO 1 (This cycle repeats for as many zones as you need)
AND OUTPUT Output 203 STATE IS ON
AND Sprinkler Z3 (Out 19) STATE IS OFF
THEN TURN Sprinkler Z4 (Out 20) ON FOR Sprinkler 1 (Cust Set 1), RESTART TIMER IF RUNNING
THEN TURN OUTPUT 203 OFF
THEN TURN OUTPUT 204 ON

WHENEVER Sprinkler (Counter 5) CHANGES TO 1
AND OUTPUT Output 204 STATE IS ON
AND Sprinkler Z4 (Out 20) STATE IS OFF
THEN TURN Sprinkler Z5 (Out 21) ON FOR Sprinkler 1 (Cust Set 1), RESTART TIMER IF RUNNING
THEN TURN OUTPUT 204 OFF
THEN TURN OUTPUT 205 ON

WHENEVER Sprinkler (Counter 5) CHANGES TO 1
AND OUTPUT Output 205 STATE IS ON
AND Sprinkler Z5 (Out 21) STATE IS OFF
THEN TURN Sprinkler Z6 (Out 22) ON FOR Sprinkler 1 (Cust Set 1), RESTART TIMER IF RUNNING

THEN TURN OUTPUT 201 OFF (Since the valves are triggered by outputs)
THEN TURN OUTPUT 202 OFF (I wanted to make sure they were all OFF )
THEN TURN OUTPUT 203 OFF (to prevent the possibility of 1 or more remaining on for 2 days)
THEN TURN OUTPUT 204 OFF
THEN TURN OUTPUT 205 OFF







Hope this saves some one some time and loss of hair :huh:
 
fleetz, if I understand this correctly, that's what this does.

If you wanted even numbered days, you'd start off with something like

WHENEVER THE TIME IS 3:00 AM
AND THE DAY OF THE MONTH IS A MULTIPLE OF 2

What the code shown does is start a 24 hour timer at the beginning of each even numbered day. When that timer elapses, you're now at the beginning of the odd day and then the rest of the logic picks up..

At least that's what I get from the original thread on the Elk site that I posted.


Here were my basic requirements:
1. Six Zone Sprinkler control system
2. Ability to modify the timer in each zone without re-writing the rules for same
3. Ability to water on even or odd dasy of the month
4. Ability to incorpoate a rain sensor in the system

I added a M1XOVR Relay Expansion module in metal enclosure in garage to provide NO Contacts for the Valves and started to test my code and finally got it working today but had to really tinker with the rules to get the M1 to do what I wanted.

The Odd/Even day suggestion worked great and the External Rain Sensor can be connected to an un-used Input Zone and programmed for non-Alarm function. My real problem was using the WHEN statements to activate the Valves (Output Relays) in succession because the M1 aparrently looks at every WHEN statement concurrently.
I finally had to set up a loop timer that toggles every 10 seconds as a Zone toggle, then use phantom outputs (as suggested on the ElK Forum to actually control the Valves in sucession.
I used Custom Values for Valve timers so I can change individual zone times without having to modify my rules. By using a different Custom Value for each Zone you can change any zone time without tinkering with the Rules NOTE: From my testing, The Custom time value appears to be in Seconds.
The 10 second counter also provides some time delay between sucessive valve activation to prevent water hammer.

Below is the Zone triggering Code which I have Tested:

WHENEVER EVERY 10 SECONDS (Establish a counter to trigger each zone in order)
THEN TOGGLE SPRINKLER (Counter 5) BETWEEN 0 and 1

WHENEVER RF KEYFOB BUTTON 4 IS ACTIVATED (I used an RF Keyfob to test it)
THEN TURN OUTPUT 201 OFF (Since the valves are triggered by outputs)
THEN TURN OUTPUT 202 OFF (I wanted to make sure they were all OFF)
THEN TURN OUTPUT 203 OFF
THEN TURN OUTPUT 204 OFF
THEN TURN OUTPUT 205 OFF
THEN TURN Sprinkler Z1 (Out 17) ON FOR (Cust Set 1), RESTART TIMER IF RUNNING (Turn on Zone 1 for Custom set time #1)
THEN TURN OUTPUT 201 ON (Turn on Output 201 as flag for Zone 2)
WHENEVER Sprinkler (Counter 5) CHANGES TO 1 (When the Sprinkler counter toggles to 1)
AND OUTPUT Output 201 STATE IS ON (And the Z2 flag is set)
AND Sprinkler Z1 (Out 17) STATE IS OFF (And Z1 has timed out and turned off)
THEN TURN Sprinkler Z2 (Out 18) ON FOR Sprinkler 1 (Cust Set 1), RESTART TIMER IF RUNNING(Then turn on Zone 2 Custom Set Time)
THEN TURN OUTPUT 201 OFF (Then turn 201 flag off)
THEN TURN OUTPUT 202 ON (Then turn on 202 flag for Zone 3)

WHENEVER Sprinkler (Counter 5) CHANGES TO 1 (This cycle repeats for as many zones as you need)
AND OUTPUT Output 202 STATE IS ON



The remainder of the code repeats through Zone six with simple modifications in the numbers.

Hope this saves some one some time and loss of hair :huh:

Hi KB4OB,

Thanks for the feedback and saving my valuable hair!! It looks good!

Where is the odd / even day setting?

Cheers,

Fleetz
 
fleetz, if I understand this correctly, that's what this does.

If you wanted even numbered days, you'd start off with something like

WHENEVER THE TIME IS 3:00 AM
AND THE DAY OF THE MONTH IS A MULTIPLE OF 2

What the code shown does is start a 24 hour timer at the beginning of each even numbered day. When that timer elapses, you're now at the beginning of the odd day and then the rest of the logic picks up..

At least that's what I get from the original thread on the Elk site that I posted.


Here were my basic requirements:
1. Six Zone Sprinkler control system
2. Ability to modify the timer in each zone without re-writing the rules for same
3. Ability to water on even or odd dasy of the month
4. Ability to incorpoate a rain sensor in the system

I added a M1XOVR Relay Expansion module in metal enclosure in garage to provide NO Contacts for the Valves and started to test my code and finally got it working today but had to really tinker with the rules to get the M1 to do what I wanted.

The Odd/Even day suggestion worked great and the External Rain Sensor can be connected to an un-used Input Zone and programmed for non-Alarm function. My real problem was using the WHEN statements to activate the Valves (Output Relays) in succession because the M1 aparrently looks at every WHEN statement concurrently.
I finally had to set up a loop timer that toggles every 10 seconds as a Zone toggle, then use phantom outputs (as suggested on the ElK Forum to actually control the Valves in sucession.
I used Custom Values for Valve timers so I can change individual zone times without having to modify my rules. By using a different Custom Value for each Zone you can change any zone time without tinkering with the Rules NOTE: From my testing, The Custom time value appears to be in Seconds.
The 10 second counter also provides some time delay between sucessive valve activation to prevent water hammer.

Below is the Zone triggering Code which I have Tested (Except for 1st 6 lines relating to ODD DAYS):

WHENEVER TIME IS 12:01 AM ( Check at 12:01 AM)
AND THE DAY OF THE MONTH IS MULTIPLE OF 2 (if Even Numbered Day of Month)
THEN TURN OUTPUT 200 ON FOR 23 HOURS 59 MINUTES (Turn Output 200 flag ON for 23 Hours 59 Minutes- then it turns off )
WHENEVER TIME is 12:01 AM
AND THE DAY OF THE MONTH IS 1 (use this to catch 1st day of month and insure that output 200 is off)
THEN TURN OUTPUT 200 OFF

WHENEVER EVERY 10 SECONDS (Establish a counter to trigger each zone in order)
THEN TOGGLE SPRINKLER (Counter 5) BETWEEN 0 and 1

WHENEVER RF KEYFOB BUTTON 4 IS ACTIVATED (I used an RF Keyfob to test it)
AND OUTPUT 200 STATE IS OFF (only run if Odd Numbered day of Month, ie OUTPUT 200 OFF)
AND ZONE 32 IS SECURE ( Only run if rain sensor is not triggered on input zone )
THEN TURN OUTPUT 201 OFF (Since the valves are triggered by outputs)
THEN TURN OUTPUT 202 OFF (I wanted to make sure they were all OFF)
THEN TURN OUTPUT 203 OFF
THEN TURN OUTPUT 204 OFF
THEN TURN OUTPUT 205 OFF
THEN TURN Sprinkler Z1 (Out 17) ON FOR (Cust Set 1), RESTART TIMER IF RUNNING (Turn on Zone 1 for Custom set time #1)
THEN TURN OUTPUT 201 ON (Turn on Output 201 as flag for Zone 2)
WHENEVER Sprinkler (Counter 5) CHANGES TO 1 (When the Sprinkler counter toggles to 1)
AND OUTPUT Output 201 STATE IS ON (And the Z2 flag is set)
AND Sprinkler Z1 (Out 17) STATE IS OFF (And Z1 has timed out and turned off)
THEN TURN Sprinkler Z2 (Out 18) ON FOR Sprinkler 1 (Cust Set 1), RESTART TIMER IF RUNNING(Then turn on Zone 2 Custom Set Time)
THEN TURN OUTPUT 201 OFF (Then turn 201 flag off)
THEN TURN OUTPUT 202 ON (Then turn on 202 flag for Zone 3)

WHENEVER Sprinkler (Counter 5) CHANGES TO 1 (This cycle repeats for as many zones as you need)
AND OUTPUT Output 202 STATE IS ON



The remainder of the code repeats through Zone six with simple modifications in the numbers.

Hope this saves some one some time and loss of hair :huh:

Hi KB4OB,

Thanks for the feedback and saving my valuable hair!! It looks good!

Where is the odd / even day setting?

Cheers,

Fleetz

The ODD/EVEN code was pretty much covered in my original post and I didn't show it for the valve timing yet since I have to let the M1 run for at least two days to prove it out.
Anyway, I added the additional code I used at top of this post.
It is actually a separate subroutine that sets Output 200 to 1 on even numbered days and 0 on odd numbered days and runs constantly.
The Valve Timer subroutine just verifies that Output 200 is in OFF STATE before starting.
See Post #8 for final (Complete Code) :rolleyes:
 
fleetz, if I understand this correctly, that's what this does.

If you wanted even numbered days, you'd start off with something like

WHENEVER THE TIME IS 3:00 AM
AND THE DAY OF THE MONTH IS A MULTIPLE OF 2

What the code shown does is start a 24 hour timer at the beginning of each even numbered day. When that timer elapses, you're now at the beginning of the odd day and then the rest of the logic picks up..

At least that's what I get from the original thread on the Elk site that I posted.


Here were my basic requirements:
1. Six Zone Sprinkler control system
2. Ability to modify the timer in each zone without re-writing the rules for same
3. Ability to water on even or odd dasy of the month
4. Ability to incorpoate a rain sensor in the system

I added a M1XOVR Relay Expansion module in metal enclosure in garage to provide NO Contacts for the Valves and started to test my code and finally got it working today but had to really tinker with the rules to get the M1 to do what I wanted.

The Odd/Even day suggestion worked great and the External Rain Sensor can be connected to an un-used Input Zone and programmed for non-Alarm function. My real problem was using the WHEN statements to activate the Valves (Output Relays) in succession because the M1 aparrently looks at every WHEN statement concurrently.
I finally had to set up a loop timer that toggles every 10 seconds as a Zone toggle, then use phantom outputs (as suggested on the ElK Forum to actually control the Valves in sucession.
I used Custom Values for Valve timers so I can change individual zone times without having to modify my rules. By using a different Custom Value for each Zone you can change any zone time without tinkering with the Rules NOTE: From my testing, The Custom time value appears to be in Seconds.
The 10 second counter also provides some time delay between sucessive valve activation to prevent water hammer.

Below is the Zone triggering Code which I have Tested (Except for 1st 6 lines relating to ODD DAYS):

WHENEVER TIME IS 12:01 AM ( Check at 12:01 AM)
AND THE DAY OF THE MONTH IS MULTIPLE OF 2 (if Even Numbered Day of Month)
THEN TURN OUTPUT 200 ON FOR 23 HOURS 59 MINUTES (Turn Output 200 flag ON for 23 Hours 59 Minutes- then it turns off )
WHENEVER TIME is 12:01 AM
AND THE DAY OF THE MONTH IS 1 (use this to catch 1st day of month and insure that output 200 is off)
THEN TURN OUTPUT 200 OFF

WHENEVER EVERY 10 SECONDS (Establish a counter to trigger each zone in order)
THEN TOGGLE SPRINKLER (Counter 5) BETWEEN 0 and 1

WHENEVER RF KEYFOB BUTTON 4 IS ACTIVATED (I used an RF Keyfob to test it)
AND OUTPUT 200 STATE IS OFF (only run if Odd Numbered day of Month, ie OUTPUT 200 OFF)
AND ZONE 32 IS SECURE ( Only run if rain sensor is not triggered on input zone )
THEN TURN OUTPUT 201 OFF (Since the valves are triggered by outputs)
THEN TURN OUTPUT 202 OFF (I wanted to make sure they were all OFF)
THEN TURN OUTPUT 203 OFF
THEN TURN OUTPUT 204 OFF
THEN TURN OUTPUT 205 OFF
THEN TURN Sprinkler Z1 (Out 17) ON FOR (Cust Set 1), RESTART TIMER IF RUNNING (Turn on Zone 1 for Custom set time #1)
THEN TURN OUTPUT 201 ON (Turn on Output 201 as flag for Zone 2)
WHENEVER Sprinkler (Counter 5) CHANGES TO 1 (When the Sprinkler counter toggles to 1)
AND OUTPUT Output 201 STATE IS ON (And the Z2 flag is set)
AND Sprinkler Z1 (Out 17) STATE IS OFF (And Z1 has timed out and turned off)
THEN TURN Sprinkler Z2 (Out 18) ON FOR Sprinkler 1 (Cust Set 1), RESTART TIMER IF RUNNING(Then turn on Zone 2 Custom Set Time)
THEN TURN OUTPUT 201 OFF (Then turn 201 flag off)
THEN TURN OUTPUT 202 ON (Then turn on 202 flag for Zone 3)

WHENEVER Sprinkler (Counter 5) CHANGES TO 1 (This cycle repeats for as many zones as you need)
AND OUTPUT Output 202 STATE IS ON



The remainder of the code repeats through Zone six with simple modifications in the numbers.

Hope this saves some one some time and loss of hair :unsure:

Hi KB4OB,

Thanks for the feedback and saving my valuable hair!! It looks good!

Where is the odd / even day setting?

Cheers,

Fleetz

The ODD/EVEN code was pretty much covered in my original post and I didn't show it for the valve timing yet since I have to let the M1 run for at least two days to prove it out.
Anyway, I added the additional code I used at top of this post.
It is actually a separate subroutine that sets Output 200 to 1 on even numbered days and 0 on odd numbered days and runs constantly.
The Valve Timer subroutine just verifies that Output 200 is in OFF STATE before starting.
If I have to make changes, I will post corrections. :D

Hi KB40B,

Sorry mate I know you covered the ODD/EVEN I just thought you missed it out in your rules program.

I was concerned about your nieghbours getting the benifits of watering everyday :huh:

Thanks for the updated rules thou.

Regards,

Fleetz
 
Actually, It's a new house and I don't even have the sprinkler system installed yet. I wanted to get the software and Elk hardware working first. Otherwise, I would have to add a 6 zone sprinkler controller to my materials list :unsure:
 
Actually, It's a new house and I don't even have the sprinkler system installed yet. I wanted to get the software and Elk hardware working first. Otherwise, I would have to add a 6 zone sprinkler controller to my materials list :huh:

Doing the same thing here building the system that is going into our new house. 4 X ELK 28" housings and I am shoe horning more gear in as we speak. It is almost full house without a house!!! :unsure:
 
Actually, It's a new house and I don't even have the sprinkler system installed yet. I wanted to get the software and Elk hardware working first. Otherwise, I would have to add a 6 zone sprinkler controller to my materials list :huh:

Doing the same thing here building the system that is going into our new house. 4 X ELK 28" housings and I am shoe horning more gear in as we speak. It is almost full house without a house!!! :unsure:


I have 2 of the 28 inch cans and 2 of the 14 inch and last night I ordered another 28 inch and that probably will be full in a month. Never enough room.
 
Udate..I can now verify the the code works...
I inserted a (temporary) miscellanous voice announcement in my code and the relay expansion module has LED's on each relay which come on when activated.
On Odd days it activates and on Even days it wont!
The only thing I may have to eventually do is increase the (10 Second) trigger timer in order to insure that I get a delay between each valve.
I noticed that some appear to have slightly less delay time between them due to different run times .
I don't think this is a major issue and ithe initial 10 seconds can probably be increased up to five minutes or more since I have at least 6 hours to get the watering done between 12:01 AM and 6:?? AM.
I think I will probably also move the lines that turn Outputs 201 through 205 off from the first to the last WHEN statement just to insure that I don't have a valve on for 24 hours. As it is now this is not done until the cycle starts. :unsure:

See my initial post #8 for final (Complete Code) to do this.

Thanks for everyones's help...
 
Back
Top