homebridge-tuya-lan icon indicating copy to clipboard operation
homebridge-tuya-lan copied to clipboard

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

Open togume opened this issue 2 years ago • 12 comments

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!

togume avatar Dec 17 '22 13:12 togume

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' }

peterupton avatar Jan 03 '23 02:01 peterupton

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

image

krishnavelu avatar Jan 20 '23 16:01 krishnavelu

same issue here, any fix?

peros550 avatar Feb 11 '23 15:02 peros550

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'

khammo01 avatar Apr 14 '23 08:04 khammo01

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???

dcifer1 avatar Jul 22 '23 18:07 dcifer1

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

socalcal avatar Nov 13 '23 00:11 socalcal

Same issue. Still no fix?

jackklink avatar Feb 01 '24 23:02 jackklink

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.

TrshPndaGreg avatar Feb 07 '24 22:02 TrshPndaGreg

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

arrancurran avatar Feb 09 '24 11:02 arrancurran

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.

TrshPndaGreg avatar Feb 09 '24 14:02 TrshPndaGreg

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.

arrancurran avatar Feb 14 '24 19:02 arrancurran

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

luisffc avatar Mar 29 '24 19:03 luisffc