New install of OH3 & I’m testing rules. I set a lamp module set to turn on & off every 2 minutes but got no action. I also tried just setting a time trigger with the same results. It works if I click the “Run Now” button so I know the commends are right, just not triggering.
This seems really simple so I can’t see what could be causing the problem. Any ideas?
This would not be the correct way to do this - you are using a cron schedule so in effect both rules will be run at the same time and hence the lamp could get put in either state depending on which rule happens to run slightly slower (ie. last).
What you should do is a use a script to check the state of the lamp and then toggle it:
var myItem = XXX
if (myItem.state == ON) {
myItem.sendCommand(OFF)
} else {
myItem.sendcommand(ON)
}
Sunny, thanks. That would be a cleaner way to do it. I’m trying to stay with the GUI as much as possible. I set the ON rule for even minutes & the OFF rule for odd minutes.
Rossko57, I have not. Thanks for the suggestion I’ll take a look today.
Another place to look in addition to events.log is the developer sidebar. Type alt-shift-d to open it up and select the second tab. You can see Items events and rule events there which will tell you whether or not your rules are running.
I also tried triggering manually which results in teh item changing from 0 to 1 but the code in teh event monitor looks exactly the same. Don’t understand it.
Apparently it’s something to do with the dimmer. I tried again with a binary switch and it’s working without issue.
That doesn’t explain why it works manually & not from the timed rule but that’s all I needed for now so I’m not going to chase this rabbit any further.
Yeah I copied teh wrong one in there. There is a state event, then the confirmation.
Anyway, as I said I just needed to test this functionality aside from whatever problem the dimming feature is introducing so I’m good. Thanks for your help.