Tuya integrattion fails

I have followed the instructions to set up Tuya. I have an app on iot.tuya.com and can see my devices there. When I add the integration in Home Assistant it succeeds, but immediately it shows " Failed to set up[Check the logs]". The log says:

Logger: homeassistant.config_entries
Source: components/tuya/__init__.py:66
First occurred: November 3, 2021, 11:29:55 PM (2 occurrences)
Last logged: 7:07:09 AM
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 66, in async_setup_entry
    hass.data[DOMAIN].pop(entry.entry_id)
KeyError: '6fe13c67f0d90aeddf68e7b'

I’m running the latest Home Assistant, 2021.11.0.
What to do?

2 Likes

I’m seeing the same thing, new integration was working perfectly with the previous release (once i’d migrated all my devices from the legacy Tuya integration!) Completely broken now for me.

1 Like

Where did you find this Mike_B?

I can’t actually remember, I googled the error so many times I lost track. I thought it was a reply within the Home Assistant community forum. I solved the issue by changing my password on the App. Logging back in, then changing it back to the original and all worked fine.

I had the same, could not connect to the tuya anymore.
installed v2 in HACS and restarted then worked again.
have not touched the integration v2 i think it was just solved on the tuya end.
will be watching the v2 development though.

I had the same issue after upgrading to core-2011.11.0, I lost control of the Tuya devices that I re-setup on the previous release.
However the issue was with my Proxmox server, it wasn’t properly up to date on v.6.4-13.
Used the shell command apt dist-upgrade (while stopping HA running) and it updated correctly.
Use pve6to7 --full to check for issues with the upgrade first.
(Next step for me is to upgrade to v.7.0

Now the Tuya devices are fully accessible and controllable.
I had similar issues a year or two ago, couldn’t get HA to update for months, then found the issue was with Proxmox and not HA.
Of course this won’t be of any use if you are not using Proxmox :thinking:

1 Like

I am running home assistant on Proxmox as well (version 6.3-2). I have a couple of power-boards that work fine through to the Tuya app but display different states within HA. Odd thing is, on one of the powerboards its only one socket that seems dodgy. I have to see if I can update proxmox. Not sure why that would be the issue though. Beginning to wonder if I should just flash the damn things with ESP_home.

Did you use any particular procedure to run the update? I gather you ssh into the proxmox machine and run from there right?

I have no problem migratiing from HACS Tuya v2 to the current version 2021.11.1
Its simply removing TuyaV2 from integrations + HACS. Restart…

From Integrations add TUYA and put in all the credential and choose the correct region base on your TUYA apps in you device and its complete.

choose the correct region base on your TUYA apps in you device

How do you mean?

where is the right country your device is located

I was able to update successfully at first, but 2021.11.2 broke my cabinet lights. Still shows/works in the Tuya app and Alexa, but shows “not supported” in HA. This is a huge issue as I’m not going to replace the cabinet lights. I’ll stay on 2021.10.x if I have to.

1 Like

Tried to run the update but got multiple errors:

Do you want to continue? [Y/n] Y
Err:1 http://ftp.au.debian.org/debian buster/main amd64 base-files amd64 10.3+deb10u10                                                                                         
  404  Not Found [IP: 150.203.164.37 80]
Ign:2 http://ftp.au.debian.org/debian buster/main amd64 libssl1.1 amd64 1.1.1d-0+deb10u6                                                                                       
Ign:3 http://ftp.au.debian.org/debian buster/main amd64 tzdata all 2021a-0+deb10u1                                                                                             
Ign:4 http://ftp.au.debian.org/debian buster/main amd64 openssl amd64 1.1.1d-0+deb10u6                                                                                         
Err:3 http://ftp.au.debian.org/debian buster/main amd64 tzdata all 2021a-0+deb10u1                                                                                             
  404  Not Found [IP: 150.203.164.37 80]
Err:2 http://ftp.au.debian.org/debian buster/main amd64 libssl1.1 amd64 1.1.1d-0+deb10u6                                                                                       
  404  Not Found [IP: 150.203.164.37 80]
Err:4 http://ftp.au.debian.org/debian buster/main amd64 openssl amd64 1.1.1d-0+deb10u6
  404  Not Found [IP: 150.203.164.37 80]
E: Failed to fetch http://ftp.au.debian.org/debian/pool/main/b/base-files/base-files_10.3+deb10u10_amd64.deb  404  Not Found [IP: 150.203.164.37 80]
E: Failed to fetch http://security.debian.org/pool/updates/main/o/openssl/libssl1.1_1.1.1d-0+deb10u6_amd64.deb  404  Not Found [IP: 150.203.164.37 80]
E: Failed to fetch http://ftp.au.debian.org/debian/pool/main/t/tzdata/tzdata_2021a-0+deb10u1_all.deb  404  Not Found [IP: 150.203.164.37 80]
E: Failed to fetch http://security.debian.org/pool/updates/main/o/openssl/openssl_1.1.1d-0+deb10u6_amd64.deb  404  Not Found [IP: 150.203.164.37 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Running apt-get update didn’t make a difference.

I am unable to add the Tuya Integration. I am on the current HA version (2023-7-0).

I created a IoT account and have an Access ID as well as an Access Secret and I also successfully added a device to the Tuya App on my Iphone, but when adding the Tuya Integration to Home Assistant I get this error message : Login error (2406): skill id invalid.
I use the HA Yellow Box.