wvissers / openhab2-addons-tuya

tuya device properties
25 stars 13 forks source link

DEVID EN LOKAKEY #1

Open Jelmer-Meurisse opened 5 years ago

Jelmer-Meurisse commented 5 years ago

where did you find de DEVID EN LOKALKEY of de LSC??

wvissers commented 5 years ago

Two methods I found online are instructions using Windows and setup instructions to find the devId and localKey values. It requires a setup on e.g. a laptop to grab the data from the app (I use the Tuya app, but the LSC app probably works also).

Jelmer-Meurisse commented 5 years ago

oke thank you so you run a program on the pc and then you can get het 2 ids?

wvissers commented 5 years ago

Yes, you use the pcc as a proxy to intercept the traffic between the app on your phone and the Tuya cloud service. It will take a while to figure it out but you only have to do it once. When you have the traffic, look at the messages and there should be some JSON like "devId": "xxxxx", and "localKey": "yyyyy" in it. Unfortunately I haven't found a more user friendly way to get this info. If someone knowns a better way, please comment on this issue.

Jelmer-Meurisse commented 5 years ago

i can find the devid but the localkey not

Jelmer-Meurisse commented 5 years ago

{498AC15A-8DE3-420F-85A8-822ED926B5E6} png

wvissers commented 5 years ago

I think this is the wrong message. You are seeing the post data here, which is actually the request sent to the cloud. You should look for the response instead. BTW, have you tried to refresh the device list in the app by sliding it down? Then you should see a couple of requests. There is a rather large response containing a lot of detailed information. Searching for "localKey" in the json data should get you started.

Jelmer-Meurisse commented 5 years ago

Aantekening 2019-09-04 110302

Jelmer-Meurisse commented 5 years ago

how can i see wich device it is

wvissers commented 5 years ago

You can look for the "name". If you named the devices in the app, you should be able to find that name in the json data as well.

Jelmer-Meurisse commented 5 years ago

oke but is the data after the name? key en id?

Jelmer-Meurisse commented 5 years ago

do you have teamviewer?

wvissers commented 5 years ago

I don't have teamviewer but I'm behind a company firewall here anyway. If I look at the json data, the order of the relevant data seems to be "devId", "name", "localKey".

Jelmer-Meurisse commented 5 years ago

Aantekening 2019-09-04 112828

wvissers commented 5 years ago

This status is the normal initial status. It discovered the ip address of the device. That means the devId is recognized. After about 10 seconds that should change to the online status if everything is working fine. If the device stays offline, there may be a API version mismatch (currently only API version 3.3 supported) or a mismatch in the local key.

Jelmer-Meurisse commented 5 years ago

oke i have this java.net.SocketException

Jelmer-Meurisse commented 5 years ago

and how did you know which api hou have?

wvissers commented 5 years ago

I have seen Socket Exceptions at my end also in some occasions. I haven't figured out exactly when this happens. In my case it helped restarting openHAB. But this certainly needs to be improved. I will look at it after my holiday 4 weeks from now. The version should be visible when you click on the PROPERTIES in the paper UI. It should show the ip address and API version.