I’ve been trying to understand this better myself. I’ve read a bunch of documentation, and I’m still a little confused.
I have the following rules for a servo which I plan to control my blinds:
// Servo
rule Servo
when
Item Servo received command
then
if(receivedCommand==UP){
sendCommand(Arduino, "105;10;1;1;29\n")
}
if(receivedCommand==DOWN){
sendCommand(Arduino, "105;10;1;1;30\n")
}
if(receivedCommand==STOP){
sendCommand(Arduino, "105;10;1;1;31\n")
}
I also have a rule to open the blinds at 0700:
rule "OpenBlinds0700"
when
Time cron "0 0 7 * * ?" // every day at 0700 (format 'second minute hour day-of-month day-of-week year(optional)')
then
sendCommand(Arduino, "105;10;1;1;29\n")
println("Blinds Opened at 0700")
end
In my OpenBlinds0700 rule, could I just use a postUpdate(Servo, UP) and have that change trigger my ‘Servo’ rule? I think this would require changing the ‘Servo’ rule from:
when
Item Servo received command
to:
when
Item Servo received update
Am I understanding this correctly, or is there a better way to do what I’m trying to do?