lawtancool / pyControl4

Python 3 asyncio package for interacting with Control4 systems
https://lawtancool.github.io/pyControl4
Apache License 2.0
38 stars 16 forks source link

Add support for Control4 Rooms #20

Closed kdkavanagh closed 1 year ago

kdkavanagh commented 2 years ago

Will be accompanied by HomeAssistant media_player support

nalin29 commented 1 year ago

Is their a reason this pull request hasn't been merged? Is the project stalled? It seems that room integration is big feature for media control and I would like to contribute to home assistant by including room control using pycontrol4 assuming the request is merged.

nalin29 commented 1 year ago

Additionally, I have noticed that this is not integrated with the websocket implementation it seems that the websocket cannot subscribe to room updates. Is there a way I can test and get my own websocket working through trial and error. What were the steps taken to capture api and websocket messages?

kdkavanagh commented 1 year ago

The websocket API seemed to require some unique handshake process to fully connect. Beyond that, the two methods seemed functionally similar and I didnt need any time-sensitive push updates into HA. It was a bit easier to just use the REST API, especially since the rest of this library was using that as well.

To reverse engineer the API, I had to MITM the android app installed on an old android phone I had lying around - I needed to rebuild the apk with custom CA certs and use BurpSuite Community edition to intercept the API calls from the app. Unfortunately I dont recall the exact set of steps, I just remember it was a bit of a pain, but there are tutorials out there since this is a pretty common need for app developers

kdkavanagh commented 1 year ago

+1 re: the merge question. In the meantime, I've been using a local install of this plugin+the HA integration I wrote. I can probably get those HA changes cleaned up and PR'd if that'd be helpful

nalin29 commented 1 year ago

Thank you. Yeah I installed your library and was able to change to current HA plugin to support my media rooms for source and volume/power control using the current polling approach. It would be better to be push and not as hard coded.

nalin29 commented 1 year ago

I noticed that you have forked the home assistant core and modified the control4 integration there. What features have you got working since I have a version that I made a while back but is pretty bare bones and diy. If you need someone to help test it let me know.

lawtancool commented 1 year ago

Closed by #21