tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
857 stars 206 forks source link

Error setting up entry 2XXXXXXXXX for tuya_v2 #198

Open apokha1 opened 2 years ago

apokha1 commented 2 years ago

Describe the bug I have migrated from Tuya's home assistant version to Tuya V2 using HACS installation. Everything worked like a charm for a couple of days and now today, after I restarted my instance of Docker deployed HA, I have been getting an error. I tried to re-install the custom component again, but to no avail.

Expected behavior I expected the component to start as normal and I'd be able to access the devices and entities, but it doesn't load.

Screenshots image

Home Assistant Version

**Logger: homeassistant.config_entries Source: custom_components/tuya_v2/init.py:81 Integration: Tuya v2 (documentation) First occurred: 11:14:50 AM (1 occurrences) Last logged: 11:14:50 AM

Error setting up entry 2XXXXXXXXX for tuya_v2
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/tuya_v2/__init__.py", line 290, in async_setup_entry
    success = await _init_tuya_sdk(hass, entry)
  File "/config/custom_components/tuya_v2/__init__.py", line 118, in _init_tuya_sdk
    entry_data = entry_decrypt(hass, entry, init_entry_data)
  File "/config/custom_components/tuya_v2/__init__.py", line 81, in entry_decrypt
    if init_entry_data[XOR_KEY]:
KeyError: '00oo00'
cvroque commented 2 years ago

Hello! I've had the same issue (#195). All you need to do is delete Tuya v2 the integration page, restart HA and then add the integration again.

You can safely delete the integration as the devices will be created again with the exact same ids.

tsutsuku commented 2 years ago

Try v1.4.1