Is there a way to detect a second button pressed while the first button is held?

Can we do a trigger for button 1 held AND button 2 pressed? Or button 1 and 2 pressed at the same time? Or button 1 pressed and button 2 pressed before button 1 released?

this is a device limitation, not a hubitat one...
I have yet to see/test a device that will allow this.

3 Likes

You could probably do something with 1 & 2 pressed at the same time. Make boolean variables for each button. When a button is pressed, set its variable to TRUE. When both variables are TRUE, do your stuff. Reset the variables to FALSE after 5 seconds or so. Pressing the buttons "at the same time" would just mean within 5 seconds of each other. I can't test it, but it might work.

Alternatively, you could maybe increment a variable when a button is pressed. When the variable changes to 2, do your stuff. Reset to 0 after 5 seconds.

This is for Z-wave, I don't know enough about Zigbee ...

I checked and the Inovelli LZW36 fan control switches can do this, but that may be a limited case. Here's what you have to consider . . .

Most typical switch / dimmer devices have a single rocker that pivots so its only physically possible for it to depress one button or the other at a time.

Something like the LZW36 has six separate physical buttons that can each be operated independently (i.e., the buttons aren't part of a single linked rocker), so you can press / release buttons independently and can activate them at the same time. In this type of device, multiple buttons could be held at a time. Another example is the Zooz Zen30 where it has both a "rocker" style dimmer section as well as a push-button for the relay. I think they work independently.

Though there may be separate events generated on the Hubitat sendEvent event stream, there will be a complexity on how you use this information in Rule Machine and other apps. In particular, consider trying to detect two "held" events at the same time. Since the events occur at discrete times, you'd have to detect something like "if (button X is held and then wait for button Y to be held before button X is released) or (button Y is held and then wait for button X to be held before button Y is released))." In other words, though "held" is logically an ongoing event ("you're still holding"), Z-wave devices actually treat it as occurring at a particular instant (the "held" occurs at a specific moment, the "release" occurs at a specific moment), so you have to account for that.

Update: Ugh. Further checking - the LZW36 implementation seems to be buggy. It properly generates events for Hold #1, Hold #2, Release #1, Release #2. However, for other hold / release patterns, it seems to "drop" the final release.

I tried this on a Pico and it doesn't do "multi touch" :slight_smile:

I press and hold a button, then click all the others one at a time and what I get is a message from the Pico telling me that the initial button is pressed/held. I never see any of the other buttons.

I press and hold button 5... I see the press and then hold. I then press each of the other buttons and get a single message indicating button 5 is pressed.

dev:766 2022-03-02 11:09:17.575 am info Office Pico button 5 was released
dev:774 2022-03-02 11:09:17.566 am info rcvd: DEVICE,2,4,4
dev:839 2022-03-02 11:09:16.641 am info Office WallOutlet is off [digital]
app:805 2022-03-02 11:09:16.309 am info Turning Off: [Office WallSwitch, Printer Switch, Office WallOutlet]
dev:766 2022-03-02 11:09:16.261 am info Office Pico button 5 was held
dev:774 2022-03-02 11:09:15.234 am info rcvd: DEVICE,2,4,3
dev:839 2022-03-02 11:09:13.412 am info Office WallOutlet is off [digital]
app:805 2022-03-02 11:09:13.083 am info Turning Off: [Office WallSwitch, Printer Switch, Office WallOutlet]
dev:766 2022-03-02 11:09:13.034 am info Office Pico button 5 was held
dev:774 2022-03-02 11:09:12.008 am info rcvd: DEVICE,2,4,3
dev:839 2022-03-02 11:09:09.960 am info Office WallOutlet is off [digital]
app:805 2022-03-02 11:09:09.629 am info Turning Off: [Office WallSwitch, Printer Switch, Office WallOutlet]
dev:766 2022-03-02 11:09:09.583 am info Office Pico button 5 was held
dev:774 2022-03-02 11:09:08.556 am info rcvd: DEVICE,2,4,3
dev:839 2022-03-02 11:09:06.815 am info Office WallOutlet is off [digital]
app:805 2022-03-02 11:09:06.484 am info Turning Off: [Office WallSwitch, Printer Switch, Office WallOutlet]
dev:766 2022-03-02 11:09:06.436 am info Office Pico button 5 was held
dev:774 2022-03-02 11:09:05.410 am info rcvd: DEVICE,2,4,3
dev:766 2022-03-02 11:09:03.900 am info Office Pico button 5 was released
dev:774 2022-03-02 11:09:03.890 am info rcvd: DEVICE,2,4,4
dev:839 2022-03-02 11:09:02.063 am info Office WallOutlet is off [digital]
app:805 2022-03-02 11:09:01.732 am info Turning Off: [Office WallSwitch, Printer Switch, Office WallOutlet]
dev:766 2022-03-02 11:09:01.686 am info Office Pico button 5 was held
dev:774 2022-03-02 11:09:00.660 am info rcvd: DEVICE,2,4,3
--- Live Log Started, waiting for events ---

As @mike.maxwell said, it's a device question.. as in: finding a device with "multi touch" :slight_smile:

2 Likes