Rule in App ¨Button controller¨ ignore my conditional ¨IF¨

Hi overthere...
when im starting to think im 0.001% less of a newby on the hubitat i I encounter this type of problems

What i am doing wrong on the next rule? (is Maked on the Button Controllers)
Short story,in the picture down you can see the condition is FALSE and even on false,if i push the button the action is triggered

Is pretty straight forward,i have a Hue dimmer switch v2

When i push the button 4 all the lights came off and only if all the lights are OFF my fan should turn off if i push again the button Isn't ?

the problem is,,,when the light named ¨cama¨is on,if i push the button 4, turn off both,the fan and the¨cama¨ and thats wrong Isn't ? 1 push should turn off ¨cama¨ and a second push turn off the fan.
Any Idea?
Thanks

The statements are executed in order. If I am understanding correctly, I think you may need to move the action that turns off the lights to after the conditional turn off fan to get the behavior you are looking for.

4 Likes

This is not correct. Button Controller works very similar to Rule Machine. When button 4 is pushed, you rule as currently written:

1.) Turns off the four lights
2.) Checks the if's condition, if it is true, will then turn off the fan. Since the first step is turn off the four lights, the if will almost always be true.

If your goal is to have to push button 4 twice in order to turn off the fan, you need to put the simple conditional action first then put the off command second. This way, Hubitat will check the condition first, and if false, will leave the fan on before issuing the off command to the four lights.

Also, if you didn't do it, just write the fan rule as a simple conditional. This way, you would not need the end-if.

1 Like

Thanks¡¡¡ you were right that did the work:

but im a little confused,i knew the actions will be executed in order,so in my head is

1-the first order is turn off A,
2-later,turn off B if the first ones are off and and never turn off B until the first one is off
3- if the A Is off turn off B

and im confused because I had made similar rules in Rule machine and they work (But i think usually to turn on things instead of turn off)

belive me...im gonna keep in mind for ever this post @_@

HI

Yes, my goal is push twice to turn all off basically, but single push when the lights are off to turn off the fan

Yes,that did the trick
(well im using right now the long way,but is basically the same,maybe later im gonna simplify the rule with the simple conditional as you suggest)
ps: but i always though the conditional, in this cases, they came after the command (My rule now works as i want) and not before

Thats the part were im confused,why even with the condition as false the rule ran and execute the off fan command in my ¨old¨ rule (as show on my first pic)

The false just indicates the current state of the conditional when you are looking at the rule. In other words, when you open the rule when any of the four lights are on, the conditional will show as false. If you were to open the rule when all the lights are off, it would show as true.