Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add support for all button events #86

Open
nukefrenzy opened this issue Jan 28, 2022 · 18 comments
Open

Feature Request: Add support for all button events #86

nukefrenzy opened this issue Jan 28, 2022 · 18 comments

Comments

@nukefrenzy
Copy link

Pull request #81 added support for Pico button events. This allows Home Assistant to use Pico buttons as triggers, which is great for turning these into general purpose remotes for home automation. I would like to see this same functionality added to hardwired switches/dimmers/fan controls as well. There are many use cases for this. Here are a few examples:

Double-tapping OFF on a switch near a door will turn off all lights inside the house.
Double-tapping ON at the garage entry door will turn on all lights leading into the kitchen.
Tapping ON when a light is already on will turn on the rest of the lights in the area.

Is this info available through the Smart Bridge Pro and able to be added?

@thenewwazoo
Copy link

Hi! Friendly developer of homebridge-lutron-caseta-leap here. I'm not actually part of this project, but I obviously take inspiration from it. :)

My feeling about this is slightly complicated. The LEAP protocol has some kind of quasi-support for long press events, because I have been able to induce the hub to emit the following message:

{"MessageBodyType":"OneButtonStatusEvent","StatusCode":"200 OK","Url":"/button/105/status/event","ClientTag":"135b371c-072d-4f10-90c4-1632690bf13e"},"Body":{"ButtonStatus":{"Button":{"href":"/button/105"},"ButtonEvent":{"EventType":"LongHold"}}}}

Buuuuuuut. That was caused by a short tap of the up/down buttons in the Lutron iOS app. I cannot induce that message with a physical remote by holding the button down, and I cannot find any evidence of LongHold in any published LEAP library. I also cannot find any evidence of LEAP-native support for multi-press events.

So, LEAP might support long presses, and probably doesn't support multi-press events. That means any other press logic would need to be done on the library side. I personally feel (and I'm not a maintainer here) that this is better handled at the point at which the raw messages are interpreted by the automation system.

@nukefrenzy
Copy link
Author

For home assistant, I already have double-press events working using automations, but that's only for Pico Remotes. Long press should be possible too by timing the delay between press and release.

However, this feature request is asking for the hardwired switches to have their press and release events passed to home assistant. Right now there is no way to add them as an automation trigger.

As a developer of a similar project, is this info sent in a similar way as the pico remotes?

@thenewwazoo
Copy link

Ohhhh, I see! Sorry, I was confused, and now I feel kinda dumb. :D

I'm not aware of a way to expose button press events for non-Pico devices, as they don't have an associated button group.

@seanbeach
Copy link

Stumbled onto this 10 month old thread after switching from Hubitat to HomeAssistant, as I had the same behavior @nukefrenzy is mentioning back in Hubitat and most of my wife approved automations are now broken.

There is certainly some exposure of button events on switches as Hubitat supports it via their telnet integration.

@vincegre
Copy link

Stumbled onto this 10 month old thread after switching from Hubitat to HomeAssistant, as I had the same behavior @nukefrenzy is mentioning back in Hubitat and most of my wife approved automations are now broken.

There is certainly some exposure of button events on switches as Hubitat supports it via their telnet integration.

If you just need to know when a scene is active, you can do it through state of keyboard led ;)

@seanbeach
Copy link

If you just need to know when a scene is active, you can do it through state of keyboard led ;)

Both the OP and I were using the button press events on switches (not scene controllers) to change behavior based on the state of the connected load:

  • Is the switch already on at full but the on switch was pressed again? Turn on the rest of the room's lighting.
  • Is the switch already off but the off switch was pressed again? Turn off the entire floor and lock the door.

Unfortunately watching for indicator led states or load changes doesn't help us as those states don't change on redundant presses.

After poking through this repo it seems to be a LEAP vs Telnet integration difference, but I'm not around my site to experiment for a while.

@jerrm
Copy link

jerrm commented Oct 27, 2022

I'd also love to see this if there is any way possible.

I have a couple of switches mounted up in the light fixture with Picos on the wall just to have this kind of functionality.

@danaues
Copy link
Contributor

danaues commented Oct 27, 2022

Hey Guys,

It would be great to have. I'd love it too, but the LEAP interface simply doesn't expose any (button) events from the Switches and Dimmers. Only from the Keypads and Picos.

It's possible that there is some undiscovered subscription within the api, but at this time there is no way to implement.
Lutron does not provide us any api documentation unfortunately.

@nukefrenzy
Copy link
Author

nukefrenzy commented Oct 27, 2022

Out of curiosity, why is LEAP used instead of telnet if telnet has more functionality? Is it to cover the most devices because some don't support telnet anymore? I wonder why Hubitat uses telnet then? Just thinking out loud here, this functionality would be next level for my home setup.

@danaues
Copy link
Contributor

danaues commented Oct 27, 2022

Telnet is no longer supported on any of the new lutron products. Specifically RadioRA3 and Homeworks QSX, RA2 Select.
But this library is for LEAP support. There are other libraries that use telnet to interface with the older lutron bridges.

@nukefrenzy
Copy link
Author

nukefrenzy commented Oct 27, 2022

So technically we would tie another library into the HA Integration and provide support for both? I realize I'm asking a lot here since I do not know Python, but wondering what is possible.

Added a WTH to the HA forums here just to see interest on this: https://community.home-assistant.io/t/wth-cant-the-lutron-caseta-integration-detect-button-presses-on-all-switches/480944

@vincegre
Copy link

Unfortunately watching for indicator led states or load changes doesn't help us as those states don't change on redundant presses.

If your LED is coded in Lutron HWKS software as linked at a scene it'll mimic state of scene recalled on button ;)

@califa
Copy link

califa commented Jun 12, 2023

Has anyone figured this out since this conversation?

@carrel-gr
Copy link

carrel-gr commented Aug 10, 2023

This would be really nice! I've always thought that Lutron should implement this natively (using their hub and app). But if HA can do it, that would be even more useful. Being able to use button presses on Caseta switches as triggers, would really be great. Can telnet and LEAP both coexist?

Of course, one does then have to consider security. Telnet is the definition of insecure. How does this telnet interface work? is it read-only?

@FlyingDiver
Copy link

Can telnet and LEAP both coexist?

Only on devices which support both. Which is limited to Caseta (with Smart Bridge Pro) and RRa2 Select, as far as I know. Not RRa2 or RRa3 or Homeworks.

@vincegre
Copy link

Not RRa2 or RRa3 or Homeworks.

Yeah no more possible on recent generations of Homeworks processors unhappy :(only leap

@jhemak
Copy link

jhemak commented Jan 12, 2024

+1 for this capability

@Entropy512
Copy link

However, this feature request is asking for the hardwired switches to have their press and release events passed to home assistant. Right now there is no way to add them as an automation trigger.

As a developer of a similar project, is this info sent in a similar way as the pico remotes?

At least for a PD-3PCL lamp unit, this information would not be available because the lamp unit simply does not send button presses over the air. Instead, the unit broadcasts its ending state when the button is released.

https://github.com/Entropy512/lutron_hacks/blob/main/CC1101_captures/lampunit_buttons.txt

Lamp units do not respond with status after receiving a Pico command, at least not with direct pairing. It looks like I may have to give in and buy a bridge to continue my project, I guess I can just sell the thing once my project is complete. At least (it was a pleasant surprise) it looks like non-Pro bridges can be used with HA, I previously thought local control required telnet and hence was exclusive to the Pros but I guess I was wwrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests