Elk rules engine

It was many years ago but I was trained and worked in data system analysis and design and a basic function of that job is to decide your desired outcome and then accomplish it with no loose ends in your design. Another basic function is to document everything. A designer should attempt to consider all possible circumstances and control all possible  outcomes. It's not always possible but you try.
 
When I sat down and started planning my Elk rules I quickly learned that I did not have the information that I needed to plan anything. The first question that came to my mind is exactly how and when do rules execute. The first thing I did was to search the internet and I came up empty. Next I inquired at Elk tech support and have received no reply. Eventually I resorted to just jumping in and learning the  hard way....trial and error. After hours of trial and error I have some idea of how the system works now but still do not have the information and foresight  that I need to design rules without resorting to trial and error.
 
A programmer can learn to code in a particular language but the knowledge is useless until they learn exactly how the environment that they are programming in will treat their code. I haven't written code in years but I know that programming in a windows environment is not the same as programming in an IMS or IOS environment even though you can use the same programming language in all three. The same goes for writing rules to the Elk environment. Knowing how the operating system is going to treat your rues should be a given, not a curiosity.
 
Elk does not even document the simple fact that  a "whenever" clause evaluates a change of state while the "and" clause evaluates existing states. I came to this conclusion on my own by trial and error. That really seems unnecessary to me when just a clue could have saved me hours.
 
I love the Elk system and the rules language is very powerful and I am not complaining about the system. I just would like to take full advantage of the rules language. Where is the documentation?
 
Mike.
 
I would like to add that I have been very happy with the Elk system and their support in the past has been excellent. If I had to do it over again I would choose the Elk for my home. I'm just putting in my request for an improvement that would make my life with the system even better down the road.
 
Hey - aim low hit nothing, Mike.
 
Another thought that I'd like to share is that I understand why Elk might only share this information with it's authorized dealers and trained  installers as a courtesy to them and for control reasons but it appears that they have kept it in house completely. I myself can't imagine a motive for this.
 
Mike.
 
RAL said:
Putting on my computer systems designer hat for a moment, I'll say that any programmable system needs a well defined, documented architecture in order to be programmed properly by others.  Without that documentation, you end up having to do it by trial and error.  Sure, after a while, you'll learn enough to be able to write rules without too much stumbling around.   But you don't really have a way to know what you don't know, and when that might come back to bite you.
 
It surprises me that for a system like the M1, that can be used for life and property protection, this documentation doesn't seem to exist.
 
Don't get me wrong - I like the M1, but it sure would be nice if they provided better documentation for it.
 
Do you think that it's possible that nobody bothered to write it down? 
 
EDIt
 
Let me rephrase that.....I find it hard to believe but do you think that it's possible that nobody took the time to properly document the Rules operating system?
 
Mike.
 
Mike I am with you. Someone wrote it long ago, it shipped, they left for different pastures and here we are.
 
