how to enable Drools engine and demo.drl execution

343 views
Skip to first unread message

wrbl...@gmail.com

unread,
May 26, 2013, 9:07:55 AM5/26/13
to ope...@googlegroups.com
(sry for repost, original posttitle wasn't in English)

Hi,
the Drools engine doesn't seem to work for me.
I've followed this guide http://code.google.com/p/openhab/wiki/Drools and downloaded

openhab-runtime-1.2.0.zip
openhab-demo-1.2.0.zip
openhab-drools-1.2.0.zip

and in this order extracted them to the same directory ("C:\openhab-runtime"). I then renamed "openhab_default.cfg" to "openhab.cfg".

If I now delete demo.rules or add "-DnoRules=true" to start.bat just after "java", the buttons in the DemoUI ( http://localhost:8080/openhab.app?sitemap=demo#_0302 ) stop working. So I can't enable or switch between radio stations, although the events show up on the console.

I haven't messed with any files, so they're all in their default state. And there is no mention of drools in the log files in /logs or on the console. Do I have to turn on Drools somewhere? What am I missing?

saba...@gmail.com

unread,
Jun 2, 2013, 4:47:51 AM6/2/13
to ope...@googlegroups.com, wrbl...@gmail.com
Hi,

same here. Drools won't be executed, wether the demo.drl or the myown.drl.
Has anyone a solution? The openhab/drools wiki only says, just unzip the
package in the openhab base dir.

I'm using openhab-1.2.0 and drools-1.2.0.

Kai Kreuzer

unread,
Aug 29, 2013, 4:04:27 PM8/29/13
to ope...@googlegroups.com
Hi,

I am sorry that I didn't find the time to look after the Drools add-on, which seems to not work as expected in 1.2.0 (see below).
Besides very few requests, I do not really see anybody in the community showing bigger interest in this feature (and thus would possibly be eager to help out investigating on problems and maintaining this add-on).
For this reason, I am considering removing this feature with the 1.3 release (as it is currently broken anyhow). If anybody has a strong reason against this step, please speak up now!

Best regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vladimir Kulev

unread,
Sep 2, 2013, 4:14:48 PM9/2/13
to ope...@googlegroups.com
Hello,

In fact, Drools has much more power and flexibility with its user-defined facts and variable substitution.

For example you can use facts to define items metadata (which can be like tags or anything else) and relationships and then write rules based on that, instead of concrete items.
I tried it with version 1.1, and it proved to work quite well. Also I noticed and tried out possible ways to reduce Drools overhead in simple cases, where openHAB own rules currently have a big win.
There are other Drools module limitations (e.g. timer support) but this situation can be improved.

If you are interested, I can fix Drools support and then try improving it to be more useful. But before that I would like you to share your thoughts on this, maybe you already have your own plan on openHAB rules future :)

Kai Kreuzer

unread,
Sep 3, 2013, 2:56:22 PM9/3/13
to ope...@googlegroups.com
Hi Vladimir,

Agreed, Drools can be very powerful and if you are willing to support and even improve the Drools add-on for openHAB that would be wonderful!
Regarding the future plans: I think Drools will always stay an add-on for advanced use-cases, but with openHAB going to Eclipse to become an extensible framework, having multiple alternatives to define rules is definitely very welcome.

For the 1.3 release I would still suggest to remove it from the packaging, but leave it in the repo - so that once it is usable again, it can be included into a future 1.4 release.

Does that sound ok for you?

Cheers,
Kai


Vladimir Kulev

unread,
Sep 3, 2013, 3:21:58 PM9/3/13
to ope...@googlegroups.com

Sounds good. What is suggested way of sending changes back to you? I'm heavy git/github user, but not mercurial, guess this won't be a problem.

Vladimir Kulev

You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/DB1AlyC9ooo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

Kai Kreuzer

unread,
Sep 3, 2013, 3:23:47 PM9/3/13
to ope...@googlegroups.com
We will probably move to GitHub in the coming weeks, see https://groups.google.com/d/msg/openhab/fi6Y_O-2rok/k1Qa7RxoYs4J

So stay tuned :-)

Regards,
Kai

Sebastian Archut

unread,
Sep 3, 2013, 3:26:59 PM9/3/13
to ope...@googlegroups.com
Hello Kai,

