Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log error: Connect to 192.168.X.XX failed #928

Open
besiktas97 opened this issue Jul 1, 2022 · 13 comments
Open

log error: Connect to 192.168.X.XX failed #928

besiktas97 opened this issue Jul 1, 2022 · 13 comments
Labels
bug Something isn't working

Comments

@besiktas97
Copy link

The problem

I am getting lately Error logs from LocalTuya like below:

Logger: custom_components.localtuya.common
Source: custom_components/localtuya/pytuya/init.py:669
Integration: LocalTuya (documentation, issues)
First occurred: July 1, 2022 at 21:38:48 (270 occurrences)
Last logged: 01:19:49

[bf7...faq] Connect to 192.168.2.19 failed
[416...b61] Connect to 192.168.2.6 failed
[bf5...hpt] Connect to 192.168.2.31 failed

Within the Tuya app the devices are all available and I can use them in the Tuya app like I also can use them through Home Assistant.

Environment

  • Localtuya version: V4.0.1
  • Last working localtuya version (if known and relevant): Last working version, cant remember this actually.
  • Home Assistant Core version: core-2022.6.7
  • [] Are you using the Home Assistant Tuya Cloud component ?
  • [] Are you using the Tuya App in parallel ?

Steps to reproduce

Configuration configuration.yaml or config_flow

DP dump

Provide Home Assistant taceback/logs

Traceback (most recent call last):
  File "/config/custom_components/localtuya/common.py", line 160, in _make_connection
    self._interface = await pytuya.connect(
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 669, in connect
    _, protocol = await loop.create_connection(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1065, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1050, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 961, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 499, in sock_connect
    return await fut
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 534, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.2.19', 6668)

Additional information

@besiktas97 besiktas97 added the bug Something isn't working label Jul 1, 2022
@Axydas
Copy link

Axydas commented Jul 2, 2022

I have the samenissue for all devices

Same log

@andregoncalvespires
Copy link

I have the same issue. It always happens when the router is restarted

@happyme531
Copy link

Same issue +1

@jasonwragg
Copy link

Same issue but not on all devices, some devices are the same model, one works and another doesn't.

@jasonwragg
Copy link

Seems if I power cycle the device it connects again.

@besiktas97
Copy link
Author

Yeah thats true. The devices arent going offline so I still can use them. Its only that the logs are getting more and all the same...

@besiktas97
Copy link
Author

I have also just updated to HA 2022.7.1 and got the following warning message:

Logger: homeassistant.components.number
Source: components/number/init.py:220
Integration: Number (documentation, issues)
First occurred: 10:54:08 (1 occurrences)
Last logged: 10:54:08

custom_components.localtuya.number::LocaltuyaNumber is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom component author.

@pickerin
Copy link

I have also just updated to HA 2022.7.1 and got the following warning message:

Logger: homeassistant.components.number Source: components/number/init.py:220 Integration: Number (documentation, issues) First occurred: 10:54:08 (1 occurrences) Last logged: 10:54:08

custom_components.localtuya.number::LocaltuyaNumber is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom component author.

This issue has been reported over here:
#929

@pickerin
Copy link

@besiktas97 I just confirmed that 100% of my errors are for IP addresses of devices that are NOT plugged in.
I have a number of holiday switches and they're in a box. However, they're all configured in HA and Tuya Cloud.

So, this appears to be the Local Tuya behavior if a device is Unavailable? That would explain why some folks can power cycle the device and it comes back. So if it's unavailable for any reason, Local Tuya is not catching that error properly.

@pickerin
Copy link

Before the mandated Tuya Cloud API pulling in 4.0, I had the ability to disable devices. Now the only option appears to be to delete the device entirely, which I don't want to do, since I'll be using all of these switches for automations starting in October. Any thoughts on how we can temporarily disable the devices so LocalTuya isn't checking them (and hence not throwing this error because the device is unavailable)?

@besiktas97
Copy link
Author

@besiktas97 I just confirmed that 100% of my errors are for IP addresses of devices that are NOT plugged in.

I have a number of holiday switches and they're in a box. However, they're all configured in HA and Tuya Cloud.

So, this appears to be the Local Tuya behavior if a device is Unavailable? That would explain why some folks can power cycle the device and it comes back. So if it's unavailable for any reason, Local Tuya is not catching that error properly.

I didnt do a test on the way you have your environment. I only have bulbs of tuya that I am controlling with local tuya. For now since today looks like everything is working well, except for one bulb. I also red somewhere else that someone has deleted the device(s) from the cloud added again with a new key for local toya. Gonna try this tonight and gonna look at it if its gonna fix it. The error you mentioned before, I am also getting exact the same error.

@ruikenshin
Copy link

I have this issue, only thing is that I see the same logged lines only during the overnight hours other than that I see nothing else, which result in the light being turned one once they reconnect after being unavailable.
Power Cycled the host for HA just in case something was causing disconnects over night.
Rolled back HA core to 7.7 and Local Tuya to 4.0 to see if behavior continues. I'll have to wait until the over night hours to confirm functionality.

@besiktas97
Copy link
Author

Its maybe not related to this issue, but also getting warning in my log:

Logger: homeassistant.components.number
Source: components/number/init.py:231
Integration: Number (documentation, issues)
First occurred: 15:51:33 (1 occurrences)
Last logged: 15:51:33

custom_components.localtuya.number::LocaltuyaNumber is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom integration author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants