[BETA] Tuya Cloud Driver (Limited device support)

Looks like when the API gets query, there is a limit of 20 device IDs that come back (Query Device Details in Bulk-Cloud Services API Reference-Tuya Developer) which is probably the problem that @tonyshor is having.

Based on this, if I had to guess, the only solution is to split the devices between the two apps (Tuya and Smart Life), create two different IOT projects, and have two different virtual drivers hitting each respective app. Going this route would mean that this integration has a theoretical limit of 40 total devices.

1 Like

Thanks JB10. You would not believe what happened since yesterday, When I looked at my Hubitat devices this morning, i found out 12 more devices were linked from the IOT project without me doing anything. Here is screen shot of the Tuya Cloud driver

you could see the device count is still 20 but the component devices shows 32 devices. i still have 4 more missing devices but it is looking much better now.

2 Likes

Hi @user6165

I have the same error and I would like to contribute to the driver. Was wondering if you found any work around before I dive in?

Thanks.
P

Hi Patrice. I ended up buying a BroadLink blaster which has a solid driver available.

Good luck!
Tim

Nice, sounds like a good solution. Thanks for pointing it out, I think I will end up doing the same. Cheers!

I can recommend the Broadlink remotes as well. I’ve been using 3 of these for probably 4 years now, they work remarkably stable!

2 Likes

Hi @jonathanb i hope you can help, i had this working perfectly for at least 6 months. Howewer i've had all sorts of internet issues recently which caused my WIFI lights to go offline. I've since re-connected my 3 of my lights and they work fine via the Tuya app, however not via hubitat. I've tried all sorts of things and i've since created a new Project in the Tuya IOT platform, I've also deleted my old Virtual Tuya IOT cloud device in Hubitat and re-added a new one. The Hubitat Device appears to be able to see my Tuya devices as below. However the childs don't appear to work. I've noticed when i hit initialise, then it displays an error in the current states however when i hit refresh it displays the correct device count (3) and says ready. I've also transferred my new client ID and client secret.

I've added a screenshot of one of my child devices logs with the errors.

Any help would be appreciated as i'm pulling my hair out here :slight_smile:

image

image

2024-03-18 22:54:38.648debugFront Light 4 status [code:do_not_disturb, value:false]

dev:16512024-03-18 22:54:38.645debugFront Light 4 status [code:control_data, value:]

dev:16512024-03-18 22:54:38.643debugFront Light 4 status [code:countdown_1, value:0]

dev:16512024-03-18 22:54:38.639debugFront Light 4 status [code:scene_data_v2, value:{"scene_num":1,"scene_units":[{"bright":0,"h":90,"s":1000,"temperature":0,"unit_change_mode":"jump","unit_gradient_duration":90,"unit_switch_duration":90,"v":1000},{"bright":0,"h":10,"s":1000,"temperature":0,"unit_change_mode":"jump","unit_gradient_duration":90,"unit_switch_duration":90,"v":1000}]}]

dev:16512024-03-18 22:54:38.636infoFront Light 4 color is h:0 s:100 (Red)

dev:16512024-03-18 22:54:38.632debugFront Light 2 status [code:do_not_disturb, value:true]

dev:16512024-03-18 22:54:38.630debugFront Light 2 status [code:control_data, value:]

dev:16512024-03-18 22:54:38.627debugFront Light 2 status [code:countdown_1, value:0]

dev:16512024-03-18 22:54:38.627debugFront Light 1 status [code:do_not_disturb, value:true]

dev:16512024-03-18 22:54:38.625debugFront Light 1 status [code:control_data, value:]

dev:16512024-03-18 22:54:38.625debugFront Light 4 status [code:colour_data_v2, value:{"h":0,"s":1000,"v":1000}]

dev:16512024-03-18 22:54:38.624infoFront Light 4 color temperature is 6497K

dev:16512024-03-18 22:54:38.623debugFront Light 1 status [code:countdown_1, value:0]

dev:16512024-03-18 22:54:38.621debugFront Light 2 status [code:scene_data_v2, value:{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}]

dev:16512024-03-18 22:54:38.621debugFront Light 1 status [code:scene_data_v2, value:{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}]

dev:16512024-03-18 22:54:38.620infoFront Light 1 color is h:97 s:100 (Red)

dev:16512024-03-18 22:54:38.620debugFront Light 4 status [code:temp_value_v2, value:996]

