Step-by-Step guide for adding Tuya-bulbs, Wi-Fi smart LED (Smart Life app) to OH2 using tuya-mqtt.js by AgentK

Well I’ve managed to get it working. In doing so I think I’ve found an easier was to get the local key.

The below has worked for me on my android phone.

1. Install "Package Capture" from play store.
2. When you first open it it will ask you to install a certificate, this is needed for it to work.
3. In the top bar there are two "Play" symbols. The one with a 1 allows you to capture packets from certain apps.
4. Click on that and select "Smart Life" from the list of apps.
5. It will popup about setting up a vpn and will then start capturing packets.
6. Open Smart Life and on the screen showing "All Devices" pull down the screen to cause a refresh.
7. Go back to Packet Capture and hit the Stop button at the top.
8. You should now have an entry below showing x number of captures.Tap that to open it.
In mine I had to open the last packet in the list that was marked as SSL.
9. Scroll down through the first few blocks and you should see a large JSON block
This contains a lot of code but if you scroll through it you should see line like the ones below 

"devAttribute": 0
"name": Smart Socket 4"
"timezoneId": "Europe/London"
"localKey": "XXXXXXXXXXXXXXX"

I’ve used the local keys i found doing this to setup two smart plugs and they are both working a treat.

In that large JSON code block it should list every device you have and all their local keys.

10 Likes