giu1io / homebridge-ankuoo-rec-switch

Homebridge plugin that integrates with Ankuoo Rec Switch
GNU General Public License v3.0
10 stars 5 forks source link

onCode and offCode #4

Closed familyofharris closed 6 years ago

familyofharris commented 6 years ago

hopefully somebody can help as i have everything else done but just cant figure out the onCode and offCode. i have downloaded wireshark and have sniffed the app packets but everytime it is different and whatever i have tried hasnt worked. can somebody explain this bit in some more detail please

giu1io commented 6 years ago

Hi, Yes, the packets are all different between each other but that's not important because any of them will work as long that you choose the correct packet. Make sure that of all the packets that are being sent around on your network you pick only those that are sent from your smartphone to the switch. Turn off your switch from the app or from the wall. The packet that's being sended the moment you toggle the switch back on, from your device, is the only one to consider. Once you have found this packet you need to get the onCode from the packet payload following the instructions provided in the README. In short you need to discard the first 9 bytes and the following 16 bytes are in fact your onCode that you can paste inside the JSON configuration file. To get the offCode follow the same procedure but start with your switch already turned on and turn it off from the mobile app. If you want to deep dive into how all of this works you can read my blog post that's linked at the end of the README.

familyofharris commented 6 years ago

yes i have tried all the onCode and offCode possible but still no luck? any other suggestions

{ "accessory" : "AnkuooRecSwitch", "ip" : "192.168.1.144", "offCode" : "036912d4787b35412c977a4a43fb0c23", "name" : "Test Switch", "onCode" : "1b2de5bafbf7a6ba16498785a6407e85", "mac" : "ac:cf:23:8b:fc:96" },

giu1io commented 6 years ago

The configuration looks ok from here, but of course I have no way of knowing if those are the right codes. You may have a different switch model than the one I have or it may be running a newer/older firmware version? In that case it may no work at all with this plugin.