rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.84k stars 545 forks source link

Failed to authenticate with Tuya Switch #68

Closed quangvinh9x closed 3 years ago

quangvinh9x commented 3 years ago

Thanks for your custom component. I have a problem when add Tuya switch by Tuyalocal:

  1. Home Assistant 0.115.6
  2. LocalTuya: lastest release.
  3. Yesterday, i add an Tuya 2 Gang switch to my HA (I had localkey an DevID) and it worked.
  4. Today, i changed my router (because i go to my farther-in-law house), when i add Tuya device, system noti: Failed to authenticate with device. Verify that device id and local key are correct. Screenshot 2020-10-05 200415 Log: " Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:273 Integration: localtuya (documentation) First occurred: 7:57:12 PM (3 occurrences) Last logged: 8:05:42 PM

Failed to get status: 'utf-8' codec can't decode byte 0xdf in position 0: invalid continuation byte Failed to get status: [Errno 104] Connection reset by peer Failed to get status: Expecting value: line 1 column 1 (char 0)" Anyone can help me? Thanks!

postlund commented 3 years ago

If you provisioned the device to a new access point, the device will generate a new local key. So you will need to get the new local key for this to work.

quangvinh9x commented 3 years ago

Thank you! I am trying to generate a new local key. I do like this video to generate a local key, but it like the last local key i generate in old device. https://www.youtube.com/watch?v=tmhRTQ87REE&t=1s

postlund commented 3 years ago

I've only retrieved the local key as described at tuyapi, by signing up for a developer account. I don't use any app, only Home Assistant. So I'm not of much help here I'm afraid 😟

postlund commented 3 years ago

Anything more we can help with here or is the issue done?

quangvinh9x commented 3 years ago

Thank you very much. I removed switch from HASS, after i used local tuya to add it. it worked great. That amazing.

postlund commented 3 years ago

Great! 👍