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
366 stars 41 forks source link

[Bug]: Temp&Hum Sensor shows Err113 Connect call failed #281

Closed VincentDePincent closed 2 months ago

VincentDePincent commented 2 months ago

LocalTuya Version

2024.6.0

Home Assistant Version

Core 2024.4.4

Environment

What happened?

I keep having an issue with my temp&hum sensor, and also a contact sensor as well. I had a hard time getting them to connect to HA, but eventually got them connected. Sadly, they disconnect quite often, showing the status as unavailable until there is a state change. The contact sensor updates instantly when opened or closed, but show unavailable after about 15 seconds. I've tried setting scan frequency but it didn't help

Steps to reproduce.

Add device to HA Configure (I did it manually, but automatically worked as well) Wait a minute.

Relevant log output

Logger: custom_components.localtuya.coordinator
Source: custom_components/localtuya/core/pytuya/__init__.py:298
integration: LocalTuya (documentation, issues)
First occurred: 2:19:52 PM (96 occurrences)
Last logged: 3:53:55 PM

[bfd...mr3 - Contact Sensor] Failed to connect to 192.168.2.10: The host refused to connect
[bfd...mr3 - Contact Sensor] Failed to connect to 192.168.2.10: [Errno 113] Connect call failed ('192.168.2.10', 6668)
[bfd...uls - Temperature & Humidity Sensor] Failed to connect to 192.168.2.31: The host refused to connect
[bfd...uls - Temperature & Humidity Sensor] Failed to connect to 192.168.2.31: [Errno 113] Connect call failed ('192.168.2.31', 6668)
[bfd...uls - Temperature & Humidity Sensor] Failed to connect to 192.168.2.31:

Diagnostics information.

localtuya-70624a0d0562f7157793a0d52b30686c-Temperature & Humidity Sensor-48f8b799cda3e903da5979b73ac781b7.json

VincentDePincent commented 2 months ago

home-assistant_localtuya_2024-06-17T15-14-06.960Z.log Added the debug log. Opened the door and clicked the button on the temp sensor to make sure it shows the disconnection process.

xZetsubou commented 2 months ago

This is probably a Low-Power device you will need to specify sleep time and insert 0 in manual DPS the period time 'Low-Power Devices'

VincentDePincent commented 2 months ago

Great! I added 0 to the DPS and it worked for a while, but I just woke up and they show unavailable again. In the "Low Power devices" page there are a few links to use, but they send me to a 404 page. I sadly have no clue how to specify sleep time and a quick search hasn't helped me. If you could help me out here, i would be grateful.

xZetsubou commented 2 months ago

Sleep time field is under the Manual DPS You can set for example 86400 which means it will wait 1 day before device considered as offline. also this is the guide of low-power device https://xzetsubou.github.io/hass-localtuya/faq/#low-power-devices

Sleep time

![image](https://github.com/xZetsubou/hass-localtuya/assets/46300268/0d748237-97ef-4662-9cdb-a7b591432ff4)

VincentDePincent commented 2 months ago

This worked for me. Thanks, will close the issue.