[BETA] Tuya Cloud Driver (Limited device support)

ROTFL - What kind of lock is this that people might put their tongue on it?

This category isn't listed in the Tuya reference manual, doesn't appear to have any commands associated with it (the functions are empty) but seems to have status data, what fields would you want to have displayed in a driver?

2 Likes

Hahhaha I swear that I never tried to use my tongue to open my door :slight_smile:
I think the ones that I need are very simple, just to add on my dashboard:

  • Lock and Unlock
  • Battery Status

Thanks!

2 Likes

I'm working on supporting the need for multiple Hubitat devices to map to a single Tuya device, for example, a power strip with 3 outlets would need 3 Hubitat devices or other combination type devices. I've had some success and will be reaching back out to various folk to test these changes when ready.

Thanks!

6 Likes

@jonathanb
I think I found an error in the fan speed control:
Original:
// Component command to cycle fan speed
void componentCycleSpeed(DeviceWrapper dw) {
switch (dw.currentValue('speed')) {
case 'low':
case 'medium-low':
componentSetSpeed(dw, 'medium')
break
case 'medium':
case 'medium-high':
componentSetSpeed(dw, 'high')
break
case 'high':
componentSetSpeed(dw, 'low')
break
}
}

For my use case, I rewrote it as:
// Component command to cycle fan speed
void componentCycleSpeed(DeviceWrapper dw) {
switch (dw.currentValue('speed')) {
case 'low':
componentSetSpeed(dw, 'low')
break
case 'medium-low':
case 'medium':
componentSetSpeed(dw, 'medium')
break
case 'medium-high':
case 'high':
componentSetSpeed(dw, 'high')
break
}
}

which seems to work for my tuya canopy fan controller

2 Likes

This has been working great, thanks @jonathanb! But this morning I started getting permission deny errors anyone else getting them?

Yeppers
Haven't had a problem till you pointed it out:

That indicates it was not able to renew the access token for some reason, if you push the Initialize button in the driver, it will attempt a new login and get a new token. I probably need to add an automatic retry if the token renewal fails as I don't think I have one right now.

2 Likes

I tried it a few different times and I got the same results:

1 Like

Yes, this is exactly what I saw as well. After pressing initialize, and even after I re-loaded my login info (I thought maybe Tuya changed my key).

1 Like

Its a Tuya datacenter issue.

1 Like

Ok, thanks for confirming. I will mention one thing I noticed, in case it may help someone. While debugging I reviewed the app on the Tuya IoT site and my devices were gone; I had to unlink, change the data center to Western US (I'm on the East Coast and was using the East Coast DC) and re-link; then my devices at least showed back up on the Tuya IoT site. So they are definitely playing with the data centers.

Is this the part where everyone tells us "i told ya so"? Lol

What are the odds that the ONE non-local connection went down within 30 days🙃

I love irony served fresh🤣. I still love the integration, regardless🙂

1 Like

It's at least a few steps better than the old method of HE <-> Node-Red <-> Alexa <-> Tuya. :crazy_face:

2 Likes

Log in SOLVED. It looks like it was a problem on their end and the way to fix it is just change your password. I changed mine and it came right back to life.

1 Like

I'll be darned, that worked for me too!

61 is Australia.. 31 is the Netherlands. Having said that Australia is hosted in the European data center (don't ask me why). The advice you gave works for Australia, so thanks for that. note that the Tuya developer site has a page on which country is hosted in which data centre and you have to pick the correct one for the country you are registering for. I now have half a dozen devices, so at least I have got past the first hurdle.

2 Likes

Hello there,

This can certainly be a later phase enhancement but I took a look at the finite number of scenes(effects) of the string lights. This would give me more than just basic on/off/color/white. Here's a peek at what we're looking at:


Not really sure why the effects appear to have totally different naming conventions half way through but the numbers have continuity. These are all the built in effects and to my knowledge, there's no way to add any more so this list will never change.

How heavy of a lift would it be to add effects?

Regards,

Did you manage to get your Tuya lock working with HE? I'm having some sliding doors fitted and have been struggling to find a smart lock for these. I found some Tuya options but not sure if it would be feasible to get them working with HE using this integration.

SmarDeer BT Smart lock for Tuya Broken bridge fingerprint lock Biometric Fingerprint handle for Sliding door with Bluetooth

Yoheen Wifi Tuya APP Remote Unlock Electronic Digital Smart Fingerprint Door Lock for Aluminium Sliding Glass Wooden Door

@jonathanb
I followed all the steps in the instructions but as it seems I can’t connect to the Tuya cloud. Any idea what might be the cause?

I’m situated in Sweden and chose the western europe data center.

Thank you very much!!! it works perfect with my devices. I am in Ecuador