[BETA] Tuya Cloud Driver (Limited device support)

Hi @jonathanb, my devices have a temp_value in the status but they do not any writable temp value parameter in the functions. In the componentSetColorTemperature function the 'code' returned is 'null' and fails the check therefore the lights never get set to 'white' mode. So I removed that check and all the 'temp' stuff and just set the mode and level.

Lastly, updating the device status throws an error when updating the color temp because it finds the 'temp_value' in the status but there is no temp value in the function so it cannot process the temperature.min/max as 'temperature' is null. As a result I just hardcoded in the values and the error cleared. Now that it's all working I was just going to add checks in these sections instead of removing or commenting out the code.

In my recent driver update I now capture a new property called "statusSet" which should appear in the device data along with functions. If you see that property, can you see if the temp_value shows up there with the range?

Yes, it looks like function and statusSet are identical up to the end and 'temp_value' is added to the end in the statusSet group only. And the min/max error on a nul value returned.

THANK YOU!! Instructions were extremely easy to follow, it immediately discovered my two Novostella RGBCW flood lights, and I'm finally looking forward to be able to actually make some good use of them. I seriously considered opening them up to flash different firmware but now, I'll probably be just fine with them as-is.

The only "want" I have would be the ability to trigger a defined "scene" -- really, my ultimate goal is to be able to run WLED-style "patterns" through them. I want to buy ~10-15 more of them and put them along a block wall, and be able to have them "ebb & flow" similar to what I can do with WLED (think 'chasing dots' or similar).

This is awesome though -- thank you so, so much. :grinning_face_with_smiling_eyes:

Sorry for the extra reply (can't find an "edit" button); just in case it might help you, here's the JSON for one of my flood lights. It's currently in a "breathing" / gradient mode, achieved via the [crappy] SmartLife app. May not be useful, but figured I'd put it out there in case it does help anyone! :slight_smile:

Ack -- it appears I can't link to the text version (GH gist). Picture instead. Okay, I failed. I guess I can't post images yet, either. Well, I'd be happy to send over the JSON via email/however.

FWIW, I'm a programmer by trade -- and am beyond-willing to assist with testing, providing data/logs/etc... :slight_smile:

1 Like

It would be cool if there was an integration for this, similar to the Hue Sync one.

1 Like

Hopefully I'm not doping anything stupid here. I've created a dev account, And in there I can see my devices. when I install the driver in HE I can't connect.


Any immediate ideas?

Am I going something obvious wrong?

I'm trying to see if I can incorporate these:


That error code according to Tuya is:

Your cloud project on the Tuya IoT Platform should be created after May 25, 2021. Otherwise, you need to create a new project.

However since you did just create the project, then likely something isn't matching up, such as country code or data center location. For example I found this from Google:

I faced this issue when setting up the integration yesterday, I'm located in Australia, and my data centre was central Europe. However when I attempted to add the integration with the country set to Australia it gave me the skill ID error. Setting the country to Denmark or Sweden resolved the issue for me. I think your best bet is to experiment with the country settings.

1 Like

I JUST set this up myself right now. Also had the same issue and what I did to fix was:

  1. In the Tuya Cloud platform site, click on "Devices" and make sure you "Link Tuya App Account". You have to do a QR scan from the app on your phone. Then I could see the devices in the Tuya site
  2. I also added a user in the Tuya Cloud platform interface. Not sure if that's required or not. I made sure it was the same user/pass as my Smartlife/Tuya app account and entered it into the Device configuration in HE as well.
  3. Went into the virtual devices on HE and clicked refresh.

All works now. This is so amazing! :slight_smile:


Thanks for the steer here folks.

I think it is DC related. I deployed, possibly incorrectly the devices, into the Central European DC, my UK account has a country code of 44. When I change the DC for the project from Central Europe to Western Europe I get an error in the app when scanning the QR code: "You cannot scan the QR code to add a device deployed in another data centre.

So it look like I need to sort that out. I'll update when I've done it!

Thanks again

I wonder if this has anything to do with the actual devices? I've tried numerous new accounts, set to China and US but I can't seem to get it to work.

Some related info here on the Home Assistant forum.,

When authenticating, the driver uses the US Tuya server instead of China and then the driver switches to whichever datacenter the credentials specify (you can see this if you check the endPoint state shown). You can change this to start with the China server instead by replacing line 408 with openapi.tuyacn.com instead. Let me know if this makes any difference.

Thanks @jonathanb for the continued help here. A different error here, which is probably a step in the right direction.

I should add here that I'm trying to get these working:

This is a slim infra-red heating panel. I didn't know it was Tuya enabled until I received the item, as an HE user I header here and searched to see if there was any integration. I'm using the panel in a holiday home so it would be awesome if I could get it working.

Further update.

I've got so many accounts on the go now I'm confusing myself :slight_smile:

I can;t sue the line 408 modification above. Let me try and explain that. If you try to ruth using the CN server it throws the cross region error. At the same time if I try and use an IoT account that is setup in China I can't copy and paste the 'Tuya API Access/Client Secret' unless I supply my phone number, name and national ID number (which I obviously don't have)......

