Private Boolean

I also think I'm getting it. Correct me if I'm off?

I had assumed that the PB was a true/false that controlled whether the rule triggered at all. Thus, in my example, it would trigger over 63% humidity, and since (I thought) it could not retrigger with the PB false, then it would just be waiting for that later humidity drop before turning off the fan and resetting the PB to true.

However, the PB is actually just an inherent action-level boolean variable, but with the added functionality like a global variable in that other rules can interact or change it.

Since it does not apply at the trigger level, the rule retriggers (resetting the "wait"). In @neonturbo pseudo example, the control is split into two rules with the PB setting part in one, and the actions to take in another. In @Sakman example (and what I was trying to do) the setting and actions are in one rule – using IF/ELSE IF conditionals to route to the appropriate actions based on the boolean value. Both can work, and the choice of which approach is up to the user – the split rules may be easier to think through the logic, though.

1 Like

Correct. Lots of people do it in one rule, but I have an easier time with two.

With two separate rules, it is easier to think about, you can troubleshoot/edit the two parts of the rule quicker and easier, and you can also reuse the PB for other purposes if you wanted to or needed to.

1 Like

I have created these 2 rules to accomplish my goal of one notification only, each time the humidity reaches high and low points. Let me know if you think it will work. The first rule sets the boolean and second uses the results.

In the second rule, the "IF (Private Boolean is false") THEN" is unnecessary - if it gets to the ELSE, it's false.

Rather than tying your trigger for the second rule to the specific first rule firing (which I think will "fire" every time the humidity changes) , I would use "Private Boolean reports *changed*".

HI all, just wondering if I could get a hand with PB too please?

It's basically for a power plug with PM which I use on my computer - When I put it on Sleep mode the power sits at 6w, then increases to above 180w when it wakes up. if I am either running a lot of stuff or playing some CS GO it increases to above 260w.

I've managed to get it half working using 'Wait for condition:' however the rule keeps firing over and over again if it goes above 180W.

The VS My Computer is a virtual switch which I use for some other rules.

Here's my current 'half-working-rule' :

And here's my failed attempt using Booleans which I believe it's what I need to be able to achieve what I need:

Please can someone assist? I've been through different topics about this and RM documentation but I don't seem to have understood it properly.

Thanks in advance.

Your rule looks good to me. Private Boolean is currently false so the rule will meet the IF action when the power is reported over 180. Currently it's reporting 125 so that won't meet either the IF or ELSE-IF condition.

Thanks for getting back to me :slight_smile:

It's getting triggered endlessly though - I also tried changing the booleans around (true-false and vice versa) and had the same outcome.

I need it to only run again if the power decreases to equal or below 6W which is when it's off/sleep mode.

Any suggestions?

That's the way the trigger works. It'll trigger anytime there is a reported power change but your conditional logic will prevent it from taking any action. You can see the rule is skipping both the IF and ELSE-IF actions. There isn't a way that I'm aware of to stop it from triggering when an event happens but you may be able to change the threshold of the change to meet the trigger. Is there an option in the driver to change the resolution of the trigger (i.e. every 5W or 10W)?

1 Like

If the rule is executing the actions properly, and only when desired, then my recommendation would be to turn off the logging in the rule to keep your logs cleaner. :wink: Out of sight, out of mind.

Yes there is, I've set it to 10W (only does in increments of 5) now.

It does work as expected but I was just concerned about the rule spamming the hub to death by processing the trigger events like that? If this isn't a problem for the hub then yes I'll just turn it off and leave it.

I've changed the trigger as well from 'Changed' to this:

It's still testing it every second?

Probably... If the device is reporting power status updates to the hub that frequently, then I would try to configure the device to dramatically reduce how frequently it reports power status updates. Please show a screenshot of the device details page for the power monitoring device. Might be some simple things you can tweak on the device settings, and then click CONFIGURE to make sure the physical device is updated with the new settings.

That's the one.

Not too many settings, unfortunately. Be sure to click CONFIGURE to make certain the 10w reporting is sent to the device.

I just resumed my other rule with the 'Wait for conditions' and seems to run less often...

My only issue with this one is that if I am playing games or have lots of stuff running simultaneously then it will go over 180w at which point it will start triggering every second like with the other rule.

Yep, did this now :wink:

Here's an idea. Make two rules, on for >=180 and on for <=6.
In the >=180 have the action Resume <=6 rule and Pause itself
In the <=6 have the action Resume >=180 and Pause itself

It won't stop the device from updating its power level but it won't be running a Paused rule.

Worked like magic, see results:

So now it's Paused at 185w so even if I use more power while doing other stuff then the rule won't run.

status

I'll be working on a 'Washing machine cycle done notify' tomorrow once I get the logs from power usage - Would I be able to use the same logic? I don't quite get why the rule with Booleans wouldn't work for me but I'll keep trying to learn.

Again, thanks heaps... much appreciated.

I'm glad you got it working. I don't see why you couldn't use the same type of rule setup for your washing machine.

Here is one of my two Laundry is Done rules... Very simple, elegant, reliable design by @bertabcd1234!

Simply adjust the power levels specific to your washer and dryer (one rule for each), and the elapsed time parameter to prevent premature notifications.