[BETA] Tuya Cloud Driver (Limited device support)

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.


You are right, Tuya doesn't use CT values from the cloud API, it specifies only a "warm" level from 0-255 (or 0-1000). The cloud API does not give a kelvin value or range, in fact, on my bulbs in the Tuya app, that value isn't shown at all so it appears to be vendor specific.

| temp_value | Color temperature | Integer |{“min”:0, “scale”:0, “unit”:“”, “max”:255, “step”:1}|

Since each Tuya bulb can have any range of CT (I have bulbs with very different warm and cold ranges) you can adjust the formula range used on lines 196 and 197:

// Constants
@Field static final Integer maxMireds = 370 // 2700K
@Field static final Integer minMireds = 153 // 6536K

If you change this to the actual range of your bulbs, it should be able to calculate the percent more accurately. Unfortunately there is only one setting for all devices so if you have a mix of ranges (like I do) at this point you have to decide on a single conversion range that works for all your bulbs (future enhancement opportunity)

2 Likes

Cool, I can dig into it later this afternoon. Thanks for the quick reply as usual!

Hi Jonathan,

Is it possible to get your driver working with vacuum cleaners at all behind the basic on and oft?

I have it connected and can start the vacuum and stop it using generic switch. Is it possible to get other functions working like auto emptying .etc

Many thanks

This is what I have from the device

1 Like

My vacuum is similar but the generic power switch does not work unlike yours. It looks like it might be due to mine not having the generic "power" function?


I think key functions for these types of devices are "power_go", "mode" and "dust_collection"

Dude - thanks for this. Works perfectly for me. This allowed me to ditch my IFTTT integration hack I was using before to get Tuya switches to work with HE. Thanks so much.

1 Like

Hi Jonathan, I still can't seem to get the garage door controller to work.
using your latest child driver, pressing open, close, or refresh, it just creates a error in logs.

[dev:909]2022-11-25 16:52:57.210[error]org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_component_Generic_Component_Garage_Door_Contact_Switch_960.refresh() is applicable for argument types: () values: [] Possible solutions: every(), parse(java.util.List), every(groovy.lang.Closure), grep() (method refresh)

[dev:907]2022-11-25 16:52:48.090[error]org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_tuya_Tuya_IoT_Platform__Cloud__928.on() is applicable for argument types: () values: [] Possible solutions: run(), run(), any(), any(groovy.lang.Closure), is(java.lang.Object), run(java.io.File, [Ljava.lang.String;) (method on)

do you know what I am doing wrong% thanks in advance for the help !

1 Like

Somehow I missed out the refresh code in that driver, I just added it in so if you grab the latest it won't have that error (of course it might have something else...)

1 Like

ok! I will try it now!
Thanks

Lets start with adding "power_go", I'm updating the driver to include this in the next few minutes...

1 Like

ok, so... Refresh does not give an error anymore and does refresh state

OPEN button still creates an error though
org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_tuya_Tuya_IoT_Platform__Cloud__928.on() is applicable for argument types: () values: [] Possible solutions: run(), run(), any(), any(groovy.lang.Closure), is(java.lang.Object), run(java.io.File, [Ljava.lang.String;) (method on)

wait, I understand better, when the contact is closed, if I click the CLOSE button, nothing happens, as expected, but if i click OPEN, then the error.

When the contact is appart, the do appears as opened, if I clock OPEN, nothing happens, as expected, but if i click CLOSE, then the error.

so the error is on the action to send to the device / Tuya platform

  • this is a momentary button on the device of course, it goes to OFF automatically after 1 second as it is to activate / simulate the garage door button

Ok, fixed both open and close to call the right method :slight_smile:

no luck :confused:
still have this error:
org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_tuya_Tuya_IoT_Platform__Cloud__928.open() is applicable for argument types: () values: [] Possible solutions: run(), run(), grep(), main(java.lang.String), main(java.util.List), main([Ljava.lang.String;) (method open)

this might help, i activated debug and refresh gives me this:

dev:9092022-11-25 20:41:17.668infoGarage Door contact is closed
dev:9092022-11-25 20:41:17.665infoGarage Door switch is on
dev:9092022-11-25 20:41:17.662debug[[name:switch, value:on, descriptionText:switch is on], [name:contact, value:closed, descriptionText:contact is closed]]
dev:9072022-11-25 20:41:17.650infoGarage Door contact is closed
dev:9072022-11-25 20:41:17.646infoGarage Door switch is on
dev:9072022-11-25 20:41:16.586infoRefreshing Garage Door (ebe9bb3e9101730fbdpzzz)

Awesome driver, I just switched to Hubitat, and I won't have to rebuy these devices, thanks a lot!!

Hey @robertsimard I just updated the component driver again to hopefully address that error. Thanks!