So once again I think I'm stuck.

EDIT: I think I might have it....... give me 10


Don't ask why but I did my testing with a country code of 61 (Netherlands), probably because I had read on another forum that the Netherlands, and 61 all resided in the Central Europe DC (not the Western Europe DC).

At present I have:
An Tuya IoT account registered in the Netherlands Region
A Tuya app installed and logged into with an account registered in Netherlands
And the IoT setup in the Centre Europe DC.

Finally I changed line 408 to this:

state.endPoint = 'https://openapi.tuyaeu.com' // default EU endpoint

And it's started working. I'll change it all back to the UK when I can get back to the location where the panels are and reset them!

I can now turn the panel on and off using HE! Amazing. @jonathanb, thanks for putting this up here and guiding me in the right direction.

Now if only I could change the temp of the panel using HE..............

As a side note I can see the logs generating a decent amount of data chatting away with the Tuya cloud. The current room temp is being exposed in the logs (albeit reported incorrectly), see below, the panel is reading the room as 13C.

Thanks again!


@jonathanb I just installed your driver, I think it is fantastic. Been looking for something like this for a long time.

I did find I had to make one change to the code. I am hoping this information might help in expanding the compatibility. I can't say I understand the code very well :slight_smile:

I found that I had devices belonging to the same 'category' but that had different functions (switch vs switch_1).

I simply added the 'meteringSwitch' capability to the default and it worked for me, but I do not know that this would work for every situation.


Here the problem may be that different manufacturers provide different (often partial) implementations of the 'categories' that Tuya is trying to standardize.. For example : these categories,

We should probably add the particular devices productKey to the list of the parameters that are displayed on the Device Detail page, and then in the driver code process the on/off commands accordingly to the specifics of some devices...,

Such an approach will compromise the excellent idea for generic processing of all the possible devices commands based on the instruction set as returned by Tuya for the particular category... but this is Tuya world with all the exceptions and oddities.

1 Like

First of all, this is a brilliant solution, Jonathanb! Thank you so much for building this!
I was able to import all my wi-fi devices and they are working pretty well, but I have a Tuya Zigbee Smart Lock connected to a Tuya hub and I was able to import, but not to get any status. Do you have any pro tip on how to get the status from this device?

Thank you so much!

1 Like

If the device is recognized and a child device (of Switch) is created, please go into that child device and at the bottom you will find a data section with items such as category, functions, statusset with long JSON values. Please send me that whole section so I can see if it can be added to the driver.


1 Like

Here is the JSON values, thank you again!

  • functions: {}
  • local_key: ****
  • name: Zigbee smart lock
  • online: true
  • label: fechadura
  • id: ****
  • statusSet: {"unlock_fingerprint":{"unit":"","min":0,"max":999,"scale":0,"step":1,"type":"Integer"},"unlock_password":{"unit":"","min":0,"max":999,"scale":0,"step":1,"type":"Integer"},"unlock_temporary":{"unit":"","min":0,"max":999,"scale":0,"step":1,"type":"Integer"},"unlock_dynamic":{"unit":"","min":0,"max":999,"scale":0,"step":1,"type":"Integer"},"unlock_card":{"unit":"","min":0,"max":999,"scale":0,"step":1,"type":"Integer"},"alarm_lock":{"range":["wrong_finger","wrong_password","wrong_card","wrong_face","tongue_bad","too_hot","unclosed_time","tongue_not_out","pry","key_in","low_battery","power_off","shock"],"type":"Enum"},"residual_electricity":{"unit":"%","min":0,"max":100,"scale":0,"step":1,"type":"Integer"},"reverse_lock":{"type":"Boolean"},"doorbell":{"type":"Boolean"},"remote_result":{"type":"Boolean"},"hijack":{"type":"Boolean"},"unlock_remote":{"unit":"","min":0,"max":999,"scale":0,"step":1,"type":"Integer"}}
  • category: ms

Download the Hubitat app