This page last changed on Feb 08, 2015 by mschrauf.

I am interested if there is any option how to specify periodically available (not fired) rules with time restriction. The operation should only be performed during a specified period.

Something like that:

rule "Time-restricted rule"
time-effective 8:00
time-expires 10:00
when
Event(....)
then
do something...
end

It seems to me that we must write this form !!

rule "example"

timer (cron: 0 00 08-10 * * ?)

when

Event( source == "detection", value == "on" )

then

execute.command( "lampe_on" );

end

example : http://www.openremote.org/display/docs/Designer+2.0+-+Scheduled+Rule+Examples

Posted by pierre2302 at Feb 11, 2015 07:14

My problem is that this rule will not work correctly for me. The command is triggered every minute when "detection" is "on". Every minute the lamp will be set on.

If the timer is not set, the command is executed only once when detection changes from off to on. That's what I want, but with time restriction.

Posted by mschrauf at Feb 11, 2015 16:38

So maybe with a virtual control that passes "1" during the time slot, it is a little of diy
example

rule "horaire 1"

timer (cron: 0 00 8 * * ?)

when eval(true)

then

execute.command( "virtual_status", 1);

end

rule "horraire 2"

timer (cron: 0 00 10 * * ?)

when eval(true)

then

execute.command( "virtual_status", 0);

end

rule "essai" when

Event( source == "virtual_status", value == 1)
Event( source == "detection", value == "on" )

then

execute.command("lampe_on");

end

Posted by pierre2302 at Feb 11, 2015 19:31
Document generated by Confluence on Jun 05, 2016 09:39