Elk Rule engine question

I'm looking for members here who are interested in understanding the Elk rules engine. I think that a discussion about the following code can help lead to that end.
 
I came up with the following logic to be able to end executing rules at any point in the rule list and it is not as complicated as it appears on the surface. All normal rules would need to include an "and counter1 =0" statement for this to work. In order to end further execution of rules you would end any rule with a "then" clause that set the counter1 to the value of 2.
 
Here's how it works:
Setting counter1 = 2 causes all following rules in the list to be ignored because counter1 is not equal to 0.
 
Then the second to last rule sets counter1 to1 which causes an event that causes the rules list to be read/evaluated again but nothing fires again because  counter1 is not equal to 0.
 
Then the last rule finally resets counter1 to zero and again nothing fires because enough time has passed for the initial event that started all of this has expired.
 
Spanky if you read this I would appreciate it if you could give me the advantage of your knowledge of how rules work and tell me if I'm way off base or if this looks do-able.
 
                      Here's a simple example where nothing will ever fire after rule 1.

BEGIN LIST OF AUTOMATION RULES

 1 WHENEVER SUNRISE
      AND quit rules (Counter 1) IS EQUAL TO 0
            THEN TURN ALL UNITS OFF, HOUSECODE A
            THEN SET quit rules (Counter 1) TO 2
 
2 WHENEVER SUNRISE
      AND quit rules (Counter 1) IS EQUAL TO 0
            THEN TURN ALL UNITS OFF, HOUSECODE A
           
3WHENEVER SUNSET
      AND quit rules (Counter 1) IS EQUAL TO 0
            THEN TURN ALL LIGHTS ON, HOUSECODE A
 
 
                                   END LIST OF AUTOMATION RULES AND BEGIN CONTROL RULES
 
                                                          BEGIN LIST OF CONTROL RULES
 
4 WHENEVER quit rules (Counter 1) CHANGES TO 2
            THEN SET quit rules (Counter 1) TO 1
            THEN TURN Output 001 (Out 1) ON FOR 1 SEC
 
 5 WHENEVER quit rules (Counter 1) CHANGES TO 1
      AND Output 001 (Out 1) STATE IS OFF
            THEN SET quit rules (Counter 1) TO 0
 
That is true, however a very fast way to burn through the memory available on the M1. Remember each line is essentially a rule as far as the hardware goes. Becomes more critical when the rules memory gets eaten up unless the M1 is driving a 3rd party piece of hardware to do heavy lifting.
 
Hey DEL - ready for the big snow?
 
I've been chompin' at the bit to get out there with my new John Deere tractor and now that there is a nice storm coming I'm laid out on my back. I must have hurt myself doing the snow removal yesterday. I think I'll get out there even if I have to crawl over to the machine:)
 
Mike.
 
DELInstallations said:
That is true, however a very fast way to burn through the memory available on the M1. Remember each line is essentially a rule as far as the hardware goes. Becomes more critical when the rules memory gets eaten up unless the M1 is driving a 3rd party piece of hardware to do heavy lifting.
 
Have you had any trouble with running out of rules memory? I have 30 rules now and have only used 13% of the rules memory.
 
Mike.
 
Not looking forward to the snow. My Kubota needs a new battery, so yesterday consisted of jumpstarting it so I could get it out and use the FEL and blade on the driveway followed by a zip with the snowblower on the sidewalk. Still a few hour affair for only a few inches of snow.
 
I've come close to using up the memory on the M1 on a few accounts. When you do more complex actions they go really fast.
 
One that comes to mind is an account I installed about 7-8 years ago that is a world renowned photographer, he was literally one of the firsts using digital and Apple for the media in the world (google and many articles) He built a pole barn with insulated panels, so it was a difficult install to say the least. Basically, the building was all about the aesthetics due to the "artistic" nature There were many tears shed upon getting the outdoor lighting to perform correctly with the reproduction edison bulbs and get the right "air" as they didn't look right running at full power to the HO.
 
I ended up having to drive the lights completely contrary to how anyone would expect. I couldn't get the M1 to turn the light on and set to a particular dim level properly via a rule; the lights would always ramp to full or off and not reach their intended setpoint. That, combined with rules to fire lights based on armed status, day/night and alarm events, including outputs to the CCTV ate up a ton of rules memory. It probably would be a different experience now, but this is back in the M1 infancy days (Caddx/GE wireless) with the first gen Iphones.
 
DELInstallations said:
Not looking forward to the snow. My Kubota needs a new battery, so yesterday consisted of jumpstarting it so I could get it out and use the FEL and blade on the driveway followed by a zip with the snowblower on the sidewalk. Still a few hour affair for only a few inches of snow.
 
I don't have a FEL, i use a 47" front end snow-bloswer that makes short work of the driveway and parking area but the walkways
are a big PIA. I do have a 54"blade that I have hardly used because the blower does a much neater job. The blade makes big piles of snow while the blower throws it out over a large area.
 
Mike.
 
Can't get WAF for spending to get an OEM front blade or someone modifying an old plow blade for the FEL or figure a front blower/rear blower setup. Was enough of a battle to get a 60" rear blade with skids (used). I don't even want to do
 
Even with the loader/blade, it's still a couple of hours + whatever it takes to do the sidewalk frontage (and snowplow drifts). A commercial Honda tracked with 32" swath takes about 4+ hours to do the drive alone.
 
With the deep stuff we got hit with the last few years, the blower is the way to go to get a path for the tractor, then FEL to push and lift to make big banks. I lose traction far too easily even with 4WD, and I've got loaded rears and the tractor itself is around 4k+ pounds.
 
Back
Top