thecynic / pylutron

MIT License
33 stars 43 forks source link

Support for RA3 #75

Open daytonturner opened 2 years ago

daytonturner commented 2 years ago

Hi all,

Absolutely love the work done in pylutron which gets used in HomeAssistant and others. Now that RadioRA3 is released, is anyone working on adding support?

I will have my hands on a RA3 processor shortly, is there anything I can do to help facilitate? I'm told its the same command set as HomeWorks QSX, but presumably has its own unique certificates to worry about.

How can I help?

cdheiser commented 2 years ago

First it looks like I have some new training to take. I haven't been able to find an integration protocol specification that includes RA3. (The latest I can find is from 2020: https://www.lutron.com/TechnicalDocumentLibrary/040249.pdf)

The 2 things that would be really useful are:

1) An integration protocol specification if you know where to find it 2) The DbXmlInfo.xml from the repeater (if it even exists and is extratable)

On Fri, Jan 28, 2022 at 12:14 PM daytonturner @.***> wrote:

Hi all,

Absolutely love the work done in pylutron which gets used in HomeAssistant and others. Now that RadioRA3 is released, is anyone working on adding support?

I will have my hands on a RA3 processor shortly, is there anything I can do to help facilitate? I'm told its the same command set as HomeWorks QSX, but presumably has its own unique certificates to worry about.

How can I help?

— Reply to this email directly, view it on GitHub https://github.com/thecynic/pylutron/issues/75, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQARWTI3VJRA5H7GAROYZTUYL2JRANCNFSM5NBVIB2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

JonGilmore commented 2 years ago

