[BETA] Tuya Cloud Driver (Limited device support)

I think I found the right virtual device, at the bottom of the list under User. I copied the Access ID and secret key and tried my email and password for the app, but it keeps failing and showing error. I tried changing the password for the app, so there were not special characters, but that did not help.

Do you have the devices paired with either the Tuya or Smart Life app? You said Home Life app up above, not sure if you meant Smart Life?

Alost. post a screenshot of the error from the logs.

Yrs, the Smart Life app, the one that looks like a blue house (on Android anyway)

Not sure how much of the logs to post, since they included the login info sent in the clear.

I get an error while trying to post i cant include links in my post. Whats the work around for that, or is it because i just signed uo?

Join the owners group to get more posting privileges, its an anti-spam measure.
https://community.hubitat.com/g/owners

Mainly looking for the errors from logs. If it has sensitive info you may need to edit in paint or something and black it out. Or copy/paste the text and edit if you have to but it is horribly hard to read that way.

dev:112023-07-19 10:39:05.591 AMerrorCloud API request failed: {"code":1106,"msg":"permission deny","success":false,"t":1689788345213,"tid":"281b606f265b11ee804ade073cb82c5d"}
dev:112023-07-19 10:39:05.245 AMdebugAPI POST [uri:https://openapi.tuyaus.com, path:/v1.0/iot-01/associated-users/actions/authorized-login, query:null, contentType:application/json, headers:[t:1689788345244, nonce:b5b28617-1e8b-4d36-b950-0ead75c5d17c, client_id:ymj3y7gjnxe3yhwyqtrt, Signature-Headers:client_id, sign:A035EB5E425B2C1FC4F02DC332E5BC4A0605AAB1A9F2464C027A6B50DA9084B7, sign_method:HMAC-SHA256, access_token:, lang:en, dev_lang:groovy, dev_channel:hubitat, devVersion:0.3], body:{"country_code":"1","username

Permission Denied, that sounds like maybe part of the setup was done correctly. Did you do this as instructed:

Ensure that you have selected the four required API services especially Device Status Notification , Smart Home Scene Linkage , IOT Core , Authorization .


Are these the right services?

I also have Industry Basic Service not sure why, its not in the instructions.
Could really be any step you missed in the instructions of authorizing things.

@jonathanb are you familiar with this error posted above? Permission Denied

Greetings from Australia and thanks @jonathanb and other contributors. I just found this thread and driver today.

Got the integration going up to the point where it interrogates the API to get child devices. I can see a deviceCount of 3 but it fails to create them and has a state: error

The log shows it executing API GET [uri:https://openapi.tuyaeu.com, path:/v1.0/devices/xxx/specifications

However I'm getting a code:2009 "not support this device". JSON response is:

{"code":2009,"msg":"not support this device","success":false,"t":1689843869060,"tid":"6ee6802e26dc11ee8ac9ce4d0cb672c1"}
{"code":2009,"msg":"not support this device","success":false,"t":1689843868998,"tid":"6ede8f6926dc11ee94e0a2e0adfc0b14"}
{"code":2009,"msg":"not support this device","success":false,"t":1689843868692,"tid":"6eb0614526dc11eea28d7e2a94be2486"}

This is an IR/RF blaster and two remote commands for roller shutters (open/close).

I'm way out of my depth with I look at the driver code and API support doco. If it can't determine the category through the specifications API then I suppose there is a fudge required to create the devices in HE?

Hey @jonathanb ,

Great work!

All of my switches are the fan+light dimmer combo--the fan is working but the light isn't. I noticed earlier you mentioned adding more support for the combo switches, did you ever get around to adding/fixing this?

// EDIT: for clarity, your driver did enumerate the combo switch properly and split it out into a separate fan and dimmer control.

// EDIT #2: finished reading the thread; didn't see anything to address my particular issue. Did anyone else encounter this?

PS: if this is already answered, apologies--I''ve read through the entire thread but it's gotten LARGE :slight_smile: so possible I missed something.

Thx!

Adding Logs for light control events.

@limeypride I had a very similar problem with my fan which has a built in Tuya wifi controller. I could get the fan to work but not the light.

So far I’ve only got as far as getting the light to work on / off in hubitat and not change colour or dimmer settings. If this stop gap measure would help you take a look at my posts 430 and 433 in this thread and see if this works for you

1 Like

Thanks, @CharlesD!

I'll begin working through those steps once I'm done with work. I already have the IoT direct driver assigned to my loft fan but I'm having a helluva time pinning down its IP address--over 80 WiFi devices and 11 Tuya devices/switches. I figured I'd just use MAC vendor prefixes to narrow the list down only to find that Tuya have 14 or so assigned prefixes... sigh. Anyhoo, I'll figure it out. :slight_smile:

I'm assuming you had to tweak OP's original driver code. If so, could you post your mods--it'll probably save me a ton of time later if our switches happen to be compatible.

The ON/OFF only functionality is enough since what I'm really trying to get to for now is the ability to have the Hubitat keep my lighting sane during daytime hours and when we go to bed--OFF would be great.

Appreciate you jumping in!

Please see the solution provided by Jeff Page @jtp10181 here:

It's non-local but permits complete control over both the fan and the light including dimming functionality.

Thanks again, @jtp10181

1 Like

Has anyone had success removing scene/groups that have been deleted? I still have a couple that just won't go away, and new ones are not synching. Says [Deprecated] on the scene api thing, and won't let me renew...Seems they changed something.

I wish I had read this b4 I tried to work out why my Tuya automations had stopped working....

Hi @jonathanb

I've configured local control for RGB lights with the library/driver you linked a few years back. The one thing is that my lights are running the 3.4 protocol so I don't think it's working correctly and it just falls back to the cloud control. I tried searching but didn't see if there was an update for 3.4 bulbs.

I had wondered for a while why my device count was always 20 when I have more than 20 devices. So it appears in the json the code is looking for has_more but the json contains hsa_more :wink:
lines 1841 and 1842
LOG.info "Received ${result.devices.size()} cloud devices (hsa_more: ${result.hsa_more})"
if (result.hsa_more) {
once I made that change I get the proper count.

New to the Tuya world today, picked up a Treatlife DS03 Fan Light switch to retire the insufferable Hampton Bay zigbee controller.

So far I’ve gotten the FAN only working via this driver. Has anyone figured out how to get the light side working as well? Tried switching the child driver to Generic Component Fan Light Control, but that didn’t seem to do anything.

Has anyone got one of the Diffusers working with this?

i'm all set up, 2 child devices created, but as they are not recognised they are created as generic switches - the on/off switches the LED on and off on the diffuser.