RM inconsistency after PB flip

@bravenel

Iā€™ve got another couple rules that are acting funny in RM 3. These are my master bath lighting rules. the contact rule flips the PB of the motion rule when the door closes, and then goes back to true after a delay when the door opens. however the motion rule doesnā€™t work - at first anyway, after it is flipped back to true. If I hit the pico on the wall to turn the lights on for some reason this seems to reactivate the rule and it starts responding the motion condition again (the pico only adjusts the lights via the button controller app).

I primarily notice this at night, but that is also the primary time the door is closed. Iā€™m not sure if it is happening during the day or not.

the logs show the motion rule becoming true, but even then the light still donā€™t turn on.

contact rule restriction also includes switch to disable rule: v people sleeping, disable when off.

thanks

Turn on rule logging to see more detail. Try to catch it in the failure and the post the logs for it.

@bravenel,

I mentioned this last week a few times, and showed you rules and logs. You indicated it was fixed in an upcoming release.

1 Like

Here are the logs. The rule is read as true, but itā€™s not evaluated.

Just an FYI, Iā€™m still seeing this error with the recent update.

thanks

I don't see PB being used in the rule. Is it a disable Restriction?

Also, please enable all logging on the rule that doesn't work right, and isolate your logs to just that app. The logs you've showed do not show the Motion rule becoming true. So there is not enough information to go on, nor the right information.

@bravenel you're right in that the logs don't show the rule turning true - but you can see when master bathroom light rule is set true from master bathroom contact rule. master bathroom light rule is restricted by PB. I do have logging turned on. the issue is that even though the rule is being set to true (that action is in the logs) and the condition for the rule is true (the motion sensor in the logs), the rule is not being evaluated.

after I turn the lights on with a button, then all the sudden the rule starts working again.

I can try and get more logs if needed, but I think this is all that the logging is showing me. the rule is set to true, but then not evaluated even though the conditions are true.

Are you sure that rule truth changed? That's why seeing more logs is needed. Just the condition being true is not enough, there also has to be rule truth change for the rule to do anything. I can't tell from what you've shown me. It could be that there is a problem, but I can't tell.

it should be true at time 21:28:45:023. what does that arrow denote?

That was Shower Fan Off. The rule you posted is Master Bathroom Light Rule.

gotcha. here is the log. the lights did not turn on after the motion sensor activated.

In the logs it says:

Action: Set color: Master Bath Group ->Red ->Level: 8

That was in response to the rule becoming true.

So isn't that turning on the light? Isn't that what you would expect it to do?

yes. that was me testing it. then i closed the door, which set the boolean to false at time 18:32:12.121, then back to true 1 minute after I opened the door again at 18:33:21.079. then I walked back in the room, triggered the motion sensor, but it didn't trigger the rule.

this only occurs after the PB has been flipped to false and then back again to true, and only the first time. After I manually turn the lights on, the rule responds normally again.

What the logs show is that the motion became active after the Boolean was set true, but the rule was already true at that point. So it's not going to turn on the light since there was no change in rule truth.

hmmm. iā€™ll do some more testing. if a PB changes to false, does it save its current state? I would have thought that fipping it false, and then true again would open to be fresh evaluation from a null state.

No, the PB set to false simply means the rule is blocked from running. Flipping it to true does not make it run, or evaluate the rule (both are different), it simply means the rule is not blocked from running.

You need to also do one of two things - the best place is in the rule that flips the PB, after the PB has been set to true. Either evaluate the rule (which will determine the truth status of the rule, and act accordingly), or run rule, which will run the rule (regardless of the truth status, but only the true side of the rule will be actioned). This is from my understanding, and I could be wrong.

By the way, in my experience, the PB errors have been fixed since the last update.

that is correct.

Iā€™m not expecting flipping the PB to evaluate the rule. the issue with this rule and sequence is that the time out on the motion sensor is less than the 1 minute delay that flips the PB. so I walk into the bathroom, the rule goes true. I close the door, the PB is false. I open the door, the motion sensor goes inactive, and then the PB flips true again. the rule never changes to false.

I expected the current truth value of the rule to be in a null state after flipping the PB, but it isnā€™t, its in the last state it was left in. I would expect this behavior with pause/resume, but I find this non-obvious with a PB change.

ultimately the solution is to either re-eval the rule after the 1 min delay, or change the delay to less than the time out on the motion sensor.

I sometimes feel like using Rule Machine is a lesson in @bravenelā€™s psychology. :smile:

anyway, thanks for your help.

Did you use PB as a Restriction to disable the rule? If so, the rule is completely disabled, and no attention is paid to its state during that time. Perhaps you should be using PB as a Condition, not as a Restriction.

damn. I think that might be exactly what I need. I kind of forgot that could be a condition.