dev:16512024-03-18 22:54:38.620infoFront Light 2 color is h:97 s:100 (Red)

dev:16512024-03-18 22:54:38.618infoFront Light 4 level is 100%

dev:16512024-03-18 22:54:38.617debugFront Light 4 status [code:bright_value_v2, value:1000]

dev:16512024-03-18 22:54:38.615infoFront Light 4 color mode is CT

dev:16512024-03-18 22:54:38.614debugFront Light 4 status [code:work_mode, value:white]

dev:16512024-03-18 22:54:38.612infoFront Light 4 switch is off

dev:16512024-03-18 22:54:38.611debugFront Light 4 status [code:switch_led, value:false]

dev:16512024-03-18 22:54:38.610debugFront Light 4 workMode white

dev:16512024-03-18 22:54:38.602debugFront Light 2 status [code:colour_data_v2, value:{"h":351,"s":1000,"v":1000}]

dev:16512024-03-18 22:54:38.597debugFront Light 1 status [code:colour_data_v2, value:{"h":351,"s":1000,"v":1000}]

dev:16512024-03-18 22:54:38.601infoFront Light 2 color temperature is 6535K

dev:16512024-03-18 22:54:38.598debugGroups: [Front Light 4:[[code:switch_led, value:false], [code:work_mode, value:white], [code:bright_value_v2, value:1000], [code:temp_value_v2, value:996], [code:colour_data_v2, value:{"h":0,"s":1000,"v":1000}], [code:scene_data_v2, value:{"scene_num":1,"scene_units":[{"bright":0,"h":90,"s":1000,"temperature":0,"unit_change_mode":"jump","unit_gradient_duration":90,"unit_switch_duration":90,"v":1000},{"bright":0,"h":10,"s":1000,"temperature":0,"unit_change_mode":"jump","unit_gradient_duration":90,"unit_switch_duration":90,"v":1000}]}], [code:countdown_1, value:0], [code:control_data, value:], [code:do_not_disturb, value:false]]]

dev:16512024-03-18 22:54:38.598debugFront Light 2 status [code:temp_value_v2, value:1000]

dev:16512024-03-18 22:54:38.597infoFront Light 2 level is 100%

dev:16512024-03-18 22:54:38.596infoFront Light 1 color temperature is 6535K

dev:16512024-03-18 22:54:38.595debugFront Light 2 status [code:bright_value_v2, value:1000]

dev:16512024-03-18 22:54:38.594infoFront Light 2 color mode is CT

dev:16512024-03-18 22:54:38.594debugFront Light 1 status [code:temp_value_v2, value:1000]

dev:16512024-03-18 22:54:38.592debugFront Light 2 status [code:work_mode, value:white]

dev:16512024-03-18 22:54:38.591infoFront Light 2 switch is off

dev:16512024-03-18 22:54:38.589debugFront Light 2 status [code:switch_led, value:false]

dev:16512024-03-18 22:54:38.588debugFront Light 2 workMode white

dev:16512024-03-18 22:54:38.583debugGroups: [Front Light 2:[[code:switch_led, value:false], [code:work_mode, value:white], [code:bright_value_v2, value:1000], [code:temp_value_v2, value:1000], [code:colour_data_v2, value:{"h":351,"s":1000,"v":1000}], [code:scene_data_v2, value:{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}], [code:countdown_1, value:0], [code:control_data, value:], [code:do_not_disturb, value:true]]]

dev:16512024-03-18 22:54:38.584infoFront Light 1 level is 100%

dev:16512024-03-18 22:54:38.582debugFront Light 1 status [code:bright_value_v2, value:1000]

dev:16512024-03-18 22:54:38.581infoFront Light 1 color mode is CT

dev:16512024-03-18 22:54:38.579debugFront Light 1 status [code:work_mode, value:white]

dev:16512024-03-18 22:54:38.477infoFront Light 1 switch is off

dev:16512024-03-18 22:54:38.473debugFront Light 1 status [code:switch_led, value:false]

dev:16512024-03-18 22:54:38.471debugFront Light 1 workMode white

dev:16512024-03-18 22:54:38.465debugGroups: [Front Light 1:[[code:switch_led, value:false], [code:work_mode, value:white], [code:bright_value_v2, value:1000], [code:temp_value_v2, value:1000], [code:colour_data_v2, value:{"h":351,"s":1000,"v":1000}], [code:scene_data_v2, value:{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}], [code:countdown_1, value:0], [code:control_data, value:], [code:do_not_disturb, value:true]]]

