jnimmo / hass-intesishome

Experimental fork of the IntesisHome integration for Home Assistant
19 stars 11 forks source link

Drop connection roughly every 2 hours. #1

Open Jimmypl007 opened 2 years ago

Jimmypl007 commented 2 years ago

Hey, after following your instructions and setting the aircon up with this git through hacs, my parent's aircon seemed to work just fine and is definitely a whole lot more useful. The problem is now it seems to drop out every 2 hours. amazingly my parents seem to time the "turn on" and "off "of their aircon inside the disconnected times and as far as they see, "it's not worth even using". I won't give up so quickly. Anyway, while it is an inconvenience at times it's not the biggest problem in the world but as it is obviously not intended I'll post what I can to help solve it if possible.

this is an image of the log history log I'm pretty sure the temperature sensor is way out, but at least it can be used to guess when it lost connection.

and this is the full log (there might be nonrelated stuff but I tried removing it) it doesn't seem too happy about the integration.

2022-09-07 07:18:12.325 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/intesishome/climate.py", line 436, in try_connect await self._controller.connect() AttributeError: 'NoneType' object has no attribute 'connect' 2022-09-07 07:33:11.567 ERROR (MainThread) [frontend.js.latest.202208020] :0:0 Script error. 2022-09-07 09:38:23.032 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-07 09:42:05.492 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 12:05:17.624 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-07 12:06:48.202 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 14:30:05.240 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-07 14:31:32.519 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 16:53:18.648 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-07 16:53:20.657 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 16:54:35.795 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 19:16:36.152 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-07 19:17:08.170 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:38:52.216 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-07 21:39:09.561 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:40:19.017 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:40:50.911 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:41:55.454 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:42:22.404 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-07 21:42:22.411 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:42:47.607 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-07 21:42:47.611 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:43:09.565 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-07 21:43:09.569 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:44:19.022 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-07 21:44:19.026 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:44:50.917 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-07 21:44:50.921 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:45:55.458 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-07 21:45:55.462 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:46:22.416 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-07 21:46:22.420 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-07 21:46:47.616 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pyintesishome/intesishome.py", line 74, in _send_keepalive device_id = str(next(iter(self._devices))) StopIteration The above exception was the direct cause of the following exception: RuntimeError: coroutine raised StopIteration 2022-09-08 00:07:57.880 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-08 00:09:02.514 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 00:09:34.735 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 00:10:39.473 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 00:11:05.882 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 00:11:43.552 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 00:11:43.556 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 00:11:58.545 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 00:11:58.549 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 00:13:02.521 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 00:13:02.528 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 00:13:34.741 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 00:13:34.745 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 02:35:43.672 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-08 02:35:49.367 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 02:36:23.293 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 04:57:18.776 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-08 04:57:24.281 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 04:57:24.285 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 04:58:29.833 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 04:59:00.632 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 04:59:21.810 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 04:59:21.814 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 05:00:08.768 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 05:00:08.775 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 05:00:32.780 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 05:00:32.784 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 05:01:09.365 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 05:01:09.372 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 05:01:24.286 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 05:01:24.290 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 05:01:24.294 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 05:01:24.297 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 07:22:30.968 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-08 07:23:17.019 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 07:23:47.945 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 07:24:09.013 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 09:45:42.328 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-08 09:46:00.485 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 09:46:33.964 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 09:46:55.125 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 09:46:55.129 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 09:47:04.461 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 09:47:04.466 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:09:03.928 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-08 12:09:12.961 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:09:31.394 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:10:16.418 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:10:26.908 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:10:44.541 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:10:44.546 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:11:16.926 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:11:16.930 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:11:38.224 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:11:38.229 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:11:38.233 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:11:38.236 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:11:48.592 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:11:48.597 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:12:47.742 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:12:47.746 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:12:49.436 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:12:49.440 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:13:12.968 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:13:12.972 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:13:31.400 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:13:31.404 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:14:16.425 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:14:16.429 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:14:26.914 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:14:26.918 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:14:44.551 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:14:44.555 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:15:16.936 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:15:16.940 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:15:38.234 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:15:38.238 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:15:38.242 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 12:15:38.245 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 12:15:48.600 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pyintesishome/intesishome.py", line 74, in _send_keepalive device_id = str(next(iter(self._devices))) StopIteration The above exception was the direct cause of the following exception: RuntimeError: coroutine raised StopIteration 2022-09-08 14:36:45.624 ERROR (MainThread) [pyintesishome] pyIntesisHome lost connection to the IntesisHome server. Exception: [Errno 110] Operation timed out 2022-09-08 14:37:30.488 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:37:30.492 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:37:56.811 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:38:15.273 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:39:00.231 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 14:39:00.235 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:39:10.880 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 14:39:10.883 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:39:26.846 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 14:39:26.850 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:40:00.803 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 14:40:00.807 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:40:30.528 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 14:40:30.534 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:40:30.538 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 14:40:30.541 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:40:40.732 WARNING (MainThread) [asyncio] socket.send() raised exception. 2022-09-08 14:40:40.736 ERROR (MainThread) [pyintesishome] <class 'TimeoutError'> Exception. (110, 'Operation timed out') / [Errno 110] Operation timed out 2022-09-08 14:41:30.493 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pyintesishome/intesishome.py", line 74, in _send_keepalive device_id = str(next(iter(self._devices))) StopIteration The above exception was the direct cause of the following exception: RuntimeError: coroutine raised StopIteration 2022-09-08 14:41:30.496 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pyintesishome/intesishome.py", line 74, in _send_keepalive device_id = str(next(iter(self._devices))) StopIteration The above exception was the direct cause of the following exception: RuntimeError: coroutine raised StopIteration

