Need help with condition in app

Ok, I've added a couple dozen switches and scene buttons to my system. Now I want to use it.
I want to turn on a half dozen switches when I press a button on a remote. And then when I double tap it, turn all those switches off. I really don't want to clutter things up with two apps for one button so I set both kinds of tap to be handled in one app. Seems simple! Here's an app I've done:

When I press OR double click the button, I see the first log entry appear, but then the IF condition is always true and it never does the ELSE. Can someone explain how to create the condition? By checking if the "pushed" is equal to "1" makes sense, but it doesn't work.
I'd consider the button controller, but my small system is already getting to be a complicated nightmare, it's hard to tell what buttons do things to what devices.

Reverse the tests, do the IF on doubletriggered. When the button is double pressed, it is also pressed.

But it’s simpler with 2 rules. Easier to understand and debug.

Or use Button Controller.

1 Like

So a test for "pressed" will be true for a press, double tap, and held?

So when I click on the IF in the actions to edit it, I get this screen. Unfortunately, I can't click on anything to edit the condition, just cancel or done.

I'd still use button controller. Complexity is a a two sided issue. Are simpler rules, although of different types, more complex then complex rules using one app? There is a reason there are different solutions. Not everything is a nail that needs a hammer.

3 Likes

The rule is simple enough, just delete the rule and enter it again.

This isn't the way most drivers work (not any built-in driver, or any I'm aware of--it would be unusual).

No, that's not the problem in your rule. The problem is that you're testing for the value of the pushed or doubleTapped attributes. These are always going to be the last button number that was pushed or double tapped, regardless of what other events (button events or not) happen afterwards. If you wanted to do this in RM [EDIT: and all in the same rule; this would be easy in separate rules], you'd really need to test for the event name (more difficult but entirely possible) and possibly the event value (the button number, though as-written probably not since you have only one in your trigger event and you'd therefore already know).

But this is why Button Controller exists, and as mentioned above, I'd also recommend it. :slight_smile: It's basically Rule Machine but with button event triggers set up for you based on what you choose in the UI, making that part a lot easier.

4 Likes

So I deleted all the actions. Then rebuilt them like this:
image

I pressed the button once, then I double-tap it. And here's the log results:
image

I've tried this with other buttons and they all behave in the same manner.
When I create an action of custom attribute for the button, then select attribute of DoubleTapped, and comparison "=" value of "1". Is this the correct way to test for the double tap?