jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
868 stars 157 forks source link

Unable to get local key for v3.4 device - LSC Smart Connect ceiling lamp #398

Closed jeanpaul1977 closed 10 months ago

jeanpaul1977 commented 10 months ago

Hi,

I'm using TinyTuya v1.12.10; I have multiple v3.3 LSC lamps successfully connect and I'm able to control them. As of today I bought a new LSC ceiling lamp; it's on v3.4 while all other devices are on v3.3

When I run "python3 -m tinytuya scan" I get:

'10': 'ffff0505ff000000ff00ffff00ff00ff0000ff000000', '101': True}
Unknown v3.4 Device   Product ID = key8u5XXXXXXX5jw  [Valid Broadcast]:
    Address = 192.168.XXX.XXX   Device ID = bfac9eXXXXXXXX2815agts (len:22)  Local Key =   Version = 3.4  Type = default, MAC = 
    No Stats for 192.168.XXX.XXX: DEVICE KEY required to poll for status

The snapshot.json contains (snippet for that device):

        {
            "id": "bfac9eXXXXXXXX2815agts",
            "ip": "192.168.XXX.XXX",
            "active": 2,
            "encrypt": true,
            "productKey": "key8XXXXXXXXu5jw",
            "token": true,
            "wf_cfg": true,
            "name": "",
            "key": "",
            "mac": "",
            "ability": 0,
            "dev_type": "default",
            "origin": "broadcast",
            "ver": "3.4"
        },

Any idea's on how to get this lamp connected?

jeanpaul1977 commented 10 months ago

I managed to connect the lamp.

First time I registered the lamp using the "LSC smartconnect" app. For some reason (unknown to me) that resulted in the the situation above. I noticed I had the "Smart life" app on my phone as well and tried to register the lamp via that app. Now all works!

jasonacox commented 10 months ago

Thanks @jeanpaul1977 - You are correct. The official Tuya "Smart Life" app is required to be able to get local control. I don't know what the third party apps are doing.