[App][Pro] Tuya Cloud

I’ve checked the error codes and I have created this Tuya cloud app in IoT after the 25th of May 2021, so I should be ok there.
And it should go without saying, but to be on the safe side: using the Tuya app itself I can control the devices.

1 Like

I updated Homey yesterday and i cannot control my devices today. No errors, just no responding

Edit: same error as @Rudi_Hendrix in config when i save settings

I also updated firmware yesterday.

I also have the same problem, yesterday renewed my tuya cloud as described in this topic still not working.

same here…

Last night it worked today none of my tuya cloud devices work via Homey.
When i use tuya app the work fine.

When i try to save the tuya details again i also get this error with the ID…

The only thing what is changed is that i updated homey yesterday, i used the tuya app and devices for months now…
I also use HA (for dashboard), HA also uses a tuya cloud connection, this connection still works, so tuay cloud via Homey does not work, tuya app and tuya cloud via HA work fine.

I also created a github bug report.

Confirmed. With both test version and stable version v1.1.12
Also no text events are received when operating devices with Tuya phone app.
I did not update Homey firmware.

Also confirmed Tuya iot cloud still works with HomeAssistant.

Tuya iot cloud still gets device updates:

It’s not working for myself either, also didn’t change the settings or anything in portal or app. Tried differnt versions to see if it’s a code issue, but not working anymore for stable, test and cli. The message I get is a 2406 Skill id invalid. Why, I don’t know yet. Have to look this weekend, now at work.

1 Like

possible fix for “Error: Error: Code: 2406; msg: skill id invalid” (when saving settings).

You can have this error when no Tuya Cloud devices are responding in Homey (even without any cause/message/error in Homey app/flows itself), if you go to the Tuya Cloud settings page in Homey and press to save the settings, you then receive this 2406 error message on this page.

Follow/try the following instructions to fix it:

  1. You have to login into:
    https://eu.iot.tuya.com/
  2. go to cloud → click on the name of your project → devices → Link Tuya App Account
  3. UNLINK here your app account
  4. then ‘Add App Account’ and link it again, you can do this by opening the tuya app on your mobile device and press the + sign and scan the QR code on the screen. tip: when added use the automatic recognition option and give all rights to the devices.
  5. Open the Tuya Cloud settings app in homey again and press SAVE (the error should be gone now)
  6. Restart the Tuya Cloud app in Homey as suggested, (in the homey app go to: more, apps, choose Tuya Cloud app, press top right the gear icon, then the option to restart app).
  7. Now test if a Tuya Cloud device is working normally again.

If all went well it should work again and your Tuya account is fixed/linked again…

@Jurgen_Heine
Is it possible return an error on the flow cards when the API is not responding?
Now the cards where executed without an error, using advanced flow you could catch the error and ‘do something’ with it, now it was searching why a device did not work… (i my case i could trigger HA to operate the device if i got an error in the flow card back)

8 Likes

Thanks B3rt, your solution works here as well.

That is indeed the solution! Thnx!

Good Find @B3rt :+1: I have to look at your suggestion about showing the error on flows, the errors are now handled and logged to error logging. But to show them I have to look how to raise the error again with proper message.

I mean the error option in the (new) advanced flow cards when the api call fails, not a separate flow card :slight_smile:

At the moment the flow card acts if the api call was successful, it would be great to have an error report in the flow card when it fails.

1 Like

This worked, thank you!

@B3rt, it was what I mean also. Now the error is logged only.

2 Likes

Hi @Jurgen_Heine
there is also a problem with the room temperature, which it does not update, at least not with me. Do you still need information to solve this problem?

and maybe an idea to add an option ‘then’ in a flow with valve open or closed. so you can control it with a virtual thermostat

Hi Jurgen, I checked the thermostat device (code is mainly copied from air conditioner) and there the error is just logged.

    sendCommand(code, value) {
        var param = {
            "commands": [
                {
                    "code": code,
                    "value": value
                }
            ]
        }
        this.homey.app.tuyaOpenApi.sendCommand(this.id, param).catch((error) => {
            this.error('[SET][%s] capabilities Error: %s', this.id, error);
        });
    }

In addition, this method needs to throw the error again.

And the capability lister need a modification, too.

    _onMultipleCapabilityListener(valueObj, optsObj) {
        this.log("Thermostat capabilities changed by Homey: " + JSON.stringify(valueObj));
        try {
   ...
        } catch (ex) {
            this.homey.app.logToHomey(ex);
        }
    }

So all driver need an update for thowing the error from the capability listener back to Homey core in order to get the error in the advanced flow card.

If it’s only for the generic actions it would only hit their flow actions.

Btw: I made a PR for the thermostat (wrong max range caused my the missing scale factor).

Thank you for this well explained solution <3

@RonnyW, those are indead some places where it has to be changed. But we have to look at calling functions also, we have to handle the exceptions on those places that it get’s logged to user, but not lead to crashes of app or lot of automated crash reports( those I get in app log).

I will try to look this evening to your PR.

I have made a link to this post in opening post about the 2406 error.

2 Likes

I also have tried this, still not working.
Dont recieve an error, someone else have a solution or idea?