I am using a 2-button Lutron Pico next to my computer to mute my radios/Tvs via a RM action whenever I get a work call, but sometimes it registers twice (it will mute then unmute). It's very annoying because when it happens, it doesn't seem to happen only once, I have to press the button 3 or 4 times before it registers as a single click.
Is there a best way to 'debounce' the button? I can set a variable when the button is pressed and check to make sure that it hasn't been pressed within a second or two to run the rule, but I'm wondering if there is a better way.
I use pico remotes throughout the house and have never even once had a need to debounce the data. Can you please share a screenshot of the Pico device's "Events" showing where it is firing in quick succession leading to the need to debounce it? I am genuinely curious if the issue is with the Pico remote data coming into Hubitat (i.e. the Device data), or if maybe there is an issue on the App side of things.
Ok, this seems to be one of the instances. Generally, I press button 2 to mute, and button 1 to unmute, so I should always see them in groups of 4 (button 2 pressed, button 2 released; then button 1 pressed, button 1 released).
Seeing the same button events happening multiple times in a row within seconds of each other probably means I had to keep pressing the button to mute or unmute.
Thanks for sharing those screenshots. What I am seeing is not a case of classic rapid fire inputs of the same signal, that would require true 'debounce'. As you mentioned, you pressed button 1 multiple times to try and get the system to react. Each of those button presses are shown in the event history.
If you pressed button 1 one time, and it resulted in mutliple 'pushed' and 'released' events, in rapid succession (like under 1 second total time), then debounce would be called for.
My feeling is that the issue may be within the automation you're using, or possibly the device that is supposed to receive the mute/unmute commands.
The "Fast Pico" driver only sends 'pushed' and 'released' events.
The "Lutron Pico" driver sends 'pushed', 'held' and 'released' events. In order to determine if the button was pushed versus held, the driver has to wait for a period of time waiting to see if a released event comes in, before the 'held' timer expires... Thus, there can be a slight delay on this driver sending a 'pushed' event as compared to the "Fast Pico" driver, but one gets 'held' events as the bonus.
I'm using this to 'mute' anything that may be making noise at that time. I listen to the radio in the morning, then switch to a TV to listen to the news later in the day. There are 2 radios on outlet plugs that turn on and off, one Broadlink device to mute a TV and Receiver, and another Broadlink device muting a TV and clock radio. Also, i'm pausing my Botvac robot vacuum if it's running.
The radios and TVs come back on, whether it's the ones using outlet plugs or the ones using the Broadlink remotes. I don't recall if it pauses and unpauses the vacuum as it's not usually running when I have to mute, so I don't know the status of how that is working.
The next time it happens, I'll try to verify that it is happening on all devices, but other than the vacuum, i'm pretty sure it is affecting all of the devices that are on at that time.
Is there anything I could look for that might be what you expect? I only looked through the events to find the same button being pressed multiple times, most of what I see is in groupings of 4 as i expected. If there's something specific in there that might be more indicative of an issue that I can look for, i'll check again.