jnimmo commented 2 years ago

Thanks for the report - so you're saying it was more reliable back on 1.0.1 or something rather than 1.0.4? 1.0.3 added sending a keepalive to try and keep the TCP socket open all the time, but it looks like sending the keepalive might be causing some problems of it's own.

Can you please enable debug logging then search for lines containing pyIntesishome; Also, have you tried to see if their device supports Intesishome_local?

Jimmypl007 commented 2 years ago

I'm pretty sure the connection drops existed on 1.0.1 as the graph looked similar to the one above, however, I can't say I checked the log, as at the time I assumed/hoped it was Alexa voice control that was playing up, as it only failed once and then worked again later. then I noticed you had updated the git and I installed it, so I didn't really have more than a day of use of 1.0.1

I will do what you asked to check and get back to you once I figure out how to enable debug logging ;P EDIT: will also try the local thing as soon as I can, it's at my parents and I will have to get access to the router to see the IP.

Jimmypl007 commented 2 years ago

Alright I have just added **logger: default: critical logs:

log level for a custom component

custom_components.intesishome: debug**

to my config file, I 'think' this is debug logging. we will see how that goes.

As for the local part, to start with I will state that our device is "TO-RC-WIFI-1" but above that on another sticker, it says Type: xx-RC2-WIFI-1x i noticed it wasn't specifically in the list you had. I did try adding the device as an "Intesishomelocal" and when I entered the IP address (which I confirmed using the mac address), it came up with "an unknown error occured"_ and this log (pasted below)

This error originated from a custom integration.

Logger: custom_components.intesishome.config_flow Source: custom_components/intesishome/config_flow.py:128 Integration: IntesisHome First occurred: 4:09:08 PM (1 occurrences) Last logged: 4:09:08 PM

Unexpected exception Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection raise exceptions[0] File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect return await fut File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 535, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.1.9', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/intesishome/config_flow.py", line 128, in async_step_details await controller.poll_status() File "/usr/local/lib/python3.10/site-packages/pyintesishome/intesishomelocal.py", line 171, in poll_status await self._authenticate() File "/usr/local/lib/python3.10/site-packages/pyintesishome/intesishomelocal.py", line 78, in _authenticate response = await self._request( File "/usr/local/lib/python3.10/site-packages/pyintesishome/intesishomelocal.py", line 90, in _request async with self._web_session.post( File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.9:80 ssl:default [Connect call failed ('192.168.1.9', 80)]

Now, I don't know how this all works but i can see that its trying to use port 80, In Australia some ISP's block specific incoming ports, and 80 is one of them, however, I use Cloudflare to connect to my home assistant from outside the house and so in an attempt to bypass that issue I added another host in the cloudflared addon im using and called it "intesishome.mydomain.casa" and pointed it at "http://192.168.1.9:80" I then used the new address in the intesishomelocal setup it came up with "An error occurred connecting to the IntesisHome API."_ but this time no log.

I don't know if due to the nature of your addon or the process of making it local, it was never going to work, but I figured I would give it a shot. Again, thanks for your time.

jnimmo commented 2 years ago

I'll have a think on the local one there, but if you throw in a debug for the following would be great too (even just for one disconnection) logger: logs: pyintesishome: debug

Jimmypl007 commented 2 years ago

