apwelsh / hubitat

MIT License
26 stars 12 forks source link

Add Lutron Aurora driver #16

Closed xxKeoxx closed 2 years ago

xxKeoxx commented 2 years ago

Would it be possible to have the lutron diver added to your repo?

this is the message I get when I try to add it in Hubitat.

[swupdate:[lastinstall:2022-01-02T05:46:21, state:noupdates], capabilities:[inputs:[[repeatintervals:[400], events:[[rotaryevent:1, eventtype:start], [rotaryevent:2, eventtype:repeat]]]], certified:true, primary:true], modelid:Z3-1BRL, swversion:3.8, type:ZLLRelativeRotary, diversityid:2c3a75ff-55c4-4e4d-8c44-82d330b8eb9b, manufacturername:Lutron, name:Hall Dimmer 2 Lutron Aurora, productname:Lutron Aurora, state:[rotaryevent:1, expectedrotation:-56, expectedeventduration:400, lastupdated:2022-01-02T05:48:19], config:[pending:[], battery:100, reachable:true, on:true], uniqueid:ff:ff:00:0f:e7:fd:4b:de-01-fc00-0014]

apwelsh commented 2 years ago

I do not own own. Please explain how it works.

xxKeoxx commented 2 years ago

It’s essentially a push button with a dial dimmer on the outside. Lutron Dimer

xxKeoxx commented 2 years ago

Id be willing to help test and debug it if you know how to get the code started. I’m pretty good at hacking code to make it work.

apwelsh commented 2 years ago

What I need you to do is the remove the device from hue. In the Advanced Hue Bridge I retraction app, at the bottom, turn on "Enable detection and logging of new device types". Then click done.
Open the log viewer, and then using the Hue smartphone app, add the rotary dimmer to hue, and send me the captured device details from the log. Then in a separate message, press the button (on/off), and turn the dial several clicks, first clockwise, then counter clockwise. Send me the logged message for each event.

I will have to see how this device type fits in with the standard device types of Hubitat.

Thanks.

xxKeoxx commented 2 years ago

I will get you that tomorrow. Thanks for being willing to help out with this.

apwelsh commented 2 years ago

I ordered one of these rotary dimmers. It appears they implement the "ZLLRelativeRotary" device type from the standard Hue API. It should arrive tomorrow, so I should be able to get this coded and deployed before the weekend. It seems fairly straightforward, although it is unclear what the rotary event looks like. By having one in-house, I can do all the testing I need. My code is currently in development state to implement the V2 of the Hue API, so I will have to branch my local git repo, to stash my changes off to, and roll everything back to the current production branch for this change to get committed properly.

Thanks for the head's up on the device. It won't go to waste, as I believe I can use this in my sun room as a remote control for my backyard patio light. It might be interesting to use the rotary dimmer in conjunction with the new Hue dimmer to get dimmer control via the hue dimmer, and color control via the rotary dimmer....

xxKeoxx commented 2 years ago

I was just collecting the data for you. LOL!

The only thing I was able to collect was the initial connection of the dimmer. The app wouldn’t report back any button push or dim/raise event. Maybe that has something to do with it being a friends of hue device and not a standard hue device. Don’t know.

2022-01-03 05:52:17.236 pm debugnull 2022-01-03 05:52:17.233 pm warnDiscovered new device added to Hue hub of type: device 2022-01-03 05:52:17.230 pm debugnull 2022-01-03 05:52:17.226 pm warnDiscovered new device added to Hue hub of type: relative_rotary 2022-01-03 05:52:17.223 pm debugnull 2022-01-03 05:52:17.220 pm warnDiscovered new device added to Hue hub of type: device_power 2022-01-03 05:52:17.216 pm debugnull 2022-01-03 05:52:17.211 pm warnDiscovered new device added to Hue hub of type: zigbee_connectivity 2022-01-03 05:52:17.208 pm debugnull 2022-01-03 05:52:17.204 pm warnDiscovered new device added to Hue hub of type: button

apwelsh commented 2 years ago

Probably need to turn on debug logging on the hue bridge device. It is off by default, and should not be left on, as it causes excessive logging which can slow down the hub. Push based events can only be sent to a device (not an app) so I use the hue bridge device for this.

Thanks for the information, this will help me get started with the driver definition.

apwelsh commented 2 years ago

I am concerned about the "null" lines as these are the lines that would show the hue configuration JSON for the device. Oh well. But I do see from this that the device reports zigbee health data, device power, button (for the tap) and relative_rotary to get if it is turning counter clockwise (-) or clockwise (+) and how far (reports number of ticks turned).

Thanks

apwelsh commented 2 years ago

The driver isn't able to be practically added using the V1 API. This product will be supported with the V2 API implementation. V2 API is actively under development, and this is the first dimmer device I will be implementing in the V2 API.