Closed walkention closed 7 years ago
Hello!
Since I own only one RM3 Mini, I wasn't able to test it properly. Regardless, I don't think encryption has anything to do with it, since the encryption Key and IV are hard-coded inside broadlink-python package. They are the same for every device. I'll take a look at this, probably tonight, and report back my findings.
Best regards, Davor
I had thought that too until I started poking around in the python-broadlink code. In that code it looks like there is an initial key used for auth and then that key is reset from the payload data returned in auth() here. That data then overwrites the self.key on line 190. If each device returns a device specific key after auth() that would impact using the saved data on another device from the BlackBeanControl.ini.
In this issue it is discussed how the data returned seems to be the raw IR data with some header info attached. It might be helpful to have the raw IR data stored in the BlackBeanControl.ini so folks could pull shared codes online without having to learn them, assuming the header info can be figured out.
I re-wrote how codes were stored in your script to save the IR data in raw form and created a re-key utility to convert commands to raw storage. It works with my two RM3's pretty well. Let me know if you want me to issue a pull request for this update.
Thanks!
Hello!
You can issue a pull request. I'll just review your naming and README.md (for consistency) and remove any commented parts of the code. Thank you for the contribution.
Best regards, Davor
Hello!
Thank you for your contribution once again. I'll review and accept your pull request as soon as I can - probably tonight, or tomorrow.
Best regards, Davor
Davor,
No rush. Thanks for reviewing it and giving your feedback! If you want to make any changes or additions or want to discuss anything just let me know.
Thanks! Aydaen
Hello!
I'm not sure if I merged this correctly (haven't used git as source control before, especially merging pull requests part), but I think it should work. I've made another pull request by mistake, so, I would really appreciate if you could check if the code works as it should.
Best regards, Davor
Hey!
I just pulled down the latest code in your master branch and everything works that was in the pull request! I think it's set! Thanks for processing that pull request and all the work you did on this project!
Aydaen
It seems as though if I have learned a command on one device it can't be sent to another device. It doesn't put the other device in learning mode and no error is thrown.
If I use the python-broadlink package directly I can learn a command on one and send it to both devices.
Here's the sample code I'm using to learn a command using python-broadlink:
I'm taking the output from a learned command and putting it into this script to send it to both devices:
It looks as though in your package the learned command has four bytes of zero padding added, is decrypted using the device auth key, and then stored in the BlackBeanControl.ini file. Perhaps the decrypting the packet with the device key makes it unable to be re-encrypted with a different device key.
This functionality may be by design to prevent a command learned on once device to be sent to another, but it might be nice to broadcast the same command to a different device/room by learning it once on another device.
I forked this packaged and was going to try and rewrite the code for learning and sending commands. I would try to write the commands as encoded hex and make a way to migrate codes from the old to the new format so they don't have to be re-learned again.
Let me know what you think.
Thanks for building this package! It's working great with my Alexa integration code that I am planning on releasing here soon! :-)