rospogrigio / localtuya

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

Device status update back to Home Assitant #158

Closed Fannangir closed 3 years ago

Fannangir commented 3 years ago

Hi,

Maybe a question more than a bug as this is how the integration works. The operation of control from Home Assistant is instant, switch acts immediately. But when I turn on or off the switch, HA updates after a minute or two. Is that normal behavior?

Thanks.

postlund commented 3 years ago

Which version are your sing? From 3.0.0 you should get push updates.

Fannangir commented 3 years ago

OK, I have found the issue. I have disabled tuya_custom and enabled localtuya in the same session of server restart, so it made a mess. Deleted all, re-enabled localtuya config, so the update is instant. I have noticed the following error in the log file occured twice.

Logger: custom_components.localtuya.common Source: custom_components/localtuya/pytuya/init.py:206 Integration: LocalTuya (documentation, issues) First occurred: 8:31:03 PM (1 occurrences) Last logged: 8:31:03 PM

Connect to 192.168.1.28 failed Traceback (most recent call last): File "/config/custom_components/localtuya/common.py", line 151, in _make_connection status = await self._interface.status() File "/config/custom_components/localtuya/pytuya/init.py", line 428, in status status = await self.exchange(STATUS) File "/config/custom_components/localtuya/pytuya/init.py", line 407, in exchange msg = await self.dispatcher.wait_for(seqno) File "/config/custom_components/localtuya/pytuya/init.py", line 206, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/local/lib/python3.8/asyncio/tasks.py", line 498, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError

What could be the case?

Thanks.

postlund commented 3 years ago

I can't tell much from that alone, full debug logs might help. Instructions for enabling them are here:

https://github.com/rospogrigio/localtuya#debugging

Fannangir commented 3 years ago

For some reason, I don't see the message anymore. Thank you very much for your help. If there is something in the future, I will open an issue.

Thanks.