I certainly could be wrong (I haven't been able to do the training yet either), but as I recall, the integration protocol spec isn't "published", but it's only been given to the big integrators (crestron, savant, etc) so far.

cdheiser commented 2 years ago

Yeah, this looks like they call it the LEAP protocol.

While it's likely that RadioRA3 can share the home assistant integration, I have no idea at this point what's going to be required to make pylutron RA3 aware/compatible. If we're lucky, the underlying protocol is the same, just going over a TLS connection.

On Fri, Jan 28, 2022 at 6:54 PM Jon Gilmore @.***> wrote:

I certainly could be wrong (I haven't been able to do the training yet either), but as I recall, the integration protocol spec isn't "published", but it's only been given to the big integrators (crestron, savant, etc) so far.

— Reply to this email directly, view it on GitHub https://github.com/thecynic/pylutron/issues/75#issuecomment-1024816413, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQARWWOTOFMDZRZKZEJGCDUYNJF7ANCNFSM5NBVIB2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

daytonturner commented 2 years ago

Check out the GitHub repo for pylutron-caseta

It’s a caseta-only LEAP implementation. While generally the same RESTful TLS protocol; some of the endpoints are a little different. The understanding (unconfirmed) so far is that it shares the same protocol spec as QSX.. maybe there’s an opportunity to merge the work the pylutron-caseta folks did implementing LEAP and roll everything up into a generic pylutron module that supports everything?

Get Outlook for iOShttps://aka.ms/o0ukef


From: cdheiser @.> Sent: Friday, January 28, 2022 7:36:47 PM To: thecynic/pylutron @.> Cc: daytonturner @.>; Author @.> Subject: Re: [thecynic/pylutron] Support for RA3 (Issue #75)

Yeah, this looks like they call it the LEAP protocol.

While it's likely that RadioRA3 can share the home assistant integration, I have no idea at this point what's going to be required to make pylutron RA3 aware/compatible. If we're lucky, the underlying protocol is the same, just going over a TLS connection.

On Fri, Jan 28, 2022 at 6:54 PM Jon Gilmore @.***> wrote:

I certainly could be wrong (I haven't been able to do the training yet either), but as I recall, the integration protocol spec isn't "published", but it's only been given to the big integrators (crestron, savant, etc) so far.

— Reply to this email directly, view it on GitHub https://github.com/thecynic/pylutron/issues/75#issuecomment-1024816413, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQARWWOTOFMDZRZKZEJGCDUYNJF7ANCNFSM5NBVIB2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/thecynic/pylutron/issues/75#issuecomment-1024823393, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACZEPSIY3N6MVLF2VUWS36TUYNOE7ANCNFSM5NBVIB2Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>

cdheiser commented 2 years ago

Ok, that was the most worthless training I've been through. They really should have an abridged version for RA2 Certificate holders.

I'm sure what's likely to work is some refactoring of the pylutron-caseta LEAP implementation to use here. I went looking to see if I should just buy a RA3 processor but I'm not looking to spend $300+ to get RA3 working.

On Fri, Jan 28, 2022 at 7:39 PM daytonturner @.***> wrote:

Check out the GitHub repo for pylutron-caseta

It’s a caseta-only LEAP implementation. While generally the same RESTful TLS protocol; some of the endpoints are a little different. The understanding (unconfirmed) so far is that it shares the same protocol spec as QSX.. maybe there’s an opportunity to merge the work the pylutron-caseta folks did implementing LEAP and roll everything up into a generic pylutron module that supports everything?

Get Outlook for iOShttps://aka.ms/o0ukef


From: cdheiser @.> Sent: Friday, January 28, 2022 7:36:47 PM To: thecynic/pylutron @.> Cc: daytonturner @.>; Author @.> Subject: Re: [thecynic/pylutron] Support for RA3 (Issue #75)

Yeah, this looks like they call it the LEAP protocol.

While it's likely that RadioRA3 can share the home assistant integration, I have no idea at this point what's going to be required to make pylutron RA3 aware/compatible. If we're lucky, the underlying protocol is the same, just going over a TLS connection.

On Fri, Jan 28, 2022 at 6:54 PM Jon Gilmore @.***> wrote:

I certainly could be wrong (I haven't been able to do the training yet either), but as I recall, the integration protocol spec isn't "published", but it's only been given to the big integrators (crestron, savant, etc) so far.

— Reply to this email directly, view it on GitHub <https://github.com/thecynic/pylutron/issues/75#issuecomment-1024816413 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACQARWWOTOFMDZRZKZEJGCDUYNJF7ANCNFSM5NBVIB2Q

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub< https://github.com/thecynic/pylutron/issues/75#issuecomment-1024823393>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ACZEPSIY3N6MVLF2VUWS36TUYNOE7ANCNFSM5NBVIB2Q

. Triage notifications on the go with GitHub Mobile for iOS< https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android< https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/thecynic/pylutron/issues/75#issuecomment-1024823793, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQARWWMIN4BNHYA6I726KTUYNOPPANCNFSM5NBVIB2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

thecynic commented 2 years ago

I emailed Lutron to ask for a LEAP specs. I'm not hopeful they'll respond, but we'll see what they say if they do :)

On Fri, Jan 28, 2022 at 10:30 PM cdheiser @.***> wrote:

Ok, that was the most worthless training I've been through. They really should have an abridged version for RA2 Certificate holders.

I'm sure what's likely to work is some refactoring of the pylutron-caseta LEAP implementation to use here. I went looking to see if I should just buy a RA3 processor but I'm not looking to spend $300+ to get RA3 working.

On Fri, Jan 28, 2022 at 7:39 PM daytonturner @.***> wrote:

Check out the GitHub repo for pylutron-caseta

It’s a caseta-only LEAP implementation. While generally the same RESTful TLS protocol; some of the endpoints are a little different. The understanding (unconfirmed) so far is that it shares the same protocol spec as QSX.. maybe there’s an opportunity to merge the work the pylutron-caseta folks did implementing LEAP and roll everything up into a generic pylutron module that supports everything?

Get Outlook for iOShttps://aka.ms/o0ukef


From: cdheiser @.> Sent: Friday, January 28, 2022 7:36:47 PM To: thecynic/pylutron @.> Cc: daytonturner @.>; Author @.> Subject: Re: [thecynic/pylutron] Support for RA3 (Issue #75)

Yeah, this looks like they call it the LEAP protocol.

While it's likely that RadioRA3 can share the home assistant integration, I have no idea at this point what's going to be required to make pylutron RA3 aware/compatible. If we're lucky, the underlying protocol is the same, just going over a TLS connection.

On Fri, Jan 28, 2022 at 6:54 PM Jon Gilmore @.***> wrote:

I certainly could be wrong (I haven't been able to do the training yet either), but as I recall, the integration protocol spec isn't "published", but it's only been given to the big integrators (crestron, savant, etc) so far.

— Reply to this email directly, view it on GitHub < https://github.com/thecynic/pylutron/issues/75#issuecomment-1024816413 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ACQARWWOTOFMDZRZKZEJGCDUYNJF7ANCNFSM5NBVIB2Q

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub< https://github.com/thecynic/pylutron/issues/75#issuecomment-1024823393>, or unsubscribe<

https://github.com/notifications/unsubscribe-auth/ACZEPSIY3N6MVLF2VUWS36TUYNOE7ANCNFSM5NBVIB2Q

. Triage notifications on the go with GitHub Mobile for iOS<

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android<

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub <https://github.com/thecynic/pylutron/issues/75#issuecomment-1024823793 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACQARWWMIN4BNHYA6I726KTUYNOPPANCNFSM5NBVIB2Q

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/thecynic/pylutron/issues/75#issuecomment-1024848051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALQIMKR72P6E43E35GBJIDUYOCR5ANCNFSM5NBVIB2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

daytonturner commented 2 years ago

@cdheiser i will happily send you a RA3 processor if you’re interested in working on this!

terafin commented 2 years ago

I have a RA3 processor, and am trying things out here. All the caseta leap commands seem to fail with 400/405. Does anyone know which commands should work, so I can start poking?

terafin commented 2 years ago

Nevermind, it was bad auth. Got it working now:

2022-01-30T20:55:57.567Z leap:protocol got data from socket: {"CommuniqueType":"ReadResponse","Header":{"MessageBodyType":"MultipleAreaDefinition","StatusCode":"200 OK","Url":"/area","ClientTag":"2e0d9c4e-c9f7-4d62-b36e-b3235f7883c5"},"Body":{"Areas":[{"href":"/area/3","Name":"Home","SortOrder":0,"IsLeaf":false},{"href":"/area/24","Name":"Loft","Parent":{"href":"/area/3"},"SortOrder":0,"IsLeaf":false},{"href":"/area/83","Name":"Equipment Room","Parent":{"href":"/area/3"},"SortOrder":1,"IsLeaf":true},{"href":"/area/729","Name":"Loft","Parent":{"href":"/area/24"},"SortOrder":1,"IsLeaf":true}]}}

Working on playing around with the commands now.

terafin commented 2 years ago

Yup, looks like so far it looks like you do a query on: /area/ (to see areas) /area/AREA_NUMBER found above, to discover control stations and sub areas /controlstation/CONTROL_STATION_NUMBER from the area (to get device number) /device/DEVICE_NUMBER

to get:

[2022-01-30T13:04:51.764] [INFO] logger - command: /device/615     result: {"Header":{"MessageBodyType":"OneDeviceDefinition","StatusCode":{"message":"OK","code":200},"Url":"/device/615","ClientTag":"c5039527-3225-4961-bfa1-334f6d5f4f7d"},"CommuniqueType":"ReadResponse","Body":{"Device":{"href":"/device/615","Name":"Device 1","Parent":{"href":"/project"},"SerialNumber":XXXXXXX,"ModelNumber":"RRST-8ANS-XX","DeviceType":"SunnataSwitch","AssociatedArea":{"href":"/area/729"},"LinkNodes":[{"href":"/device/615/linknode/617"}],"FirmwareImage":{"href":"/firmwareimage/615"},"DeviceClass":{"HexadecimalEncoding":"45f0101"},"AddressedState":"Addressed"}}}
terafin commented 2 years ago

I can confirm that level control works:

        var response = await leap.request('CreateRequest', '/zone/622/commandprocessor', {"Command": {   "CommandType": "GoToLevel", 
                                                                                    "Parameter": [{"Type":"Level", "Value":0}]

Gives me back:

[2022-01-30T13:27:02.855] [INFO] logger - command response: {"Header":{"MessageBodyType":"OneZoneStatus","StatusCode":{"message":"Created","code":201},"Url":"/zone/622/commandprocessor","ClientTag":"6c4f9009-1231-4d9c-8672-257de32ba6ef"},"CommuniqueType":"CreateResponse","Body":{"ZoneStatus":{"href":"/zone/622/status","Level":0,"SwitchedLevel":"Off","Zone":{"href":"/zone/622"},"StatusAccuracy":"Good","Availability":"Available"}}}

Please note, I'm prototyping using: https://github.com/thenewwazoo/lutron-leap-js/ Tagging: @thenewwazoo

daytonturner commented 2 years ago

Nice! This is looking promising

thenewwazoo commented 2 years ago

Neato! I only have Caséta hardware at home, but both the Crestron integration and Lutron Android application use the same structures for their LEAP communications, so I have a strong suspicion that libraries are cross-device capable. I suspect (but have no way to verify) that the differentiator is in the kinds of parameters the respective devices support and report (e.g. the occupancy sensor's ambient lighting sensor).

thenewwazoo commented 2 years ago

Oh, and I would be extremely surprised if Lutron provided the LEAP guide document to anyone who doesn't hold an NDA.

daytonturner commented 2 years ago

Yeah - I fully expect the only way to get this working is through reverse engineering things.

thenewwazoo commented 2 years ago

The pylutron-caseta cats and I have gotten pretty good and decompiling things and watching network communications. The big stumbling block is usually just getting our hands on the hardware so we can observe it. @daytonturner if that offer is still good, I'd love to actually have a non-Caséta device to do validation with.

terafin commented 2 years ago

Neato! I only have Caséta hardware at home, but both the Crestron integration and Lutron Android application use the same structures for their LEAP communications, so I have a strong suspicion that libraries are cross-device capable. I suspect (but have no way to verify) that the differentiator is in the kinds of parameters the respective devices support and report (e.g. the occupancy sensor's ambient lighting sensor).

@thenewwazoo Does the iOS app use LEAP as well, or just Android? (Have you tried?) - I just saw non LEAP stuff going from the iOS to lutron servers via charles... (I might have to pull out my pixel)

thenewwazoo commented 2 years ago

I don't know, as I haven't inspected the iOS app, but traffic to Lutron servers is separate from the bridge comms, which are only over the LAN.

terafin commented 2 years ago

I'm trying to document the commands I find that are not yet supported in your lutron-js, please let me know if this is helpful or not: https://github.com/thenewwazoo/lutron-leap-js/issues

terafin commented 2 years ago

(making headway, I'm opening up issues there to document the control types, and subscribe)

rwagoner commented 2 years ago

If it helps the OpenHAB Addons Lutron binding has experimental LEAP support.

There are a number of request formats defined in internal/protocol/leap/Requests.java

terafin commented 2 years ago

@rwagoner Thanks! Note, these are new (?) RA3 commands, or appear to be. The caseta ones don't seem to work on RA3 either, I added a bunch here: https://github.com/thenewwazoo/lutron-leap-js/pull/15

More I'm sure to come.

swamplynx commented 2 years ago

@terafin @thecynic , looks like @johninaustin is making a lot of progress over in https://github.com/gurumitts/pylutron-caseta/issues/80 if you want to combine efforts.