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
403 stars 48 forks source link

error adding device, device detected but no data points found #188

Closed egore261282 closed 6 months ago

egore261282 commented 7 months ago

The electricity meter, which previously worked successfully, stopped working, all entities became inaccessible. I deleted the device and tried to add it again, the integration will install the device on the local network and automatically detect the ID and Local Key, but when adding it gives an error: Connection to device succeeded but no datapoints could be found. Please try set-up again. If problem persists, create a new issue (including debug logs). Logs: Эта ошибка возникла в пользовательской интеграции.

Регистратор: custom_components.localtuya.core.pytuya Источник: custom_components/localtuya/core/pytuya/init.py:1105 интеграция: Local Tuya (документация, проблемы) Первое сообщение: 23 марта 2024 г. в 10:35:35 (36 сообщений) Последнее сообщение: 02:10:46

[bf3...a3r] Failed to get status: [bfc...iwp] Failed to get status: Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/locks.py", line 386, in acquire await fut asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/localtuya/core/pytuya/init.py", line 1105, in detect_available_dps data = await self.status(cid=cid) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 1024, in status status: dict = await self.exchange(command=DP_QUERY, nodeID=cid) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 998, in exchange msg = await self.dispatcher.wait_for(seqno, payload.cmd) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 609, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit raise TimeoutError from exc_val TimeoutError IMG_8942

xZetsubou commented 7 months ago

It could be a low-power device, a device that goes into sleep and reports the value every x time. or if values changed. IF YES Try to specify device sleep time 900 and put 0 in manual dps then it probably will be unavailable until the device wake up.

Or try to connect to the device when it's up.

egore261282 commented 7 months ago

Это может быть устройство с низким энергием,a device that goes into sleep and reports the value every x time. or if values changed.ЕСЛИ ДАПопробуйте указать время сна устройства 900 и поставьте 0 в ручную dps, тогда он, вероятно, будет недоступен до тех пор, пока устройство не проснется.

Или попробуйте подключиться к устройству, когда оно будет включено.

no, this is an energy meter with constant power and data transmission, it does not have a sleep mode or saving mode. and previously it was added without problems in the old version of local tuya

xZetsubou commented 7 months ago

Which version was it working on? did you make sure before adding the device that your device isn't added in another local integration and the "Tuya APP or Smart Life APP" is closed?

egore261282 commented 7 months ago

Над какой версией он работал? вы убедились перед добавлением устройства, что ваше устройство не добавлено в другую локальную интеграцию, и "Tuya APP или Smart Life APP" закрыто?

Which version was it working on? did you make sure before adding the device that your device isn't added in another local integration and the "Tuya APP or Smart Life APP" is closed?

I have no other integrations into NA, and the Tuya Smart application is closed on my smartphone. but it’s strange that the other device in my account is working fine

xZetsubou commented 7 months ago

Can you test the connection on your device. or use telnet if you don't use powershell.

Win+R Paste this and modify the IP to your device.

powershell -NoExit -command "Test-NetConnection 192.168.1.103 -port 6668"

note: You can trick the handshake method by adding "0" in the manual dps then connect but not sure if the device later will communicate with localtuya correctly.

montselec commented 7 months ago

i solved, dps 0 and sleep time 900 very thanks!

xZetsubou commented 6 months ago

Not sure if you solved this however if the device is reachable https://github.com/xZetsubou/hass-localtuya/issues/188#issuecomment-2024546308 and refuse to connect feel free to comment or re-open the issue.

egore261282 commented 6 months ago

Not sure if you solved this however if the device is reachable #188 (comment) and refuse to connect feel free to comment or re-open the issue.

yes, I solved the problem! needed to update the integration