AMoo-Miki / homebridge-tuya-lan

Homebridge plugin for IoT devices that use Tuya Smart's platform
MIT License
204 stars 51 forks source link

tuya-cli list-app waiting for request #63

Open jd0394 opened 5 years ago

jd0394 commented 5 years ago

I had to change my wifi network password and after updating the password on all my devices I had to remove and re add my 3 bulbs to get them back on my network and working on the tuya app. I then had my commands on the home app having no effect. I figured the issue is that I need to find the key for each bulb and add them to my config.json file for homebridge again.

Ive done each step many times now but each time I'm stuck on "waiting for request" while refreshing the tuya app list of devices on my phone. I've made sure each step was done correctly on my phone, the profile is installed and certificate is verified in the about section of settings, and the manual proxy is properly enabled on my wifi settings.

Any ideas what else I might be missing? I should also mention I'm very new to this. I have homebridge running on a MacBook and the tuya-cli list-app says proxy IP 192.168.0.24 port 8001, which is what I have entered into my phone.

Any help would be greatly appreciated, thanks.

Dag0n commented 5 years ago

Having the same issue here too.

satelshawn commented 5 years ago

Same issue here.

carsten-h commented 5 years ago

Same here!

Rantaholic commented 5 years ago

Same here. I wonder if the Tuya Smart app was updated.

Rantaholic commented 5 years ago

OK. I think they did update the app. I have successfully got the keys by using the CE Smart app (costco tuya plugs) instead which hasn’t been updated in a month. The Tuya and SmartLife apps were just updated and I couldn’t get them to work. Download now before they update it.

carsten-h commented 5 years ago

I have downloaded the CE Smart App and a few other older ones and tried them together with anyproxy on my Pi, but all of them are not working. :-(

Rantaholic commented 5 years ago

@carsten-h I also updated to the latest version of the Tuya API: npm i @tuyapi/cli -g and the newest version of this module manually using: npm i -g AMoo-Miki/homebridge-tuya-lan

Not sure if that made a difference. I’m on iOS as well so the apps might not be updated at the same time as android.

carsten-h commented 5 years ago

I installed @tuyapi/cli (1.6.1) two days ago, so it should be the newest. And I also installed the newest tuya-lan.

PierreBrisorgueil commented 5 years ago

Yep, same problem as you, switched from raspberry to macos,and Tuya to CE Smart and it's ok :)

thx @Rantaholic

KYDronePilot commented 5 years ago

CE Smart has been updated and no longer works. From what I have seen, any of the Tuya apps listed as last being updated 2 months ago (appx. mid May, 2019) will no longer work.

I found another app that does still work, Brilliant Smart. Just keep in mind, this app will not work in iOS 13 (at least in the betas).

Abi-87 commented 5 years ago

I couldn't get any keys, I'm sure I did all steps right. Any ideas?

KYDronePilot commented 5 years ago

@Abi-87 What app did you use to setup the devices?

Abi-87 commented 5 years ago

I used many different apps like Tuyasmart, CE Smart, Brilliant Smart, but I didn't get any result. even I reinstalled home bridge twice and also I changed the Port and IP.

KYDronePilot commented 5 years ago

@Abi-87 Sorry, not sure what the issue could be. I had no trouble when following the instructions and using the Brilliant Smart app.

adamgoose commented 5 years ago

I ran into this as well. I was able to implement what the proxy and CLI are attempting to do simply by inspecting the traffic myself.

  1. Install the free version of ProxyMan.
  2. Open ProxyMan Settings, generate a new CA (automatic method works great). Optionally disable "Auto override the Proxy config in Network Preferences". This will make it easier to find the correct web request later.
  3. Open Keychain Access, select the System keychain, find the "Proxyman CA", and export it to a file in .pem format.
  4. Open this file on your iPhone somehow.
    • Use a file sharing app
    • Use iCloud Drive
    • Email it to yourself
  5. Install the certificate, then open Settings -> General -> About -> Certificate Trust Settings (very bottom) and give it Full Trust.
  6. Start ProxyMan, and note its "Listening Port" (9090 by default). Also note your local IP
  7. Open Settings -> WiFi -> Blue "i" next to your connection -> Configure Proxy. Set your local IP and ProxyMan port.

At this point, your iPhone should be able to freely access the internet and all traffic will begin to appear in the ProxyMan UI. Just refresh your device list in the app a few times.

Look for requests to ay.tuyaus.com (or something similar, based on your location I suppose). You might have to enable SSL interception on a request in order to see the payload. Refresh your device list again to see a raw payload!

image

Search the raw response body for tuya.m.my.group.device.list. Use each devices devId and localKey for id and key respectively.

This is merely one example of how to intercept web traffic. Wireshark and Proxie are perfectly viable options.

Update: At the time of writing, the following Jsonata expression extracts them for you: result[a="tuya.m.my.group.device.list"].result.[devId,localKey]

verisgit commented 5 years ago

Was not able to get the normal solution working to get the device IDs and Keys. Here's a solution for Windows 10 using Burp Suite (free community edition to capture the SSL device request) http://www.htgsd.com/information-technology/apple/homekit/how-to-capture-tuya-lan-homebridge-device-devid-and-key-on-windows-10/

zuyan9 commented 5 years ago

CE Smart app worked for me while Smart Life didn't

verisgit commented 5 years ago

Also I had to specify the version in order to get it working in my config.json

"version": "3.11"

carsten-h commented 5 years ago

Which version is this and where did you place it? Thank you!

verisgit commented 5 years ago

It’s the version reported in the Tuya app Me>Settings>About>Current version

verisgit commented 5 years ago

Note. I ignored the last number. Mine was 3.11.7

carsten-h commented 5 years ago

Thank you! At which point of the config.json did you put it?

verisgit commented 5 years ago

You can see an example in my posts here https://github.com/AMoo-Miki/homebridge-tuya-lan/issues/7

mkormendy commented 5 years ago

The suggestion by @Rantaholic with the CE Smart app on iPhone Xs (latest iOS 12) worked for me!

AMoo-Miki commented 5 years ago

I have published a new method of obtaining the id and key. Please update to the latest stable release (v1.4.0) or the latest rc with npm i -g homebridge-tuya-lan@rc and follow the Setup Instructions.

Lemme know how it goes.