thenewwazoo / homebridge-lutron-caseta-leap

Homebridge support for Lutron Caseta Smart Bridge 2
Apache License 2.0
79 stars 28 forks source link

Exposing In-Wall Dimmer Switches as Switch accessories #5

Closed lilyball closed 2 years ago

lilyball commented 3 years ago

Is your feature request related to a problem? Please describe: I really want to be able to expose my Lutron Caseta In-Wall Dimmer Switches as Switch accessories in HomeKit. Lutron's native HomeKit integration only exposes the lights, not the switches themselves. My goal here is to be able to write automations that trigger based on pressing the physical switch buttons rather than based on lighting changes (e.g. pressing the off switch should be able to turn other lights off, but turning off the light with HomeKit shouldn't affect the other lights).

Describe the solution you'd like: I don't know if the In-Wall Dimmer Switches are directly exposed via LEAP for monitoring, but I sure hope so. And if so, I'd love for this plugin to at least have the option to monitor them for addition to HomeKit.

Describe alternatives you've considered: I asked the maintainer of a different plugin that offers pico remote support about this, that plugin uses the telnet protocol with the Smart Bridge Pro, and they said the telnet protocol does not expose the In-Wall Dimmer Switch button events. I don't know if that's actually true or if they just don't know how to enable monitoring of that, but I don't have a Smart Bridge Pro to test with (and I'm not going to buy one just to experiment).

Beyond that, I'm not aware of any other alternatives to try.

Additional context: I have a Caseta Wireless Smart Bridge and a whole mess of In-Wall Dimmer Switches. I also have pico remotes and would ideally love to expose those, but I'm far less concerned about those, it's really the physical switches I care about right now.

lilyball commented 3 years ago

I'm also not sure if In-Wall Dimmer Switches can even be exposed as "switch" accessories or if they're strictly "light" accessories.

lilyball commented 3 years ago

I've been trying to find actual documentation on LEAP and I cannot find anything. And I'm not sure how to use lutron-leap-js to experiment interactively.

thenewwazoo commented 3 years ago

Hi Lily!

LEAP is a totally undocumented, proprietary protocol by Lutron. I'm not aware if Lutron has any kind of developer relations/outreach program, but I doubt it. They're friendly but I don't think we're their target market. :) The best resource I've found is actually their Android app, which can readily be decompiled to show how Lutron accomplishes what they choose to implement in their phone UIs.

To date, I haven't seen any indication that the non-Pro hub generates button press events, for Pico remotes or any other device. I have read (third-party library) documentation online to indicate that the Pro hub does send button press events via the LIP (Lutron Integration Protocol aka telnet) protocol. As I've mentioned in comments elsewhere, I strongly suspect that the (otherwise-unused) subscription method in LEAP can be used to request button press events, but my experimentation to date hasn't succeeded, and I've not planned to budget the cost of a Pro hub in order to reverse engineer it.

I've got some code somewhere to exercise lutron-leap-js - basically you just run a top-level async function to await the client repeatedly, with whatever reaction logic you want slipped inline. I don't know if there's a way to do it with a REPL (I don't really, like, do JS/TS).

lilyball commented 3 years ago

There’s another plugin that uses LIP with the Pro hub to turn Pico remotes into HomeKit buttons. I asked the author of that plugin if it could get button presses for the dimmer switches and they said no, it just reported light level changes, but I don’t have a Pro hub to test with.

thenewwazoo commented 2 years ago

Hi @lilyball, I just got done adding support for Pico remotes (release forthcoming), and can now definitively say that buttons on non-remote devices aren't exposed in any way I can find. That's not to say it's impossible, it's just not something I can see a way to do.

The response from the hub for an in-wall dimmer looks like:

{'href': '/device/14', 'Name': 'Fan Light', 'FullyQualifiedName': ['Terrarium', 'Fan Light'], 'Parent': {'href': '/project'}, 'SerialNumber': 51726971, 'ModelNumber': 'PD-6WCL-XX', 'DeviceType': 'WallDimmer', 'LocalZones': [{'href': '/zone/11'}], 'AssociatedArea': {'href': '/area/11'}, 'LinkNodes': [{'href': '/device/14/linknode/14'}], 'DeviceRules': [{'href': '/devicerule/27'}], 'AddressedState': 'Addressed'}

There isn't an associated ButtonGroup, which means there aren't any buttons.

lilyball commented 2 years ago

@thenewwazoo Thanks for following up on this. I did end up getting a Pro hub and confirmed myself that the telnet protocol doesn't get button presses for in-wall dimmers. I'm disappointed but not surprised that LEAP doesn't either. I contacted Lutron System Support to ask about it as well and they confirmed that the Telnet protocol doesn't support this and that they've "passed this feature request to our product manager and engineering team for consideration as a future possibility with such Telnet Integrations", though they didn't mention LEAP.