Visual Rules Builder < No IF statement?

IF light is on do something ?
IF light is off do something ?
IF button controller is pushed do something ?

Or am I missing something ? LOL

Nope, you've missed nothing :smiley:

I'd say you're interpreting it differently from me, though. :slight_smile:

Screenshot 2024-05-26 at 10.14.16 AM

I interpret that Rule to read: IF it's 30 min before sunset, do turn on a bulb at 3600k

To me, the IF is implied by the first condition.

1 Like

Can you look here ..

Not sure how to do this with out a IF statement ..

Visual Rule Builder does not support conditionals with "branching." If you need that, for now you'll need Rule Machine (or BC or some other app). This may never happen, as its goal was to be more like Basic Rule, where you will also not find this -- though of course things change sometimes.

But...

This one is a bit different. That's just a regular "trigger" (in VRB or any rule-type app, e.g., "button 1 pushed") with "something" as your action.

If this is the same question, I would not suggest making a duplicate post. But I'm not sure what the question is; your Button Controller doesn't have any IFs, either. You can do this in Visual Rule Builder with five separate rules, one for each button number and event (just like each of those Button Rules is actually a separate "grandchild app," although they are grouped under the same child app in the UI -- if you want that, stick with BC).

1 Like

well .. it really is two different questions ,, but ok ..
I was wondering on the first one how to do something and on the second post this one I was wondering if I was missing something that I did not see an if statement of any kind ..
I know I can do it but button controller or rule machine or any of the others I was just wondering if it was possible to do something with VRB and I didn't see a if statement.

Not sure it would be that difficult to add an if statement to VBR but anyway looks like there is not one.

Would look like this ..

when button 1 is pushed < turn on light <set light to 10% < IF Light is on < when button 1 pushed < turn off light

The whole Rule in VRB is an IF.

It starts with IF, invisibly, implied, whichever word works. :slight_smile: Nothing to add because it's there already.

1 Like

Ok figured it out .. with the help of [csteele] and [bertabcd1234]
Looks like VBR is basic you have to make ( 3 ) rules to make this work.
Anyway ,, just a experiment .. to see how / what to do .. make this work :slight_smile:

Rule 1. if button 1 is pushed toggle light
Rule 2. if light is on set it to 10%
Rule 3. if button 1 is pushed (2x) turn light on 100%

Wouldn't Rule 3 then trigger Rule 2 which would then set it to 10%?

1 Like

I think it worked .. I will have to retest ..
But I think what happens it turns it to 10% THEN after a sec .. I hit 2x and it goes to 100
since it was already a 10% it has done its job and then the 2x works ..

Just tested again .. and sure enough that's what happens ...
push button 1x > light on > light to 10% > push 2x light ramps to 100% > push button > light off
push button 1x > light on 100% > ramps to 10% > push button > light off

My guess ... Is that that the 2x command is a different rule so it ignores the 1x commands.

Still would be much easier if there was a IF statement you could use.

1 Like

To me they start with a When not an If.

2 Likes

No specific "if" would only be a problem in this example if you needed to test the button press had actually worked and the light had indeed come on before setting it to 10%. Usually we like to assume the light was responding to the rule in the first place.

I'm not sure what you mean, so maybe this isn't it, but the rule will only trigger based on actual events (like the light turning on), not commands (something telling the light to turn on, perhaps another app or you manually from the device detail page or dashboard).

Visual Rule Builder is intended to be similar to Basic Rule and lacks conditional expressions and branching based on that like you'll find in Rule Machine. I think that is the crux of the question.

1 Like

Yes I was addressing the philosophical aspect of jedward's comment :smiley:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.