[BETA] Tuya Cloud Driver (Limited device support)

It is yeah. So the good news is, im on the right track :grin:

I will fettle around more with the tuya app and the cloud settings etc.

Thankyou for pointing me in the right direction

1 Like

Hi Jonathan and guys,

I wrote a post a few days ago asking for help. I realized I didn´t explain myself with my comments because I posted a screenshot with wrong data, and when I realized about it, I mentioned that I was using now the right data. I never mentioned that anyways it was still not working.

The news is that somehow (don´t really know why), the app started working after a couple day´s struggling, and IT WAS GREAT!!!

The bad news is that after a couple of weeks, it quit working without any reasonable cause. Now I have a bunch of Tuya devices on it´s way, and this better work! :wink:

BTW, when it worked, it was with the TUYA SMART app, and NOT the Smart Life app.

I´ve been playing and struggling with this for two weeks without any success, erasing, reconfiguring, resetting, etc., with no luck.

I just realized there are some differences between a screenshot I made when it worked, and now that it doesn´t. FYI, I´m in Mexico (Code 52).

I´ll post both screenshots and will appreciate any help to make this app work again for me.

Screenshot when the app worked (Please notice the MQTTINFO line on the State Variable section, under endPoint)

Screenshot when the app doesn´t work where there is no MQTTINFO line

Any help will be much appreciated, besides Santa will be generous to you guys!

You will need to look at the log file, when it shows "error" state then the actual error will be logged. It is unusual to be able to get a valid token and then get an error so we might need to turn on the debug logging but first we need the error message itself.

I chose US east, and USA for country; there were too many choices to try other countries without some guidance, although I did try China and Canada, with no improvement.

I would suggest selecting the Western America Data Center (or just select both eastern and western) since most likely the Tuya application on your phone that you are using will be using the default Western.

On your phone app, make sure it is set to use the US and country code 1. Everything must line up for this to work, the phone app and the cloud and the driver must all be set to the same datacenter! If any one of them isn't, then it won't work...

Jonathan last night I did as suggested, turned on the Debug Logging option, and here is what I got:

As you can see, the error was this:

errorCloud API request failed: {"code":28841002,"msg":"No permissions. Your subscription to cloud development plan has expired."

So now I had a better way to focus on a problem. I never considered this option as I only registered a few weeks earlier and didn’t think Tuya would cancel my permissions so early,

I searched on the web how to solve this, and I found a link with all instructions to do so:

I discovered that Tuya gave me just ONE month authorization, so
I followed all instructions to renew it, and the most I could get was 6 months!! And had to wait for the authorization (hours or days), and this morning my Dashboard lit up as a Christmas tree and everything worked again!

Many people mention that they just discovered they had been working with voided authorizations for months, but it seems Tuya just noticed it, and suddenly they shut the door to voided authorizations.

I hope my experience will be of help to anyone having the same problem.

Thank you very much Jonathan for your support.

4 Likes

Thank you, I noticed my subscription has also expired and I can no longer see my devices in the IOT portal or change anything but for some reason it has not stopped working for my existing devices yet...

I just tried to set up my HE link to Tuya and its giving me an error on authentication. Apparently it's trying to access https://openapi.tuyaus.com, and is giving an error of Temporary failure in DNS Resoulution, so it can't log in. Did I miss something in an update?

I Have a Treatlife Ceiling Fan and Dimmer Switch Combo. DS03. This driver pulls in both however only the fan control switch works. The light dimmer portion of it is not responding to commands from Hubitat. It works fine in the Tuya app.

Will try -- in the app, I can't change region, says "United States of American/Can..." [cuts off]. The linked mobile number is region 1

I'm a new SmartThings/WebCore refugee. It is not going well.

Can anyone tell me where I do this:

You must populate the driver fields:
a. Tuya Access Key/Client Id *(from the instructions in section 3 above)*
b. Tuya Access Secret *(also from the instructions in section 3)*

I can see these listed in the "preferences" section on line 91, but can't see where to enter the value.

You should create a virtual device with this driver selected. On the device page, you will have spots to enter that information.

1 Like

Thanks very much, I got it all working :slight_smile:

1 Like

Any advice on how to recover from this?
I think I'm seeing the same "No permissions. Your subscription to cloud development plan has expired"

Same here. Only signed up to Tuya a few weeks ago. Lost all control

You neet to do a renewal of the trail for another 6 months.
I spent like 30min searching around the ui for the option, its purposely difficult :wink:

I'll try an post late the path

Thanks, look forward to seeing the way to do it.... tried earlier and got lost!!
EDIT: just noticed the solution is in post 385 [BETA] Tuya Cloud Driver (Limited device support) - #385 by rgr

1 Like

Is there any method to send a custom payload to a device? I've used TinyTuya to figure out how to change the scenes on my off brand floor lamps RGBIC - they use DPS 51 and each "scene" has a custom payload that is base64 encoded... if I use python I can send the payload on the 51 endpoint and it works - but since the cloud driver only recognizes on/off/status for my lamps - how can I send the scene payload values? Any options there?

The cloud API doesn't really use the DPS system, that is for local communication. I tried using a local only driver but found it was not that reliable for status updates, possibly because I have Alexa directly connected to SmartLife for this one LED Strip I have. If you have all connections go through the hub a local only driver would probably work good.

Anyway, I ended up keeping this cloud setup but found the author has a few example child drivers that you can drop in, which enable local communication for any device you switch to it. I made some modifications to it as well which I posted in a Gist, linked here: Discussion of local control of Tuya Smart Wifi devices without flashing firmware. Feel free to reply back on that thread if you have any questions about the local control or how to get your device to work.

There is also these drivers from @holand.ivar which are standalone local drivers: hubitatappndevice/Device/tuyaDevices at master · ivarho/hubitatappndevice · GitHub . He has a few posts on the forums in various places.

Since a lot of the Tuya devices are slightly different you will probably end up having to change a lot of the code to get everything to work right, but all the communication stuff is in there which gets the hard part out of the way.

3 Likes

Wow!!! What a game changer. I was setting up virtual buttons in Hubitat so they could be seen in Google Home and Hubitat Dashboard. Then I would set up a Google Home automation trigger to control the Tuya device effectively mirroring the virtual button and the Tuya device. It worked but was a bit cumbersome. This makes things a lot easier. Thanks for all your hard work.