thenewwazoo / homebridge-lutron-caseta-leap

Homebridge support for Lutron Caseta Smart Bridge 2
Apache License 2.0
76 stars 26 forks source link

Make Lutron scenes visible to (and triggerable from) HomeKit #93

Open Launchbury opened 1 year ago

Launchbury commented 1 year ago

Is your feature request related to a problem? Please describe: I have three Lutron hubs with about 160 Caseta family devices. Large scenes (e.g. all lights off) can take up to 20 seconds to complete and provide a haphazard control experience.

Describe the solution you'd like: I would like to be able to describe large scene elements in the Lutron app, and then call these from HomeKit. For example, each Lutron hub would have an All-Off scene for the lights it controls. Then HomeKit only needs to issue three requests, one to each hub, and then each Caseta bridge takes responsibility for executing its portion.

Describe alternatives you've considered: I started exploring this in the context of the Telnet connection. Scenes are accessible there via DEVICE 0. However, the LEAP framework is so much more complete. I'm hoping scenes are accessible here also.

Additional context: The major downside to this is that HomeKit would have no access to which lights any Lutron scene controls, so it creates some opaqueness. However, in many cases, the benefit would far outweigh the downside.

thenewwazoo commented 1 year ago

Wow, okay, that's rad as heck, thank you so much for this request! To make sure I understand correctly, what you're seeing is slow response when setting up "normal" HomeKit scenes using the built-in Lutron HomeKit compatibility layer, and you'd like scenes configured within the native Lutron app to appear as HomeKit accessories (say, switches or lightbulbs or the like?).

Launchbury commented 1 year ago

That's right. My "Good Night" scene in HomeKit turns off lights one by one across 4 Caseta hubs, 2 Hue hubs, and a couple of HOOBS bridges. In the Lutron world, my 3 most used Lutron hubs each control about 50 lights and shades, and they are being instructed by HomeKit to turn them off one by one. Unsurprisingly, this takes quite a time to execute.

Instead, I would like to define a bunch of large scale scenes in each of the Caseta bridges that I use as building blocks when setting up a HomeKit scene. For example, I would define a "Good Night" scene in each of the hubs, and then use those scenes as components in the full-scale HomeKit scene. Lutron has worked hard to make large scenes happen seamlessly, so this would leverage all the effort they have put in. It follows the great computer science principle of placing detailed control near the device being controlled.

PS. I also emailed you separately in case it would be helpful to have an off-line discussion. Thanks!

Launchbury commented 1 year ago

Oh one thing else – you're right about speculating how the scenes should show up in HomeKit. Something stateless is probably ideal, as HomeKit will not be able to tell if the scenes are fully active (like it does with its own scenes). But anything like a light or switch would be a good approximation.

thenewwazoo commented 1 year ago

Awesome, I'm pretty sure I understand perfectly, thank you. I thought I was doing well with my 50 or so devices, but you're on another level. :)

In terms of UI, I can't think of a stateless device in HomeKit that the phone-side actually displays in a way that can be manipulated. For example, Stateless Programmable Switches (read: buttons) only have a "setup" view in the Home app to permit you to attach scenes, but there's no way to actually press the button with your phone. I haven't actually played with a Lutron-native scene yet to see how it exposes state, but I'll be able to once the development hardware arrives. :)

Launchbury commented 1 year ago

Looking through the set of HomeKit device types I think you're right. Scenes could be presented as a light or as a switch. As a first approximation you could have it auto reset in HomeKit shortly after invoking it.

Launchbury commented 1 year ago

I just checked the Caseta Pro bridge from the Lutron app. The scenes there behave quite like the HomeKit scenes. When the lights of the scene are set appropriately, the scene shows itself as "on". If any of the lights are in a different state, the scene shows itself as "off".