rospogrigio / localtuya

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

Local-tuya unable to connect to sensor-devices #1415

Open darknessblade opened 1 year ago

darknessblade commented 1 year ago

--> I have the following sensors aliexpress.com/item/1005005234497671.html? aliexpress.com/item/1005005352146142.html? aliexpress.com/item/1005005234605015.html? I bought these during the 3=5.99$ discount the sensors are detected by Local-tuya, and load in the correct details trough the cloud-API

But when I try to link it to Local-tuya, I get a error.

-->

Environment

Steps to reproduce

  1. open local tuya
  2. try to pair device

LOGS:

First occurred: 5:56:19 PM (2 occurrences) Last logged: 5:56:58 PM

Unexpected exception: [Errno 113] Connect call failed ('IP) Unexpected exception: [Errno 113] Connect call failed ('IP) 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 1183, in connect , protocol = await loop.create_connection( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1076, in create_connection raise exceptions[0] File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1060, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 969, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 501, in sock_connect return await fut File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 541, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 113] Connect call failed ('IP)

si458 commented 1 year ago

aliexpress.com/item/1005005234497671.html is a bluetooth sensor, not a wifi sensor so you wont find it on the network

aliexpress.com/item/1005005352146142.html these are indeed wifi sensors but they have no internal API which can be accessed, they are PUSH only devices, so they push data every time it gets trigged open or closed or a battery difference

aliexpress.com/item/1005005234605015.html same as one above, these are indeed wifi sensors but they are like my mini one i got from aliexpress but it has a screen, they have no internal API which can be accessed, they are PUSH only devices, so they push data to tuya cloud every 0.5 degree difference, i have to use the actually tuya integration to get the temperature data

darknessblade commented 1 year ago

Thank you for the information.

Its quite a shame that there is a need to access the cloud to use said devices, otherwise they would be a amazing solution to have running locally.

si458 commented 1 year ago

@darknessblade i agree, it would be amazing if the devices had local access! but i also agree if local access was granted, you would drain there batteries very quickly! so i suppose every 0.5degree or a trip of the sensor, just pushing data to tuya is a good idea for now

kenhoppla commented 1 year ago

aliexpress.com/item/1005005234497671.html is a bluetooth sensor, not a wifi sensor so you wont find it on the network

aliexpress.com/item/1005005352146142.html these are indeed wifi sensors but they have no internal API which can be accessed, they are PUSH only devices, so they push data every time it gets trigged open or closed or a battery difference

aliexpress.com/item/1005005234605015.html same as one above, these are indeed wifi sensors but they are like my mini one i got from aliexpress but it has a screen, they have no internal API which can be accessed, they are PUSH only devices, so they push data to tuya cloud every 0.5 degree difference, i have to use the actually tuya integration to get the temperature data

I have the same Wi-Fi sensors. They used to work perfectly with LocalTuya. However, one month ago, they stopped functioning and started displaying the same error.

si458 commented 1 year ago

I have the same Wi-Fi sensors. They used to work perfectly with LocalTuya. However, one month ago, they stopped functioning and started displaying the same error.

It might be they did an auto update on the firmware maybe?

kenhoppla commented 1 year ago

I have the same Wi-Fi sensors. They used to work perfectly with LocalTuya. However, one month ago, they stopped functioning and started displaying the same error.

It might be they did an auto update on the firmware maybe?

Yes, it is possible. I observed that they transitioned from sending/receiving packages to sending only when certain statistics are changing.

Edit: It is possible that when they are going offline, they are not responding to requests from LocalTuya.

TracyP commented 11 months ago

I'm getting same errors with smoke detector. Other devices i.e. smart plugs are working fine. I can add and delete those no problems. I can see smoke detector being registered in the cloud, and get's a localkey etc, but can't discover in HA due to these errors.

darknessblade commented 11 months ago

No longer using Tuya/wifi devices, topic can be locked