I'll have a think on the local one there, but if you throw in a debug for the following would be great too (even just for one disconnection) logger: logs: pyintesishome: debug

I have added it and I will get back to you as soon as I get a disconnect.

jnimmo commented 2 years ago

Thanks for that (I've removed the raw log just because it contains device IDs even though there isn't anything sensitive in there). It looks like it still is trying to send the keep alive after a connection drop which I need to fix. I'll also look at shortening the length of time to wait for a first reconnection attempt, i.e. 30 seconds rather than 300 in this case.

Jimmypl007 commented 2 years ago

Thanks, let me know if i can add anything else.

jamhos commented 2 years ago

Not sure if it's helpful, but I've had debug logging turned on for the last few days just to check, without any drops in connection. I had 1.0.2 running up until yesterday, upgraded to 1.0.4, and still haven't had any issues since.

My device is IS-ACX-WIFI-BT-1 (unfortunately also doesn't support local connection) via IntesisHome (I think @Jimmypl007 is Anywair or Airconwithme?) - perhaps there's something different with those cloud servers.

Jimmypl007 commented 2 years ago

Not certain about anywair or airconwithme but I use intesisHome in this add-on to set up the device... maybe I'm using the wrong one??? the device in the roof just says intesis (the wifi device)

jamhos commented 2 years ago

Nah you're all good, that's definitely Intesis and you're using the correct one. I just noticed you'd commented on https://github.com/jnimmo/pyIntesisHome/issues/43 which was related to the Airconwithme integration.

Jimmypl007 commented 2 years ago

Ahh yeah okay.

Jimmypl007 commented 2 years ago

I have asked my dad to try using the app if he catches it during a dropout.. to see if the device itself is faulting..

jnimmo commented 2 years ago

It seems like there's a connectivity issue between Home Assistant and the Intesis servers based on your logs - so part of the solution may be seeing if that can be addressed, but equally making sure the reconnection happens a bit more seamlessly should go a long way too (as we can expect connection issues to happen on the internet)

jnimmo commented 2 years ago

Hey @Jimmypl007, if this is still an issue, you could try editing line 426 https://github.com/jnimmo/hass-intesishome/blob/master/custom_components/intesishome/climate.py#L426 to reduce the time for automatic reconnect, 10 minutes is pretty high. In a future release I'll probably drop this down to between 10 and 120 seconds or something; and double check that if trying to send a command it will try and immediately reconnect rather than waiting. Additionally, is the Home Assistant device connecting on wifi or ethernet? Definitely worth trying to get it onto a wired connection if on wifi.

Jimmypl007 commented 2 years ago

Yeah, it still is disconnecting. I updated about a week ago when I noticed your last update (thanks for that), So far it has reduced the errors from thousands a week to only a couple hundred or so, but I guess that is because it no longer checks-(something) when it had lost connection.

Right before I updated I had noticed that after a week or so of running without a restart of HA the aircon would eventually give up trying to re-connect (my parents won't even tell me when it's not working anymore.. :P), I don't know if that is still an issue after this update but I will let you know if that occurs again.

I will try what you suggested with shortening the connection attempt time, I'm not sure how it all works BUT I noticed the log states that the aircon is only "unavailable" 1 to 10 minutes from when it reconnects (which lines up with the code you linked above), whereas if you look at the graph you can see the temperature stops updating for a about 30 or so minutes before it realises it's no longer connected. link to what I'm talking about. (NOTE: the steps between each temperature update on the graph were about 4 to 5 minutes apart. so i guess it should have updated around 10:51 am the end of the line is exactly when it becomes unavailable which I circled in red)

It seems to me that the program doesn't know that it has lost connection for a decent amount of time before it updates as "unavailable" obviously that means it only will try re-connect after it realises it dropped out, but that means it could be up to a 30 minutes wait (based on the graph). obviously reducing the time for connection attempts after it knows it has disconnected will help reduce overall dropout time but it would be great if it figured it has lost connection faster. I guess though that's what those repeated checks were supposed to do?

Lastly, my pi is connected via ethernet to the router, and the device for the aircon is wirelessly connected (no ethernet option on that). I will check to make sure I don't have any power cables too close to the ethernet when I am back there, but I figure that if that was the issue it would appear in other ways with my HA.

Thanks, Heaps for you all the work you do, and your help with this. Edit: bought ya some coffee for your trouble' thanks again for your time so far even if this is just something faulty on my side..

Jimmypl007 commented 1 year ago

This is just an update comment, to let you know I did respond to the question, also if you need a new link to the image above (the link is now dead) then let me know.