Tuya stopped working

My tuya config has been working for some months with lights, switches and a camera, but from yesterday nothing shows up in HA (0.103.3). The only “change” was an automatic reboot of the Windows PC hosting HA (via a VM), presumably for forced software updates. There is nothing in the logs and calling tuya.pull_devices has no effect. I can still see the devices in the TuyaSmart app.

Has anybody had similar issues lately?

With cloud polling devices, you are at the mercy of the remote server API. If they update their API, you have to wait for your integration to be updated to the new API. Then, you would have to get the latest integration.

Looking at the git commit for the tuya component, it was updated from tuyaha 0.0.4 to 0.0.5…but looking at those commits, it doesn’t seem like there was an API change. So I don’t think this would be the problem. My point about that rant would be that if you’re running an older version of HA, there’s always a possibility of cloud polling devices to stop working until you update.

You should raise (lower? direction is always confusing to me) the log level to DEBUG

logger:
  default: warning
  logs:
    homeassistant.components.tuya: debug

Now you’ll get some verbose info in the logs.

Actually, it looks like they only put in a single log message.

    _LOGGER.debug("Pull devices from Tuya.")

Not a single debug message. This is literally the only logger message they generated. You won’t see error logs at all with this component!

In the tuyaha pypi package, there are a few more logs. Maybe these share a logging component? No clue…

        _LOGGER.warning(
            "request error, status code is %d, device %s",
            response.status_code,
            devId,
        )

Can’t hurt I guess to change the log level…

Thanks @jocnnor . I turned on logging, but as you say, I’m only getting “Pull devices from Tuya” every 5 minutes.

However, I remembered I was also looking into using the Node Red add-in node-red-contrib-tuya-smart. This requires you to create a developer account and request Cloud API Authorisation, which I received on the same day it stopped working in HA. This looks like a smoking gun. Perhaps doing this breaks the HA integration, although I would have thought others would have found the same issue. I will do some digging in this direction.

I revoked the Cloud API Authorisation and restarted HA, but the devices didn’t reappear.

I unlinked one of the devices from Tuya, and then relinked it with a new Tuya registration and then updated HA for the new credentials. It worked.

So the lesson appears to be: don’t enable Cloud API Authorisation or it will break HA.

Try deleting your tuya integration from HA and then add it again. I had the same issue as yours. This worked for me and now my tuya linked devices are working fine as they were working before

I have the same problem. Today, after updating HA and OS from previous version, all my Tuya smart plugs stopped working…