rospogrigio / localtuya

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

Can’t add door sensor #1463

Open Phipps78 opened 1 year ago

Phipps78 commented 1 year ago

The problem

I am failing to add a new door sensor to Tuya integration. Door sensor was successfully added to Smart Life. When I try to add the device in the Local Tuya Integration, it shows up but I cannot add it. I receive an unknow error message.

My logs show the following entry:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.localtuya.config_flow Source: custom_components/localtuya/pytuya/init.py:1182 Integration: LocalTuya integration (documentation, issues) First occurred: 16:34:39 (5 occurrences) Last logged: 16:46:59

Unexpected exception: [Errno 113] Connect call failed ('192.168.178.115', 6668) Traceback (most recent call last): File "/config/custom_components/localtuya/config_flow.py", line 595, in async_step_configure_device self.dps_strings = await validate_input(self.hass, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/config_flow.py", line 242, in validate_input interface = await pytuya.connect( ^^^^^^^^^^^^^^^^^^^^^ File "/config/customcomponents/localtuya/pytuya/init.py", line 1182, in connect , protocol = await loop.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection raise exceptions[0] File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect return await fut ^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 674, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 113] Connect call failed ('192.168.178.115', 6668)

Does anyone know a solution for this?

regards Philipp

Environment

Steps to reproduce

1.

DP dump

Provide Home Assistant traceback/logs

put your log output between these markers

Additional information

evolucja commented 1 year ago

Hi, please ensure the sensor is online while you're trying to add it. I managed by pining sensor IP, then adding for several times. Eventually it clicked.

It doesn't detect the proper state but it's a different bug though...