[BETA] Tuya Cloud Driver (Limited device support)

Dang. Thanks for the info!

I'm reposting the steps John Wohlers provided from that Home Assistant page. This worked for me. The one caveat I'd add is that I had to make sure my location was set to "Western America Data Center" to find my devices. I add this into the steps, which is starred.

Here’s the steps I performed that got it working:

  1. Login to the Tuya IoT platform.
  2. One the left side menu, click “Cloud”
  3. Click on your “My Cloud Project” you used to setup Home Assistant. (Don’t click Edit)
  4. Click “Devices”
    *** Click on "Western America Data Center" in the drop down on the upper right side ***
  5. Click the “Link Tuya App Acccount” tab.
  6. Under the “Operation” column, Click “Unlink” and when prompted in the popup click “Unlink” again.
  7. Now click the blue “Add App Account” button. A popup will appear with a QR code.
  8. Open the Tuya app in your phone.
  9. Click the orange plus symbol in the upper right. (This is in Android, not sure for IOS)
  10. Click “Add Device” from the menu that appears.
  11. Click the [-] symbol in the upper right corner of the “Add Device” screen
  12. Scan the QR code displayed above.
  13. Click “Confirm Login”
  14. Return to the IoT platform, and click to select “Automatic Link” and “Read, Write, and Manage”
  15. Click “Ok”

Your Tuya devices should all start working again in seconds.

4 Likes

Steps from @user2612 above did the trick.
Thanks for sharing the info!

Hello @jonathanb ,

It would be great if we could move the online / reachable status from the device metadata to the states, this would allow us to react and react rules when the devices goes offline :slight_smile:

I can submit a PR with yopur ok with the change.

Since the generic component child drivers from Hubitat do not implement that attribute, you can't add new attributes to the child devices like offline. That is one of the limitations of the decision to go with a single driver design which the next version will probably change.

What do you mean by the single driver? I am using the Component/ComponentDehumidifier.groovy or is this only in the dev branch?
I only tested this version.

Thanks for the tips. It resolved my Tuya platform issue!

@jonathanb
Do you know is there is any way of also getting the device status/alerts (Full water tank)?

I have been looking at the app logs and don't see anything, if you need any additional details to try and extract this into just poke me.

The child devices such as Switch, Light, Sensors etc. all use built-in Component drivers made by Hubitat and are not editable. There are a few I created such as the one you refer to where this would work but unless I want to write all the drivers (Light, Sensors, Switches etc.) then the change you propose won't work for them.

Ok, thanks for the details.

How about this, do you know if this is possible to extract the API?

Jonathon,
Thank you so much for putting the work in for this. I am a HE noob (bought my hub in the US last month and only plugged it in back in the UK two days ago), went through your detailed instructions and - hey-ho, let's go - all nine of my Tuya devices are recognised and working.
This has saved me money as I was considering swapping out all devices for Zigbee, so thanks again!!!
One question please - If I now add any Tuya devices via the app, will they automatically appear within HE or will I need to re-authorise in Tuya Cloud?

1 Like

You can see what the device supports by looking in the "Data" section of the child device, it will have a StatusSet and FunctionSet. The StatusSet shows what events are sent, however, many devices only publish the minimum set of status and the rest are proprietary and not sent.

As soon as you add them in your app, they should get created and if not you may need to hit initialize or refresh.

The driver has grown significantly in the last year since I made it just to control some of my lights. It is probably due for a re-write to improve the experience and make it easier to maintain and add features to...

Excellent!
Thanks for prompt response.

1 Like

Hi Jonathan,

I´ve been using HE for a few years now, I´ve been able to make it work with different Apps and Drivers.
Now I´ve been trying to use your driver for three days with no success.
I´ve read all your comments and suggestions, as other members suggestions with no success.
I have tried to follow your instructions exactly as posted, but for some reason I cannot make this driver link to Tuya account.
I´m in México, so I already played with changing countries, and cloud service providers with no luck.

I´ll appreciate if you can give me a hand to make this driver work.

I´m attaching an image of what I get when I press "Save Preferences";

image

And as you can see, I never get an access_token

Any ideas? Is it better if I PM you?

Here is the Logs messages:

Edit: I just replaced logs messages with the ones with the "correct" data, the other one was with crazy data with testing purposes, such as "tuya Smart app" or Phone number instead of email, etc.

Thanks!

I am getting same issue, only in UK

Has Tuya changed their policy on cloud projects. Yesterday I started getting Cloud API request failed: {"code":28841002,"msg":"No permissions. Your subscription to cloud development plan has expired.","success":false,"t":1668774278729,"tid":"f86f90ef673b11edb7739e1973e2fe3f"} in my logs. I went into the cloud project and my devices are gone and it won't let me add them, even to a new cloud project.

1 Like

Tuya is a most frustrating organization as far as I'm concerned. I am convinced they are trying to remove the free services regardless of what they have said a year ago :frowning: If you check Home Assistant and Homebridge integrations you find the same issues happening there too with the API.

First, for the skill id issue, make sure you have Western US datacenter selected in the Tuya IOT dashboard:
Screenshot 2022-11-18 at 7.30.53 AM

Second, for expiration, you should have a button to extend. Check the Cloud Services (under the cloud menu):

The alerting status has an info icon, hover over and it will give you a link to "View exception status". This page should have an extend trial button:

Unfortunately mine only gives me up to six months extension, after that, I do not know if you can keep requesting to extend it :frowning:

3 Likes

So, I've replaced a few Tuya bulbs with Innr/Sengled which highlighted color disparities for white. After some sleuthing, it looks like the conversion of CT from the driver to the cloud is off a bit.

Here's the same light from its device page in HE and in the Tuya app at the same time.