FlyingDiver / Indigo-radiora2

Indigo plugin for Lutron control systems. Works with Radio Ra 2, Radio Ra Select, Homeworks QS, and Caséta
MIT License
6 stars 3 forks source link

Need to simplify HomeKit integration to Lutron Scenes via Indigo #47

Closed gt3mike closed 2 years ago

gt3mike commented 3 years ago

What is needed is some kind of hybrid device in the Indigo-radiora2 plugin that makes it possible to easily handle pressing and releasing keypad buttons while also tracking the LED status of the button. This is probably most useful for "toggle on/off" behavior for loads grouped into Lutron scenes.

Background: HomeKit integrates to Lutron directly/natively. But the integration is limited to controlling individual Lutron loads, not Lutron scenes. Scenes (groupings of loads at programmed levels) must be programmed into HomeKit directly, and then HomeKit sends commands to Lutron individually. This leads to loads coming on one at a time (popcorn).

I'm proposing to use Indigo as a bridge (HomeKit Bridge and Indigo-radiora2 plugins) to enable HomeKit control of Lutron scenes by exposing Lutron Keypad buttons to HomeKit as individual loads. This is probably most useful for "toggle on/off" behavior.

A "simple" example would be a room scene ("Kitchen Lights") that includes several dimmers that you want to turn on to preset levels and then off again. I want to be able to say "Hey Siri turn on kitchen lights" or "Hey Siri turn off kitchen lights". I have a Lutron keypad button set up as a scene toggle to accomplish this. (This could also be a phantom button on the RadioRA2 repeater.)

But simply exposing a keypad button as a light in HomeKit leads to undesired results. This is because a Lutron button in the indigo-radiora2 plugin has two events -- turn on (press), and turn off (release). HomeKit can only do one of those at a time. So, rather than exposing the button itself as a device, an action group needs to be created that includes turning the button on and then off again.

This works, but it still isn't sufficient, because the status of the device in HomeKit doesn't track the LED status of the button. So the light may appear to be on or off in HomeKit, regardless of what the actual loads are doing.

What seems to be needed is some kind of hybrid device in Indigo that handles pressing and releasing the keypad button and also tracking the LED status.

FlyingDiver commented 3 years ago

So I'm thinking this new "Scene" device is configured by specifying the keypad button that controls the scene, and uses the corresponding LED as the state of the device. This should work with any wall or table keypad that actually has an LED for the button. Even a virtual one (I think). Not sure if there's a corresponding phantom LED for the phantom buttons on the repeater. I'll need to test that.

gt3mike commented 3 years ago

Makes sense. I actually defined and programmed a "fake" 15 button tabletop keypad in the RR2 Windows software for my Alexa voice commands. It doesn't actually exist, so I get an error when I transfer, but it works perfectly for this sort of purpose.

gt3mike commented 3 years ago

Also, for the use case I am describing, my buttons will be programmed as "Toggle Control / Room Monitoring". I haven't thought it through completely yet, but I don't think it would matter if the button was programmed for "Single / Multi-Room Scene" or "Path of Light". If the LED status tracks what the keypad button does, I think it would work regardless.

FlyingDiver commented 3 years ago

Yeah, that was useful in the old mobile app, because you could "press" the buttons. The new one does let you do that. Sucks.

FlyingDiver commented 3 years ago

I started implementing this, then realized I might have been going down the wrong path. So let me summarize the behavior.

Assume there's a new "Scene Button" device in the Lutron program, and when you create that device you specify a keypad button it's associated with. It may or may not be a physical button, but it's known to the Lutron software and you can create a matching plugin device for it.

First, then a user presses the actual programmed scene button, either on a physical keypad or using the Lutron app, nothing special is done. That's all on the Lutron side.

Second, When a user turns "on" the scene device (presumably using Siri or Home app), the plugin "presses" the keypad button, then releases it. If there's a matching LED for the keypad button, the on/off state of the scene device matches the LED state.

gt3mike commented 3 years ago

This sounds good to me. I think one thing that's missing from your description is a way for HomeKit to track the status of the scene LED in your first example. Do you think that would be possible?

FlyingDiver commented 3 years ago

The device published to HomeKit would have a status, which would track the state of the LED no matter how it changes. At least, I think that's how it works.

gt3mike commented 3 years ago

Do you use a HomePod or an Apple TV as a hub, or are you hubless? I tried a HomePod Mini today and ended up returning it. The first automation I tried failed miserably, and didn't leave me feeling optimistic. I'm hoping I can do most of what I want to do using Indigo.

On Fri, Jan 1, 2021 at 6:35 PM Joe Keenan notifications@github.com wrote:

FlyingDiver commented 3 years ago

I have both. I'd have to check to see which is acting as the HomeKit master.

github-actions[bot] commented 2 years ago

Stale issue message

FlyingDiver commented 2 years ago

Maybe

github-actions[bot] commented 2 years ago

Stale issue message

FlyingDiver commented 2 years ago

Need to revisit this after the new HomeKit plugin is ready.