rospogrigio / localtuya

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

Adding second plug fails (Teckin SP10) #260

Closed nvonbenken closed 3 years ago

nvonbenken commented 3 years ago

Hi, I recently got a two pack of the SP10 plugs and have them all set up and working with the Tuya app. I was able to add one of the plugs to home assistant last night, but when trying to add the second today I'm having trouble. The integration sees the device on my network and pulls the IP and device ID successfully. After I add the device key from retrieved from the tuya cli it fails to complete.

I have the following error in the log:

Traceback (most recent call last):
  File "/config/custom_components/localtuya/common.py", line 146, in _make_connection
    self._interface = await pytuya.connect(
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 626, in connect
    _, protocol = await loop.create_connection(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 496, in sock_connect
    return await fut
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 528, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.1.29', 6668)

Let me know if there is any other information I can provide to help resolve this. Thanks.

postlund commented 3 years ago

It would be great if you could try with the version from master. Also make sure that you kill the Tuya app as that can cause problems.

nvonbenken commented 3 years ago

I'm using the latest available release on HACS, v3.1.0. Is there any reason the changes on master haven't been tagged as a release for users to upgrade to?

I'll try again making sure the app is closed. If that doesn't work I'll try using master instead of going through HACS, though HACS is the preferable approach.

Scratch that, seems I can use master master through HACS.

postlund commented 3 years ago

Did it work?

nvonbenken commented 3 years ago

Yep, master worked just fine. All up and running with both plugs now.

postlund commented 3 years ago

Great, thanks!