This page last changed on Nov 23, 2013 by bayram.

Hi,

first I want to thank the Openremote team for all your work.

I'am a beginner and use openremote for my KNX. Everthing work great. I have creat a panel for my iphone with my commands. I use makros allso.
Now I wankt to test the Rules but it don´t work.

I use the
Scheduled Rule Example for my test i creat a makro like that one in the example "All Lights OFF" and test it positiv on my panel.

I copy the example in the rule editor an sync with controller. I find the rule in the modeler_rules.drl.
I only change the time in cron like. but nothing happens.

package org.openremote.controller.protocol

global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;

rule "Lights off at 22:45"

timer (cron: 0 45 22 * * ?) when eval (true) then

execute.command("All Lights OFF");

end

my cmd

C:\OR\bin>openremote run
Using CATALINA_BASE: C:\OR
Using CATALINA_HOME: C:\OR
Using CATALINA_TMPDIR: C:\OR\temp
Using JRE_HOME: C:\Program Files\Java\jdk1.6.0_45
23.11.2013 01:08:27 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performanc
e in production environments was not found on the java.library.path: C:\OR\webap
ps\controller\WEB-INF\lib\native
23.11.2013 01:08:28 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
23.11.2013 01:08:28 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2880 ms
23.11.2013 01:08:28 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
23.11.2013 01:08:28 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
23.11.2013 01:08:28 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive webconsole.war
23.11.2013 01:08:34 org.openremote.controller.bootstrap.Startup redirectJULtoLog
4j
INFO: Initialized JUL to LOG4J Redirector.
INFO 2013-11-23 01:08:55,251 :

--------------------------------------------------------------------

DEPLOYING NEW CONTROLLER RUNTIME...

--------------------------------------------------------------------

*****************************************************************

The license restrictions Sigma Designs places on Z-Wave
implementations prevents us from distributing Z-Wave with
an Open Source product.

To test Z-Wave, download a freely available binary from
http://download.openremote.org/free/zwave and follow the
installation instructions at http://www.openremote.org/x/xAo4AQ

*****************************************************************

INFO 2013-11-23 01:09:12,224 : Initialized event processor : Drools Rule Engine
INFO 2013-11-23 01:09:12,552 : Initialized event processor : RRD4J Data Logger
INFO 2013-11-23 01:09:12,567 : Initialized event processor : EmonCMS Data Logger