dev:16512024-03-18 22:54:38.432debugTuya category dj driver [driver:Generic Component RGBW, devices:[switch:[suffix:Switch, driver:Generic Component Switch], switch_1:[suffix:Socket 1, driver:Generic Component Switch], switch_2:[suffix:Socket 2, driver:Generic Component Switch], switch_3:[suffix:Socket 3, driver:Generic Component Switch], switch_4:[suffix:Socket 4, driver:Generic Component Switch], switch_5:[suffix:Socket 5, driver:Generic Component Switch], switch_6:[suffix:Socket 6, driver:Generic Component Switch], switch_usb1:[suffix:USB 1, driver:Generic Component Switch], switch_usb2:[suffix:USB 2, driver:Generic Component Switch], switch_usb3:[suffix:USB 3, driver:Generic Component Switch], switch_usb4:[suffix:USB 4, driver:Generic Component Switch], switch_usb5:[suffix:USB 5, driver:Generic Component Switch], switch_usb6:[suffix:USB 6, driver:Generic Component Switch]]]

dev:16512024-03-18 22:54:38.427debugTuya category dj driver [driver:Generic Component RGBW, devices:[switch:[suffix:Switch, driver:Generic Component Switch], switch_1:[suffix:Socket 1, driver:Generic Component Switch], switch_2:[suffix:Socket 2, driver:Generic Component Switch], switch_3:[suffix:Socket 3, driver:Generic Component Switch], switch_4:[suffix:Socket 4, driver:Generic Component Switch], switch_5:[suffix:Socket 5, driver:Generic Component Switch], switch_6:[suffix:Socket 6, driver:Generic Component Switch], switch_usb1:[suffix:USB 1, driver:Generic Component Switch], switch_usb2:[suffix:USB 2, driver:Generic Component Switch], switch_usb3:[suffix:USB 3, driver:Generic Component Switch], switch_usb4:[suffix:USB 4, driver:Generic Component Switch], switch_usb5:[suffix:USB 5, driver:Generic Component Switch], switch_usb6:[suffix:USB 6, driver:Generic Component Switch]]]

dev:16512024-03-18 22:54:38.422debugTuya category dj driver [driver:Generic Component RGBW, devices:[switch:[suffix:Switch, driver:Generic Component Switch], switch_1:[suffix:Socket 1, driver:Generic Component Switch], switch_2:[suffix:Socket 2, driver:Generic Component Switch], switch_3:[suffix:Socket 3, driver:Generic Component Switch], switch_4:[suffix:Socket 4, driver:Generic Component Switch], switch_5:[suffix:Socket 5, driver:Generic Component Switch], switch_6:[suffix:Socket 6, driver:Generic Component Switch], switch_usb1:[suffix:USB 1, driver:Generic Component Switch], switch_usb2:[suffix:USB 2, driver:Generic Component Switch], switch_usb3:[suffix:USB 3, driver:Generic Component Switch], switch_usb4:[suffix:USB 4, driver:Generic Component Switch], switch_usb5:[suffix:USB 5, driver:Generic Component Switch], switch_usb6:[suffix:USB 6, driver:Generic Component Switch]]]

