[Released] Rule 4.0

You guys are awesome.

1 Like

@bravenel, I posted this further up, but it got lost in the mix, and the Rule 4 rule didnt work this morning. Can you please check logic?

Will this work - moving from Rule 3 to 4? The purpose of the rule is not to have the lights turning on/off if the lux hovers around 150. I want a delay (short for getting darker, longer delay for getting brighter)

Rule 3
image

Rule 4 (the 10 second delay is so as to not cancel the newly cancellable delay)
image

You've got to turn on all of the logging and see what happens.

Create a virtual illuminance sensor using Virtual Omni Sensor. The you can test the rule with it by using that instead of the real one you have.

Here is one I have, works great. Uses a high value to turn off and a low value to turn on, this way no ping pinging with a bit of clouds going by....

Just add an End-if at the ...well, the end :grinning:

Rick

Yeah, I was coming to that conclusion. I can see now what the problem was with mine. The Lux sensor reports in every 10 mins. The 10 minute (plus 10 seconds) delay resultsed the newest lux value which was also >150 cancelling the delay from the previous reading, which meant that the GV did NOT change.

Thanks!

10 posts were split to a new topic: Using Rule 4.0 Variables for Time

@bravenel, It seems that it's not possible to use a simple condition with the condition being private boolean of a different rule. I want to set the PB of the other rule, but only if the PB is false. Is that by design?

Edit: cant do it for a IF THEN statement either.

Yes it is. Only a the rule itself can read the state of the private Boolean. Why donā€™t you use a global variable for that? Global variables can be read and set by any rule.

Even though I am not sure why you want to do it that way. If the PB is true, what is the problem with setting it to true again? It wonā€™t invoke a change...

That's why they are called Private Booleans. They are not accessible for testing in other rules. You can use a Boolean Global Variable instead.

The Wait for Condition bug has been fixed. New hot fix release: Hub Update 2.1.3

This bug was fixed, get the newest release, although it was fixed in prior hot fix.

This bug with editing IF-THEN has been fixed in latest release. Hub Update 2.1.3 - #5 by bravenel

Thanks! You guys are awesome!

TY Bruce and the rest of the team

Rick

Ok, I realise it is a private boolean now.

@bravenel

I've scene this error a few times. App 5 is Rule Machine.

That's a database error. I've seen it also, just a time or two -- as if it was some transient glitch.

Need help with what is likely to be a simple 4.0 rule but Iā€™m just not understanding most likely...

So I have closets in my bedrooms that are double sliding doors. I have a contact sensor on each door (left and right). I want the light in the closet to come on when either door opens, but only shut off when BOTH doors are closed. If both or one door doesnā€™t close after 15 minutes, shut off the light (so itā€™s not on all the time if someone forgets to shut a door).

The rule Iā€™ve created turns on the lights, but when I close the doors the lights do not shut off. Iā€™m also not understanding how to add the delay for turning the lights off after 15 minutes if the doors are open.

Any help would be appreciated. Thanks!

Insert an ENDIF before the second IF.

1 Like

Either what Mike said above Or

Change the second If to ELSE IF, then put ENDIF at the end should work.

1 Like

Built in variables for actions in Rules 4.0? I am converting a lot of WebCore pistons from SmartThings to Rule 4.0. And one thing I have been looking for is what variables are pre-defined. in SmartThings when I had a list of devices that would trigger an event the variable $device would be populated and I could use that to build strings for notification.

For example I have 5 leak sensors and I set the trigger to have all 5 devices. One of those statements would trigger the rule and then in actions how do I determine the device/rule that triggered it.

I went to your documentation page and couldn't find anything on variables and searching hear hasn't turned up anything but the new local variables. Is there a article or documentation page that I am missing?

Thanks.