[TUYA] not authenticating

Hey all,

I am having trouble getting the Tuya integration working properly. I had this set up a couple of months back, and it worked ok at the time, but then the two bulbs I had set up were not being used until we finished remodeling the room they go in.

At the time, I followed the steps in this article:

I have both bulbs set up in the Tuya app and can control them fine from there.
Set up an account on the Tuya IoT platform and have the integration configured with the correct client ID and secret, devices added and showing up as expected there as well.

On startup, the Tuya integration is reporting “Failed to set up,” and obviously the devices are not responding in HA.

Relevant log lines follow:

2021-12-07 15:37:04 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [email protected] for tuya
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup
result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 63, in async_setup_entry
success = await _init_tuya_sdk(hass, entry)
  File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 75, in _init_tuya_sdk
auth_type = AuthType(entry.data[CONF_AUTH_TYPE])
KeyError: 'auth_type'

I thought I would delete and reconfigure the integration, but now I cannot even get the Client Secret. When I try to view the Client Secret, I am presented with the following message:

image

AGH! DO NOT WANT. This happens whether I am looking to view the Client Secret for an existing Cloud Project or if I am creating a new one.

I know there were some changes to the way Tuya integrations work recently, I am running core-2021.11.5.

Hi Chad,

did you solve that meanwhile? I’m running into the same issue for some weeks but did not find the time to debug yet :frowning:

Tobse

Good timing! I actually got this working yesterday…

At first I tried the Local Tuya custom integration, but had some trouble with that so I returned to the official integration.

I ended up removing the bulbs from the Tuya app, unlinking the app/devices from my existing account on iot.tuya.com, and starting from scratch with a new account.

Working fine for the past 24 hours, looking forward to it breaking again next time I update.

Thanks! I also got it working these days. I just was not aware that in the meantime the IoT account is required. I had mine running without - just the App credentials were sufficient in the past, but I missed that this whole procedure had changed. Now everything is running fine again!