Skip to content

A new way of getting deviceId and localKeyΒ #323

@SleepWalker

Description

@SleepWalker

Hello, I've found out, that an official Smart Life app shows you deviceId. I've tested that deviceId with tuya OpenAPI and it works (at least for my smart sockets). This means, that you can get localKey from an OpenAPI /v1.0/devices/{{device_id}}.

I think, that this may be useful to simplify tuyapi setup workflow.

The new setup will consist of three steps:

  • after creating app on iot.tuya.com and getting key/secret, you need to link your devices, but instead of doing that with @tuyapi/cli, you should "Link device by Tuya Smart App Account":
    image
  • then you can grab id from an app. From the main screen tap on device you interested in, then tap "edit icon" to get to the screen where you can manage/share/rename device. On that screen there is "Device information" menu option, where you can look up for the deviceId:
    image
  • finally request device info from tuya OpenAPI, where you can get localKey value:
    image

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions