AMoo-Miki / homebridge-tuya-lan

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

ID and Key not getting intercepted - change in Tuya Smart app? #280

Open togume opened 1 year ago

togume commented 1 year ago

Hi all - thanks for all of this great software!

I'm trying to use Tuya locally, but I can't seem to get the id or key. I successfully get the QR code, see things getting intercepted from the iOS device (iPhone 14 Pro on iOS 16 latest), but nothing happens when the Tuya Smart app is opened fresh.

Could it be that Tuya is doing a DNS check or something else before attempting to negotiate id or key?

Any help would be greatly appreciated. Cheers!

peterupton commented 1 year ago

I get the following error after a few interceptions but no id or key:

Error: ERR_TLS_HANDSHAKE_TIMEOUT Error [ERR_TLS_HANDSHAKE_TIMEOUT]: TLS handshake timeout at new NodeError (node:internal/errors:393:5) at TLSSocket._handleTimeout (node:_tls_wrap:902:22) at Object.onceWrapper (node:events:627:28) at TLSSocket.emit (node:events:513:28) at Socket._onTimeout (node:net:562:8) at listOnTimeout (node:internal/timers:564:17) at process.processTimers (node:internal/timers:507:7) { code: 'ERR_TLS_HANDSHAKE_TIMEOUT' }

krishnavelu commented 1 year ago

I too get the same, is this not working anymore.

image
peros550 commented 1 year ago

same issue here, any fix?

khammo01 commented 1 year ago

I get this instead

Error: [Error: 4148807232:error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol:../deps/openssl/openssl/ssl/statem/statem_srvr.c:1714: ] { library: 'SSL routines', function: 'tls_early_post_process_client_hello', reason: 'unsupported protocol', code: 'ERR_SSL_UNSUPPORTED_PROTOCOL' } Error: Error: socket hang up at connResetException (node:internal/errors:705:14) at TLSSocket.onSocketClose (node:_tls_wrap:1089:23) at TLSSocket.emit (node:events:525:35) at node:net:301:12 at Socket.done (node:_tls_wrap:588:7) at Object.onceWrapper (node:events:628:26) at Socket.emit (node:events:513:28) at TCP. (node:net:301:12) { code: 'ECONNRESET'

dcifer1 commented 1 year ago

was so excited about this plugin, but i'm getting the same unsupported protocol / socket hang up errors in Terminal as soon as i launch the Tuya Smart app, with no id or key ever populating.

any known cause or fix for this???

socalcal commented 10 months ago

Now on iOS 17.1.1 and appears there is still no key. IDs can be found in the app, but no KEYs.

jackklink commented 8 months ago

Same issue. Still no fix?

TrshPndaGreg commented 7 months ago

I couldn't get it fixed, however you can pull your ID and Key from the Tuya IoT webpage very easily.

https://us.iot.tuya.com/cloud/explorer

Then click on Device Management > Query Device Details. It'll ask you for the device_id which is the Device ID that's on the cloud project devices page.

I felt like this was a little easier than trying to intercept the IDs from my iPhone.

arrancurran commented 7 months ago

Not sure @TrshPndaGreg is posting this comment in multiple issues that are not related to "get device key". Either way, I don't think this is correct. The "local_key" value you can get directly from the IoT Platform, doesn't work.

https://github.com/AMoo-Miki/homebridge-tuya-lan/issues/279#issuecomment-1935052658

TrshPndaGreg commented 7 months ago

I can assure you @arrancurran that it does work. I just used it the day I posted the comment to get homebridge-tuya-local up and running. How is getting the local key not related to get device key?

I used the device key from the IoT Platform from going to my cloud project and copying it from the Device ID column.

image

Then I used that device ID and pasted it in the API Explorer page that I linked, under Device Management > Query Device Details.

image

Then I used this local_key and the device_id to put into the plugin.

image

Then I have access to control the device locally, using the Homebridge Accessories screen.

Again...I don't know why I got downvoted and told that it doesn't work. I'll glady record a video if you want me to.

arrancurran commented 7 months ago

I downvoted because the same comment was posted in an unrelated issue regarding QR code generation, here.

The method (using the ID and the Tuya platform to get the device key) described by @TrshPndaGreg does NOT work with this repo (homebridge-tuya-lan).

It does however work with a different homebridge plugin, homebridge-tuya-local.

luisffc commented 6 months ago

I couldn't get it fixed, however you can pull your ID and Key from the Tuya IoT webpage very easily.

https://us.iot.tuya.com/cloud/explorer

Then click on Device Management > Query Device Details. It'll ask you for the device_id which is the Device ID that's on the cloud project devices page.

I felt like this was a little easier than trying to intercept the IDs from my iPhone.

Thanks @TrshPndaGreg that worked for me. I just needed to subscribe for IoT trial before