How to get Tuya-lan Homebridge device ID Dev ID and Key on Windows 10

I recently purchased some EWELINK wifi garage door openers and my plan is to get them working with Apple Homekit via Homebride.

Edit: Removed link as everywhere that sells them goes out of stock then the link 404s. This is what they look like you can find them on eBay and other similar sites.

Ewelink / Tuya Garage Door Controller

If you don’t know about HomeBridge it’s basically the missing link between all your IOT devices and Apple Homekit. It allows you to use non-home kit devices with home kit. Albeit you do need some technical knowledge to get this working and it’s not for the faint of hearted.

The are various guides floating around the web involving the use of anyproxy and tuyapi/cli -but they don’t work anymore.

The best way I’ve found to intercept the ID and KEY is using Burp Suite its an excellent piece of software and the community edition is free.

  1. Download Burp Suite Community Edition
  2. Install
  3. Launch Burp Suite
  4. Click on Temporary Project
  5. Click use Burp Defaults
  6. Once started click on the Proxy Tab, then Options tab, then add a new proxy listener
  7. Make the port 8082
  8. Select “All Interfaces”
  9. save the listener
  10. Accept the warning
  11. Click on the Intercept tab
  12. Turn intercept off
  13. Click on HTTP history
  14. Now on your iPhone make sure you phone is on the same network as the computer you are running Burp Suite on (mandatory)
  15. Open the iPhone wifi setting and click on the blue (i) next to your wireless network
  16. Then scroll down to proxy settings / Configure proxy
  17. Select manual
  18. Enter the IP of your computer running Burp Suite and enter the port as 8082
  19. Remember where this is as you will need to turn it off later in order to get Internet access back on your iPhone. Once you are done with this process you simply come back to this menu and turn the proxy off.
  20. Now you should start to see some requests streaming through to Burp Suite from your phone. Currently, all SSL requests won’t be visible as you need to install a certificate.
  21. On your, iPhone browse to http://burp
  22. Click on CA-Certificate in the top right
  23. Click allow
  24. Choose iPhone if you are prompted between iPhone and Apple Watch
  25. You will see a profile downloaded message
  26. Now go to Settings > General > Profiles
  27. Click on PortSwigger CA
  28. Click Install and enter your passcode (note, this is not sending your passcode to anyone it’s simply Apple confirming you are definitely the owner of the phone before you install the certificate on it, this is to protect against someone getting your phone and installing a monitoring profile when you aren’t looking)
  29. The certificate will now be installed
  30. Go to Settings > General > About then scroll down to Certificate Trust Settings
  31. Switch Portswigger CA ON
  32. Now you will be able to see SSL requests and responses streaming through to Burp Suite
  33. Now open your TuyaSmart or other supported app and swipe down to refresh your devices
  34. You will see a whole bunch of requests/responses captured for a1.tuyaeu.com (or similar depending on your region) you will need to start going through all of them clicking on “response’ and “headers” tabs until you see one with a JSON structure outlining all of your devices.
  35. The two elements you are looking for are:
  36. devId and localKey
  37. Extract the value of devId and localKey and these go into your confirmation for the homebridge module https://github.com/AMoo-Miki/homebridge-tuya-lan

Cleanup

  1. Go to iPhone Wifi Settings
  2. Scroll down to proxy settings / Configure proxy (if you don’t do this you won’t have any Internet on your iPhone)
  3. Turn the proxy off
  4. Settings > General > Profiles
  5. Delete Portswigger CA

Comments

  1. By Fredrik

    Reply

    • By V5

      Reply

  2. By ScottCLT

    Reply

  3. By Ron

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.