in my opinion, the Drools engine is more powerful than the built in rules, while beeing more readable through the use of the straight syntax, which a coder feels familiar with. Your explained way, to possibly integrate Drools in the 1.4 release sounds good for me. I also think, Drools is more and easier extensible, so it would be sacrifice to drop the development.

Since I am actually using openhab in my home for some real world automation tasks, I would offer to do some beta testing, if needed. So, I'm looking forward to the future development.

So long,
Sebastian

You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/DB1AlyC9ooo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

Thomas Eichstädt-Engelen

unread,
Sep 3, 2013, 6:16:39 PM9/3/13
to ope...@googlegroups.com
Hi,

just out of curiosity: which rules do you use that can't be expressed through the openHAB rule DSL?

Best,

Thomas E.-E.

Karel Goderis

unread,
Sep 7, 2013, 10:04:16 AM9/7/13
to ope...@googlegroups.com
Kai

I am not familar with github, so I have the following questions: how will patches-in-the-making originating from code.google.com clones be integrated in github? 

K

Kai Kreuzer

unread,
Sep 8, 2013, 6:13:19 AM9/8/13
to ope...@googlegroups.com
Karel,

I am sure we will find some way to get such changesets tranferred as well.
This for example looks like a way to achieve it: http://felipec.org/2012/11/13/git-remote-hg-bzr-2/

Regards,
Kai

Amos Kittelson

unread,
Sep 10, 2013, 11:53:15 AM9/10/13
to ope...@googlegroups.com, saba...@gmail.com
I +1 for continued Drools support, especially when you can do things like Drools Decisions Tables and use Drools Guvnor. We implemented a very complicated setup of 3 touch displays maxtrixing 5 audio and 5 video sources, each with hardware triggers, locks, timers and options that affect rules. To get the functionality we needed we ended up with over 100 rules (most are redundant) for over 200 GUI element and A/V items. Some of the items are used as global variables or to overcome not having functions with returns. Its runs flawlessly (Kai will be happy to hear) but we're sure we could have done it more efficiently had access to decision tables and functions.

Kai I understand your focus has been on the home user so I appreciate your willingness to keep Drools as an option for power users.

Vladimir Kulev

unread,
Sep 10, 2013, 12:02:07 PM9/10/13
to ope...@googlegroups.com, saba...@gmail.com
Good news here, I already have Drools 6 integration working with master branch.
As soon as https://github.com/openhab/openhab is ready I'll publish everything.



-- 
Best regards,
Vladimir Kulev


Mobile: +358400369346, +79215554422

Jabber: m...@lightoze.net

Skype: lightoze

Kai Kreuzer

unread,
Sep 11, 2013, 1:31:12 PM9/11/13
to ope...@googlegroups.com, saba...@gmail.com
Wow, this sounds great!
So we will try to move the code to Github asap :-)

Cheers,
Kai

Kai

unread,
Oct 19, 2013, 3:58:34 AM10/19/13
to ope...@googlegroups.com, saba...@gmail.com
Hi Vladimir,

GitHub is ready, so I am waiting for your pull request :-)

Regards,
Kai

Vladimir Kulev

unread,
Oct 19, 2013, 3:59:17 AM10/19/13
to ope...@googlegroups.com, Sebastian Archut
OK, I'll try to do that soon :)


-- 

Best regards,
Vladimir Kulev

Mobile: +358400369346, +79215554422

Jabber: m...@lightoze.net

Skype: lightoze


Vladimir Kulev

unread,
Nov 14, 2013, 7:29:54 PM11/14/13
to ope...@googlegroups.com, Sebastian Archut
Well, I finally got time to do something with it :)
For now there is a working Drools module more or less equal to the old one: https://github.com/lightoze/openhab, with rules hot swap and so on.
Also I have in-progress implementation of getting static imports automatically like you do by computeLiteralClassNames()

But most importantly, I realized that I can't define requirements good enough. Could you point me to some publicly available real world OpenHAB script examples? That would help a lot to figure out what is frequently used and what is less useful.



-- 
Best regards,
Vladimir Kulev


Mobile: +358400369346, +79215554422

Jabber: m...@lightoze.net

Skype: lightoze


Kai Kreuzer

unread,
Nov 15, 2013, 3:29:22 PM11/15/13
to ope...@googlegroups.com, Sebastian Archut
Hi Vladimir,

This sounds great!

Best regards,
Kai
Reply all
Reply to author
Forward
0 new messages