DELInstallations said:
That is the same with full blown access systems (though they're not rated for life safety applications, per se, but can be used as the head end for monitoring said equipment) and their operation is far more complex.
 
I deal with Linel, Amag, P2000 and a few others....and their documentation is less than what comes with the M1. Hell, even after 5-10 days in class you still don't know how to do everything, let alone how some items are intermingled. Still have to break out paper to draw out the more complex actions and boolean operations.
 
Example:
https://www.youtube.com/watch?v=8DuLfj8Z_h8
 
A single panel is about $2K-5K+ the related peripherals, not including the server and software/license. If I can't get it with a product like that (and a few trainings that are upwards of $5-10K each and the certs) I can't see it happening on the sub $500 M1....what they could do, however, is provide SDK's that may provide some insight to 3rd parties.
 
I think that what has become apparent to me is that the state-of-the-art home automation world is behind the rest of the modern world when it comes to software. I don't think that I'm being too picky when I say that the Elk Rules documentation and Elkrp2 leave a bit to be desired.
 
One example (and a problem for me) is that the font size in RP2 is fixed size. Try to run RP2 at 1920x1080 and the text is very small and hard for me to read. Then try it on a new high res laptop at 3200x1800 and it's impossible to read the screens. When I increased windows font size to 150% via control panel Elkrp2 stopped working altogether. I think that this should be very high on the list of improvements in the next version release and I mentioned it at the Elk support forum.
 
There's a lot of good in the Elk system and there are shortcomings. I'm convinced that Elk is proud of their product and I'm sure that they read these forums so it can't hurt to put this stuff out there and wait for the next version release.
 
Mike.
 
I think part of it is dealing with a MS access based program that was designed in XP before monitors and graphic cards even had a candle to what exists now.
 
They should do a little updating and I'm still hoping for multiple 2W fire zones (via module or what have you) and some form of SLC fire alarm that would be the cat's meow. The remaining is fluff. I'm more of a hardware guy. Software is the easy portion.
 
Of course, only so much power on the board and memory...can't do everything I'd want to see.
 
@Mike,
 
Noticed a Webinar on the Elk site called:
 
Webinar - Introduction to M1: Programming with ElkRP2
 
Join us for part two of our introductory course for the M1 Security & Automation Control family. During this webinar, we will show you just how easy it can be to program the M1 system using ElkRP2 Remote Programming Software. Topics include setup of users, zones, wireless expansion, system reporting, and automation with a detailed overview of rules.
 
Date & Time
February 27, 2015
1:00pm - 2:15pm Eastern
 
Thanks Pete_c I plan to listen in on that.I've watched a couple of their videos and they were well done.
 
Mike.
 
mikefamig said:
mikefamig, on 01 Feb 2015 - 12:11, said:
I've been learning myself by trial and error and have some understanding but I would like to know what exactly happens when an "event" occurs.

As I understand it the rules list is read from top to bottom and each "whenever is evaluated to see if it involves that event. But then that same rule can trigger another event at which time the rules list is evaluated from top to bottom again and this keeps happening as events occur.

What I don't understand is how long an event lives. You may have noticed that a "whenever" rule is triggered by an event but an "and" condition is triggered by an existing state. So when a door opens an event occurs but at some point that event becomes an existing state of "door open".

To sumit up I am confused about the lifespan of an event and the order and timing of execution. For example if you have several rules checking for sensor1 to open will they all trigger? I have found that if I put a timer in a rule to stall execution for a number of seconds that the rules do not all execute.

Mike.
OK I think that I have my head around this.


1 - When an "event" occurs rules are read sequentially from top to bottom looking for all "whenevers" that refer to that event
2 - A rule that is relevant will be triggered
3 - A rule that is not relevant is ignored
4 - When the end of the rules list is reached that event has reached the end of it's life.

5 Each time a relevant "whenever creates a new event steps 1-4 above are repeated once..

So to sum it up an event can cause several readings of the rules list but each event has a lifespan of one pass through the list.

Mike.

EDIT

Another way to say it:

An event causes one reading of the rules list from beginning to end and dies at the end of that reading. Each event created by that first reading causes one reading of the rules list from beginning to end and dies at the end of that reading. This process continues until a null reading occurs creating no new events.
 
This is how I've explained the rules to others who have asked me to install Elk systems.... All rules start with WHENEVER... WHEN being the key word, as in... a moment in time.
 
WHEN the door opens, WHEN the output changes, etc.
 
It's a difference in concept from basic software coding that uses IF, WHILE, FOR statements which can create loops or continue to occur for extended periods of time (e.g. IF the door is open). Elk doesn't care IF your door stays open for 5 minutes or 25 minutes, it's only going to trigger WHEN it becomes secure or not secure - again, that "moment" in time. Now, if you would like something to occur 5 minutes AFTER the door is opened, you can set a phantom output to turn ON for 5 minutes, WHEN the door is opened. WHEN that output is turned off (5 minutes after the door was opened)... do something.
 
drvnbysound said:
This is how I've explained the rules to others who have asked me to install Elk systems.... All rules start with WHENEVER... WHEN being the key word, as in... a moment in time.
 
WHEN the door opens, WHEN the output changes, etc.
 
It's a difference in concept from basic software coding that uses IF, WHILE, FOR statements which can create loops or continue to occur for extended periods of time (e.g. IF the door is open). Elk doesn't care IF your door stays open for 5 minutes or 25 minutes, it's only going to trigger WHEN it becomes secure or not secure - again, that "moment" in time. Now, if you would like something to occur 5 minutes AFTER the door is opened, you can set a phantom output to turn ON for 5 minutes, WHEN the door is opened. WHEN that output is turned off (5 minutes after the door was opened)... do something.
 
I've come to expect this sort of reply from you. You must recall that I did ask. As a matter of fact there are three pages in this message thread on this topic and I'm sure that you also know that you did not have an explanation. I also inquired on the Elk tech support forum and they haven't replied.
 
Mike.
 
Mike.
 
I've come back to many of your threads time and time again to offer assistance and help, just as I did again above... and I've come to expect this sort of reply from you - 2x on the previous page if we want to keep track.
 
What I stated previously was that I don't have any insight as to how Elk's code is written, so I cannot answer with any CERTAINTY how things are handled behind the scenes. Only Elk can answer how the backend is coded, and I doubt they are going to - as you've found with your lack of response on the Elk support forum. Similar to how I expect my responses to be in the future ;)
 
Back
Top