dev:16512024-03-18 22:54:38.086debugAPI GET [uri:https://openapi.tuyaeu.com, path:/v1.0/devices/bfd67f61e5dd77c707pv2t/specifications, query:null, contentType:application/json, headers:[t:1710802478084, nonce:d30f14d5-254c-4d23-9411-45712c20bd7f, client_id:w5mwexadq8pqsmq3ganf, Signature-Headers:client_id, sign:39CDABAC9900BA0D17BB71734441E764537206EE270EBEFCBDCF22944C9EC2D2, sign_method:HMAC-SHA256, access_token:c867797f750ed8d5d31d6998af926ab9, lang:en, dev_lang:groovy, dev_channel:hubitat, devVersion:0.3], body:null, timeout:5]

dev:16512024-03-18 22:54:38.083infoRequesting cloud device specifications for bfd67f61e5dd77c707pv2t

dev:16512024-03-18 22:54:38.079debugAPI GET [uri:https://openapi.tuyaeu.com, path:/v1.0/devices/bfd4ff3fb20523d12ef4qi/specifications, query:null, contentType:application/json, headers:[t:1710802478078, nonce:d30f14d5-254c-4d23-9411-45712c20bd7f, client_id:w5mwexadq8pqsmq3ganf, Signature-Headers:client_id, sign:CE63F503AE4597A2D3B91D1AB2067BAD96F20798E06E95E8F6F57DED371BB11C, sign_method:HMAC-SHA256, access_token:c867797f750ed8d5d31d6998af926ab9, lang:en, dev_lang:groovy, dev_channel:hubitat, devVersion:0.3], body:null, timeout:5]

dev:16512024-03-18 22:54:38.077infoRequesting cloud device specifications for bfd4ff3fb20523d12ef4qi

dev:16512024-03-18 22:54:38.064debugAPI GET [uri:https://openapi.tuyaeu.com, path:/v1.0/devices/bf4fa9fcba36e0fd3bl9nv/specifications, query:null, contentType:application/json, headers:[t:1710802478063, nonce:d30f14d5-254c-4d23-9411-45712c20bd7f, client_id:w5mwexadq8pqsmq3ganf, Signature-Headers:client_id, sign:F84C528D38D6E0CF977492DAE7D26D784331AB44BA054A86BA664AAC6A61B1E3, sign_method:HMAC-SHA256, access_token:c867797f750ed8d5d31d6998af926ab9, lang:en, dev_lang:groovy, dev_channel:hubitat, devVersion:0.3], body:null, timeout:5]

dev:16512024-03-18 22:54:38.060infoRequesting cloud device specifications for bf4fa9fcba36e0fd3bl9nv

dev:16512024-03-18 22:54:38.058infoReceived 3 cloud devices (has_more: null)

dev:16512024-03-18 22:54:38.049debugAPI GET [uri:https://openapi.tuyaeu.com, path:/v1.0/homes/54225301/scenes, query:null, contentType:application/json, headers:[t:1710802478048, nonce:d30f14d5-254c-4d23-9411-45712c20bd7f, client_id:w5mwexadq8pqsmq3ganf, Signature-Headers:client_id, sign:79CFA542B802B64D41DF45395D47E9D64EEB4CDDBD3342A9986052717F04DA82, sign_method:HMAC-SHA256, access_token:c867797f750ed8d5d31d6998af926ab9, lang:en, dev_lang:groovy, dev_channel:hubitat, devVersion:0.3], body:null, timeout:5]

dev:16512024-03-18 22:54:38.046debugRequesting scenes for home 54225301

dev:16512024-03-18 22:54:37.752debugAPI GET [uri:https://openapi.tuyaeu.com, path:/v1.0/users/eu1648766256063p5Ddq/homes, query:null, contentType:application/json, headers:[t:1710802477751, nonce:d30f14d5-254c-4d23-9411-45712c20bd7f, client_id:w5mwexadq8pqsmq3ganf, Signature-Headers:client_id, sign:B9924427FCC3380027ADEDD9AEAD6F6CB338F2921171273CF4BB5F1572D36215, sign_method:HMAC-SHA256, access_token:c867797f750ed8d5d31d6998af926ab9, lang:en, dev_lang:groovy, dev_channel:hubitat, devVersion:0.3], body:null, timeout:5]

dev:16512024-03-18 22:54:37.749infoRequesting Tuya Home list

dev:16512024-03-18 22:54:37.745debugAPI GET [uri:https://openapi.tuyaeu.com, path:/v1.0/iot-01/associated-users/devices, query:[last_row_key:], contentType:application/json, headers:[t:1710802477744, nonce:d30f14d5-254c-4d23-9411-45712c20bd7f, client_id:w5mwexadq8pqsmq3ganf, Signature-Headers:client_id, sign:0673E9DA97CE99180456BA631151B146BEA30E10049580C3497B116F4FF4670A, sign_method:HMAC-SHA256, access_token:c867797f750ed8d5d31d6998af926ab9, lang:en, dev_lang:groovy, dev_channel:hubitat, devVersion:0.3], body:null, timeout:5]

Have you checked that your trial period has not expired, All my devives under Tuya stopped working last night, when i check the Tuya device I have an error and as stated on the first post, log into Tuya account and check the status of your account, you have to renew every 6 months

1 Like

I've succesfully added my devices, however when I send a on command to one of the switches, the lights just flicker on for half a second, and turn off again. Am I doing anything wrong?

Hi there! I am wondering if anyone has tried to make Tuya devices locally instead of through the cloud? There is a Home Assistant plugin that does this based on the TinyTuya project. The idea is that you setup an API dev account only initially to get the devices’ private keys. Once you have them, you can query the devices directly using that key to encrypt and decrypt the payloads. Neither one of those projects is written in java unfortunately…

hello all, got an alert from tuya that I was generating a ton of API calls, 85% of them to GET:/v1.0/devices/{deviceId}/specifications

I looked at the device source and didn't even see where this was called, but it seems to be generating 1000s per day according to them, any advice on how to troubleshoot would be great, thanks

Hello,
I have Rotenso Teta Air-Condition with WIFI and I'm using SmartLife-SmartHome mobile application to manage the air-condition remotely. I'm just wondering if the Tuya Cloud driver will be working for me. I follow the instruction and I having issues with this step:
Choose Link Tuya App Account > Add App Account. A QR code will appear

After scanning the code and confirming authentication from mobile app I see info that the QR code expired and my account is not added to the Cloud project. The question is now if the application I'm using is compatible with this solution or not.

Does anyone know what I can do ? Any suggestions are more than welcome.
The main goal here is to have the air-condition integrated with HE.

Thank you in advance.
Zbigniew

I was able to connect the air conditioner to Tuya Smart app and from there all went without any issues. The only thing / question I have is:
Is it possible to be able to control the device from hubitat, except having possibility to turning it on / off ? I checked different divers related to switch / fan / thermostat but, it looks like that in the end I'm able only to make it on or off. Any ideas ? Thank you.

1 Like

Hi Jonathan

great driver! Could please add dehumidifiers to it ?

Thank you

Any chance anyone can do a driver for the Ultrasonic Sensor?

  • category: ywcgq
  • functions: {"max_set":{"max":100,"min":0,"scale":0,"step":1,"type":"Integer","unit":"%"},"mini_set":{"max":100,"min":0,"scale":0,"step":1,"type":"Integer","unit":"%"},"upper_switch":{"type":"Boolean"},"lower_switch":{"type":"Boolean"},"installation_height":{"max":3000,"min":100,"scale":3,"step":1,"type":"Integer","unit":"m"},"liquid_depth_max":{"max":2900,"min":100,"scale":3,"step":1,"type":"Integer","unit":"m"}}
  • id: ebeaafd5ceacf71a3bt1or
  • label: Tank A Level
  • local_key: N|{yzY6aBlf!LT^T
  • name: EPT- Ultrasonic ATO Sensor
  • online: true
  • product_id: duked3tftwmz7plx
  • statusSet: {"liquid_state":{"range":["normal","lower_alarm","upper_alarm"],"type":"Enum"},"liquid_depth":{"max":10000,"min":0,"scale":2,"step":1,"type":"Integer","unit":"m"},"max_set":{"max":100,"min":0,"scale":0,"step":1,"type":"Integer","unit":"%"},"mini_set":{"max":100,"min":0,"scale":0,"step":1,"type":"Integer","unit":"%"},"upper_switch":{"type":"Boolean"},"lower_switch":{"type":"Boolean"},"installation_height":{"max":3000,"min":100,"scale":3,"step":1,"type":"Integer","unit":"m"},"liquid_depth_max":{"max":2900,"min":100,"scale":3,"step":1,"type":"Integer","unit":"m"},"liquid_level_percent":{"max":100,"min":0,"scale":0,"step":1,"type":"Integer","unit":"%"}}

I'm pretty sure Jonathan has left Hubitat and moved to Home Assistant -- he hasn't been active around here for a year or so.

Unless another dev is willing to pick it up, I don't think this driver will be supported beyond its current state.

Been using this for a floor lamp and just noticed my cheap USB Smart Adapter and Cubetouch II (fingerbot) listed in my HE logs.
Unexpected, but handy to have HE control of the USB, unfortunately the Cubetouch II isn't responsive to the on/off commands.


fbot

Does this driver support multi level fan control for this device:?
https://a.aliexpress.com/_mLz9NMy

bummer - I got a smart litter box which works with the Smartlife app. It does show up with this driver but as a generic switch with on/off commands. The 'ON' command dumps all of the litter instead of just running the cleaning cycle.

I've tried to maintain a couple of other apps/drivers in the past (Life360, Orbit BHyve) and I might be able to take a look and figure it out if no one else can or wants to...

4 Likes