I need some help understanding what is going on behind the scenes when rules are used in OH3 because there is something going on that cannot be explained by the actual rules themselves.
So here is the story. Yesterday, I set up a couple of rules controlling the lights in the bathroom and they worked fine. In a nutshell, there is one rule that turns on the lights under certain conditions and one rule that turns them off under certain conditions. The setup worked fine yesterday, but today, I started seeing this weird behavior when the lights wouldn’t stay off whenever I turned them off. Turning the lights off triggered something that would turn the lights back on.
Indeed, there is a rule that is triggered whenever the lights are turned off. But that rule obviously isn’t programmed to turn on the lights. What it does is it reactivates a rule that triggers when the door sensor state changes to “OPEN” (In case you’re wondering: the point of deactivating the rule as long as the light is on is to prevent to door sensor from turning the light back on when you just it off and open the door).
Anyway, that door sensor rule does turn on the lights when triggered, but turning on (i.e. enabling) the rule should not trigger it, right? And, of course, the door sensor was continuously on “CLOSED”, so it should not have triggered.
To rule out that this issue was unrelated to OH3 rules. I disabled all rules related to the bathroom. With all rules disabled, I was able to turn off the lights and they stayed off.
I then wanted to turn on the rules again one by one to confirm whether it is indeed the “lights turned off” rule that triggers the lights going back on (via the door sensor rule), but after all the rules had been off and turned on again, I was no longer able to reproduce the issue.
I did test whether I could get rules to trigger when being activated but under normal circumstances this is not the case. Could it be that - under certain circumstances - rules trigger when activated?
Alternatively, if the weird behaviour could be explained by some internal processes that are not visible in the foreground.
Could someone explain?