TUYA / IOT Disconnected Error

Hello,

I’m desperately trying to set up the TUYA integration. It worked fine for a few weeks but for the past 2 or 3 weeks, the integration appears as disconnected.

The goal is to bring a WIFI switch that works with the TUYA app into Gladys

On the Tuya IOT site, I have this:

On the integration configuration page, I have this:

I must say that the TUYA site is not the most user-friendly and I don’t know where to look. Has anyone else encountered this problem?

Thanks in advance for your help :wink:

Hi @Steph38230,

Sorry for the delayed response!

Your Tuya site screenshot shows the cause. It’s not the IoT Core subscription: it is indeed “In service”, and your extension runs until February 2027. The issue comes from the monthly API call quota of the free plan:

  • The line “Cloud Develop Base Resource Trial” shows 0.2 / 0.2 USD, with the status Suspended. This is the free credit that Tuya provides each month.
  • Each call to the Tuya cloud is deducted from this credit. On a European data center (CLOUD_API_FOREIGN), the million calls are billed at 3.71 USD. 0.2 USD therefore corresponds to approximately 54,000 calls per month, and you’re at 53,909: the credit is exhausted.
  • Until it is recharged (“Quota Refresh: Monthly”), Tuya refuses all calls from your project. This is the message “IoT Core trial quota is exhausted” that you see in Gladys.

Why it runs out so quickly: a device that goes through the cloud is queried every 30 seconds, or about 86,000 calls per month. With a single device in the cloud, the free credit lasts approximately 19 days, which matches your “it worked for a few weeks”.

What I recommend:

  1. Switch your switch to local (LAN). This is the real solution. Locally, a simple switch is read on your network, without calling the cloud, and it continues to work even when the quota is exhausted. You have already enabled “Prefer local connection”. Now look at the badge displayed on your switch in the Devices tab:
    • Local: it’s good.
    • Cloud, often with an orange dot: Gladys does not reach it on your network, and you can hover over the badge to see why. Most often, the network scan does not find the switch (different subnet, guest Wi-Fi…). In this case, give it a static IP on your box. Then launch the action “Detect local protocol (manual IP)” in Configuration, with this IP. This action goes through the Tuya cloud: you have to wait for the quota to return.
  2. Update the Tuya integration (the latest version is 1.32.0). Since 1.24.1, a local device queries the cloud less often.
  3. Restart the connection once the quota is back. Your message is dated October 6, so it must have recharged since then. If Configuration still shows “Disconnected”, click Save to restart the connection.

Can you tell us what badge is displayed on your switch?

Hi Pierre Gilles.

Actually, it’s my contactor that I use for the pool pump. So it’s unplugged at this time of year.
I’ll do my tests again starting in April when I turn the pool back on and keep you posted.

Otherwise, I’d do the same as for the rest of the house, I’d put a Zigbee, but I was afraid it might be a bit far…