xZetsubou/hass-localtuya

[Bug]: Zigbee Gateway randomly disconnection

Opened this issue · 4 comments

LocalTuya Version

2024.7.0

Home Assistant Version

2024.8.1

Environment

  • Does the device work using the Home Assistant Tuya Cloud component?
  • Is this device connected to another local integration, including Home Assistant and any other tools?
  • The devices are within the same HA subnet, and they get discovered automatically when I add them

What happened?

randomly disconnection of tuya zigbee gateway
only way to power off gateway and power on ...sometimes minutes after disconnect sometimes hours!

Steps to reproduce.

random full disconnection
Thank you!

Relevant log output

2024-08-12 09:56:03.029 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bf7...eng - Multi-mode Gateway] Trying to connect to: 192.168.1.12...
2024-08-12 09:56:03.120 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bf7...eng - Multi-mode Gateway] Retrieving initial state
2024-08-12 09:56:03.121 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] 3.4 or 3.5 device: negotiating a new session key
2024-08-12 09:56:03.122 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] final payload for cmd 3: b'0123456789abcdef'
2024-08-12 09:56:03.129 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Command 3 waiting for seq. number -102
2024-08-12 09:56:03.225 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Dispatching message CMD 4 TuyaMessage(seqno=62267, cmd=4, retcode=0, payload=b'\xe9\xac\xba\x8en?\x94\x99\xbf\xcc\xae\xbe\x88\x17Hp\xb49l<\xf7\x81&^\t:\xf4\x17\xbf\x97\x97\x94\xe9\xb3\x03n\xb5\xb0\x87\xdf\xf22\x91t\xf6 \x7f\xf53Rz\xcc@\\{\xb9\xc0\xb4\x90\x82\x99\xfa&\xb6', crc=b'\x9f\x15\x0c[\x94:_6\x11\xabd\xc1Y:\x00\x99\x14\xf8\xf3N\xf0\xc3Y\xcb\xe0\xbf\xa72\x01\xaa\r:', crc_good=True, prefix=21930, iv=None)
2024-08-12 09:56:03.226 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Got key negotiation response
2024-08-12 09:56:03.228 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] decrypted session key negotiation step 2: payload=b'225ac5b855c7a2ebqf\x1b\xee\xc3\x9f\x8ew\xec\x1f\x14$4+\xef\x89\xee\xa2\x04A\x9c\xbc!\xce\xd3\x90\x0f\xb1a\x8c\xbc0'
2024-08-12 09:56:03.229 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] final payload for cmd 5: b'\xcb\xf1y]\xff}\xec\xddU\x0c\xa1\x0f2\x96\x8b\xe2l\xda\xc5R\x19D\x8e\xb08\x99s0\xb0A\x8a\xc6'
2024-08-12 09:56:03.237 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Session key negotiate success! session key: b"\xa0\xc2\x85'x7\xf2\x95\x02\x86Zx\x8c\xa9E\xfd"
2024-08-12 09:56:03.237 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Sending command 10 (device type: v3.4) DPS: None
2024-08-12 09:56:03.238 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Sending payload: b'{"gwId":"bf7dbc9e0c9b952285geng","devId":"bf7dbc9e0c9b952285geng","uid":"bf7dbc9e0c9b952285geng","t":"1723449363"}'
2024-08-12 09:56:03.239 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] final payload for cmd 16: b'{"gwId":"bf7dbc9e0c9b952285geng","devId":"bf7dbc9e0c9b952285geng","uid":"bf7dbc9e0c9b952285geng","t":"1723449363"}'
2024-08-12 09:56:03.240 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Command 16 waiting for seq. number 62268
2024-08-12 09:56:03.241 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Connection lost: [Errno 104] Connection reset by peer
2024-08-12 09:56:03.241 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf7...eng - Multi-mode Gateway] Cleaning up session.

Diagnostics information.

localtuya-c898cc42dd44edec5ad2c7cf6cad74f0-Multi-mode Gateway-4ba3b2568914cdae37dda95921d7b9e5.json

only way to power off gateway and power on

Does the device stays dc'd for long time or it just re-connecting? I noticed that this happens for 3.4 devices

disconnected for long time only ...until power off!

If the rospogrigio repository is updated by some update and part of localtuya does not work, go to hacs / local Tuya de xZetsubou / Redownload (... top right) / Reset HA. solved

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.