INFO 2013-11-23 01:09:15,594 : Registered sensor : Switch Sensor (Name = 'Kueche
Dunsthaube', ID = '1001')
INFO 2013-11-23 01:09:15,625 : Registered sensor : Switch Sensor (Name = 'Dachge
scho▀ Decke', ID = '702')
INFO 2013-11-23 01:09:15,640 : Registered sensor : Switch Sensor (Name = 'Kind2
Decke', ID = '703')
INFO 2013-11-23 01:09:15,656 : Registered sensor : Level Sensor (Name = 'Essen E
sstisch', ID = '1003', Min: 0, Max: 100)
INFO 2013-11-23 01:09:15,703 : Registered sensor : Switch Sensor (Name = 'Kueche
Esstisch', ID = '700')
INFO 2013-11-23 01:09:15,734 : Registered sensor : Switch Sensor (Name = 'Kueche
Decke', ID = '701')
INFO 2013-11-23 01:09:15,765 : Registered sensor : Switch Sensor (Name = 'GWC De
cke', ID = '698')
INFO 2013-11-23 01:09:15,781 : Registered sensor : Switch Sensor (Name = 'Diele
Decke', ID = '699')
INFO 2013-11-23 01:09:15,796 : Registered sensor : Switch Sensor (Name = 'Essen
Esstisch', ID = '696')
INFO 2013-11-23 01:09:15,828 : Registered sensor : Switch Sensor (Name = 'Bad De
cke', ID = '697')
INFO 2013-11-23 01:09:15,859 : Registered sensor : Switch Sensor (Name = 'Bad OG
Spiegel', ID = '993')
INFO 2013-11-23 01:09:15,874 : Registered sensor : Switch Sensor (Name = 'Schlaf
en Decke', ID = '694')
INFO 2013-11-23 01:09:15,906 : Registered sensor : Switch Sensor (Name = 'Anklei
de Decke', ID = '695')
INFO 2013-11-23 01:09:15,921 : Registered sensor : Switch Sensor (Name = 'GWC Fe
sntersteckdose', ID = '995')
INFO 2013-11-23 01:09:15,952 : Registered sensor : Switch Sensor (Name = 'HWR De
cke', ID = '692')
INFO 2013-11-23 01:09:15,984 : Registered sensor : Switch Sensor (Name = 'Garage
Decke', ID = '693')
INFO 2013-11-23 01:09:15,999 : Registered sensor : Switch Sensor (Name = 'GWC Sp
iegel', ID = '997')
INFO 2013-11-23 01:09:16,015 : Registered sensor : Switch Sensor (Name = 'Flur O
G Decke', ID = '690')
INFO 2013-11-23 01:09:16,046 : Registered sensor : Switch Sensor (Name = 'Buero
Decke', ID = '691')
INFO 2013-11-23 01:09:16,077 : Registered sensor : Switch Sensor (Name = 'Kueche
Backofen', ID = '999')
INFO 2013-11-23 01:09:16,108 : Registered sensor : Switch Sensor (Name = 'Gesimm
s vorne', ID = '689')
INFO 2013-11-23 01:09:16,124 : Registered sensor : Switch Sensor (Name = 'Kueche
Mikrowelle', ID = '987')
INFO 2013-11-23 01:09:16,155 : Registered sensor : Switch Sensor (Name = 'Terras
se OG Gesimms vorne', ID = '985')
INFO 2013-11-23 01:09:16,171 : Registered sensor : Switch Sensor (Name = 'Wohnen
Couchtisch', ID = '991')
INFO 2013-11-23 01:09:16,202 : Registered sensor : Switch Sensor (Name = 'Kueche
indirekt', ID = '989')
INFO 2013-11-23 01:09:16,218 : Registered sensor : Switch Sensor (Name = 'Kueche
-in', ID = '705')
INFO 2013-11-23 01:09:16,249 : Registered sensor : Switch Sensor (Name = 'Kind1
Decke', ID = '704')
INFO 2013-11-23 01:09:16,264 : Registered sensor : Switch Sensor (Name = 'HWR WM
', ID = '979')
INFO 2013-11-23 01:09:16,280 : Registered sensor : Level Sensor (Name = 'Essen E
sstisch SDL', ID = '707', Min: 0, Max: 100)
INFO 2013-11-23 01:09:16,311 : Registered sensor : Switch Sensor (Name = 'Terras
se OG Steckdose', ID = '706')
INFO 2013-11-23 01:09:16,342 : Registered sensor : Switch Sensor (Name = 'HWR Fe
sntersteckdose', ID = '977')
INFO 2013-11-23 01:09:16,374 : Registered sensor : Switch Sensor (Name = 'Terras
se OG Gesimms hinten', ID = '983')
INFO 2013-11-23 01:09:16,405 : Registered sensor : Switch Sensor (Name = 'HWR Tr
ockner', ID = '981')
INFO 2013-11-23 01:09:16,420 : Registered sensor : Switch Sensor (Name = 'Gast F
esntersteckdose', ID = '975')
INFO 2013-11-23 01:09:16,452 : Registered sensor : Switch Sensor (Name = 'Flur F
esntersteckdose', ID = '973')
INFO 2013-11-23 01:09:16,498 : Startup complete.
INFO 2013-11-23 01:09:16,514 : Controller Definition File Watcher for Default De
ployer started.
23.11.2013 01:09:17 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
23.11.2013 01:09:17 org.apache.catalina.startup.Catalina start
INFO: Server startup in 49621 ms

Thank you for your support

Unfortunately rules can not activate macros. Macros only exist in designer. If you bind a macro to a button, the designer takes care of binding all individual commands and wait period to that button.

Posted by pz1 at Nov 23, 2013 08:41

Thanks for your help, but i tried it with a command from the desinger and still nothing happens on 23:20. My command is:

package org.openremote.controller.protocol

global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;

rule "Büro Licht off at 22:40"

timer (cron: 0 20 23 * * ?) when eval (true) then

execute.command("Kueche-in-on_L");

end

Posted by bayram at Nov 25, 2013 22:21

"timer" keyword should appear after "when".

Posted by atamariya at Nov 26, 2013 03:36

Are you sure about this "when"? The Scheduled Rule Example in the HowTo suggests his syntax is correct.
I suspect there is something wrong with "Kueche-in-on_L". A typo perhaps? Or the umlaut in the rule name?

Posted by pz1 at Nov 26, 2013 07:42

No, timer should be used before when.

My tip why the rule is not working are typos in "Keuche-in-on_L" string not matching the command name or umlaut in rule naming.

Posted by aktur at Nov 26, 2013 08:50

I stand corrected.

Posted by atamariya at Nov 27, 2013 04:31

Thank you all for your help.

Now it works yeehr! I had some problems with rules editor. When i submit the rule to the modeler_rules.drl, the modeler_rules.drl
don´t get the neu content. I don´t know why but now it works.

cu bayram from Germany

Posted by bayram at Nov 28, 2013 18:33
Document generated by Confluence on Jun 05, 2016 09:38