rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.71k stars 530 forks source link

Tuya Protocol 3.4 #812

Open pantha007 opened 2 years ago

pantha007 commented 2 years ago

Fisrt of all sorry if I fill this out wrong im a Neewbie to the bug reports.

I have had a new switch and I have found the Protocol is 3.4 ( im guessing there are not many yet), I have tried multiple ways to add the device with no luck :-(

These are all the details I can get

Product Name : Smart ONOFF Product Category : tdq

This is from Tinytuya ( not a lot here sorry ) "name": "Bathroom Light Switch", "ip": "192...", "ver": "3.4", "id": "**", "key": ""

This is from Tuya API Explorer

{ "result": { "active_time": 1650014176, "biz_type": 18, "category": "tdq", "create_time": 1650014176, "icon": "smart/icon/ay15306906879543yc3O/dcb16dbe1cbaaa097274cace1fa11c07.png", "id": "****", "ip": "...", "lat": ".**", "local_key": "**", "lon": "0.0000", "model": "", "name": "Bathroom Light Switch", "online": true, "owner_id": "", "product_id": "vfbudyryoi0eqqg7", "product_name": "Smart ONOFF", "status": [ { "code": "switch_1", "value": false }, { "code": "countdown_1", "value": 0 }, { "code": "relay_status", "value": "2" }, { "code": "random_time", "value": "" }, { "code": "cycle_time", "value": "" } ], "sub": false, "time_zone": "+01:00", "uid": "***", "update_time": *, "uuid": "" }, "success": true, "t": , "tid": "**" }

Additional information

Home Assistant 2022.4.7

Sorry if i have missed anything

Lozz70 commented 1 year ago

Now that TinyTuya officially supports 3.4 protocol, will TuyaLocal be updated to support it as well? Or is there a way to use TinyTuya 1.7 with TuyaLocal?

willemwouters commented 1 year ago

Now that TinyTuya officially supports 3.4 protocol, will TuyaLocal be updated to support it as well? Or is there a way to use TinyTuya 1.7 with TuyaLocal?

Well, im fiddling with this for the last couple of days. I know python, i know a bit of HA. But i don't know async ;)

I have something working.... very very buggy (mostly the read which is not blocking, which it should be via asyncio create_connection)

But everybody is free to contribute ;)

https://github.com/willemwouters/localtuya-tinytuya

teun95 commented 1 year ago

Sorry to bump this issue, but I thought this was relasted enough.

Do only newly released devices come with new firmware versions that use protocol 3.4 or do device firmware updates also update the protocol version?

patrik-malina commented 1 year ago

I'm also interested in this. For now I stopped auto update in Smart Life app...

MatthewReed303 commented 1 year ago

I just got a bunch of switch modules to find they are also v3.4 when trying to add them I get this error:

Connection to device succeeded but no datapoints found, please try again. Create a new issue and include debug logs if problem persists.

My other v3.3 devices work fine. Is there any progress on getting v3.4 working?

ViennaCivicEP2 commented 1 month ago

Hi, I got a Smart Lamp also with protocol 3.4. Same error message as MatthewReed303. When I try to add DPS manually it only reads "-1" for all of them. So, I can add the Tuya Smart Lamp to HA, but then it is shown as "not available" and I can't control it.

Any help would be appreciated.

pantha007 commented 1 month ago

Hi, I got a Smart Lamp also with protocol 3.4. Same error message as MatthewReed303. When I try to add DPS manually it only reads "-1" for all of them. So, I can add the Tuya Smart Lamp to HA, but then it is shown as "not available" and I can't control it.

Any help would be appreciated.

This may not be of much help but I eventually got rid of all my Tuya devices and replaced the Bulbs with LocalBytes bulbs which let me use ESPHOME, they come with TASMOTA either is a lot better than TUYA as it is all local :-)