This page last changed on Sep 04, 2013 by jon.gillioz.

hi all i have this in the rule section of or (pro 1.0.10)

rule "Lights off at 17:51"

timer (cron: 1-10 51 17 * * ?) when eval (true) then

execute.command("v1D ON");
System.out.println("lights on at front door rule");
end

and it dosent seem to work
can anyone see anytrhing wrong
thanks in advance

I suppose this is only part of the rules file and you have some declaration like

global org.openremote.controller.statuscache.CommandFacade execute;
at the top.

I have tested this rule and it's working fine for me.

Take a look at the logs when syncrhonizing the controller and see if any error gets reported when the rules are compiled.
If there is an error in the rules (anywhere in the rules), none of them will work.

Also double check that the command name is correct. But in that case, you should at least see the System.out output.

Posted by ebariaux at Sep 04, 2013 15:14

dont know what i did but today it worked is the command name case sensitive??

an other question is it posible to have an event go for a set period of time then stop .like using date time to get "is night " then turn lights on then after say 2 hours turn lights off??

thanks for your help

Posted by jon.gillioz at Sep 05, 2013 13:31

Yes, command names are case sensitive.

Also at this stage, there is no verification that command names are unique and the way they're exposed in rules does not take their device into account (it does not act as a name space), so you can easily end up with many 'power on' commands and that would be an issue for calling them from rules.

Posted by ebariaux at Sep 05, 2013 17:37

The timer function allows an initial delay (2h) to be set when a rule evaluates to true: Designer 2.0 - Controller Rules. This might work for your use case.

Posted by juha at Sep 06, 2013 21:31
Document generated by Confluence on Jun 05, 2016 09:41