xZetsubou / hass-localtuya

🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"
https://xzetsubou.github.io/hass-localtuya/
GNU General Public License v3.0
360 stars 37 forks source link

Listener exists for -102 #192

Closed rmxs closed 4 months ago

rmxs commented 4 months ago

LocalTuya Version

3.2.5.1

Home Assistant Version

2024.4.1

Environment

What happened?

After the yesterday HA update to the latest version the logs are spammed with the error

2024-04-05 22:51:04.876 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102

Steps to reproduce.

-

Relevant log output

2024-04-05 22:51:04.876 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:04.877 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:04.879 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:04.879 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:04.882 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:04.882 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:19.879 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:19.880 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:19.882 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:19.882 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:19.885 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:19.885 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:24.880 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:24.880 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:24.883 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:24.883 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:24.885 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:51:24.886 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:52:09.887 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:52:09.888 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:52:09.891 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:52:09.891 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:52:09.893 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102
2024-04-05 22:52:09.894 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102

Diagnostics information.

__

rmxs commented 4 months ago

Looks like after enable debuging that the error is after trying to connect to Child Device Thermometer and Humadity sensor bf58e15oqdu9xtr7

2024-04-05 23:09:05.080 DEBUG (MainThread) [custom_components.localtuya.common] [bf5...tr7] Trying to connect to Θερμόμετρο Κουζίνα... 2024-04-05 23:09:05.082 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102 2024-04-05 23:09:05.082 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102 2024-04-05 23:09:05.083 DEBUG (MainThread) [custom_components.localtuya.common] [bf6...nqe] Trying to connect to Θερμόμετρο Σαλόνι... 2024-04-05 23:09:05.084 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102 2024-04-05 23:09:05.085 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102 2024-04-05 23:09:05.087 DEBUG (MainThread) [custom_components.localtuya.common] [bff...i9d] Trying to connect to Θερμόμετρο Υπνοδωμάτιο... 2024-04-05 23:09:05.089 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102 2024-04-05 23:09:05.089 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...tr7] listener exists for -102

rmxs commented 4 months ago

Maybe i got it. Looks like the gateway got IP from my other non IoT subnet and when is on other subnet subdevices doesnt work. Some other devices got the same subnet IP are ok! I will move back the gateway and i will update the thread

xZetsubou commented 4 months ago

If you can modify the common file in config/custom_components/localtuya/common.py and add on the line 314 a condition so from:

self._interface.start_heartbeat()

to this:

if not self.is_subdevice:
    self._interface.start_heartbeat()

-102 is the heartbeat SEQNO it shouldn't run twice otherwise for some reason this will cause your errors. so to ensure that no sub_devices causing this can you edit the file as I explained above this.

rmxs commented 4 months ago

Move the gateway to the same subnet as the HA solve the double hertbeat.