HA unresponsive after X amount of time

Hi,

I’m trying to get into HA, but I’m having loads of random issues. HA will stop responding to website requests after X amount of time, yet the app seems to be working and logging sensor information.

The only error I get is this:
16-10-25 18:22:00 homeassistant.components.recorder: Ended unfinished session (id=19 from 2016-10-25 14:45:29.697658)
16-10-25 18:22:00 homeassistant.components.recorder: Found unfinished sessions
16-10-25 18:22:29 homeassistant.components.media_player.squeezebox: Could not communicate with 10.0.1.16:9090: [WinError 10061] No connection could be made because the target machine actively refused it
16-10-25 18:22:29 homeassistant.components.media_player: Error while setting up platform squeezebox
Traceback (most recent call last):
File “C:\tools\python3\lib\site-packages\homeassistant\helpers\entity_component.py”, line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “C:\tools\python3\lib\asyncio\futures.py”, line 361, in iter
yield self # This tells Task to wait for completion.
File “C:\tools\python3\lib\asyncio\tasks.py”, line 296, in _wakeup
future.result()
File “C:\tools\python3\lib\asyncio\futures.py”, line 274, in result
raise self._exception
File “C:\tools\python3\lib\concurrent\futures\thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “C:\tools\python3\lib\site-packages\homeassistant\components\media_player\squeezebox.py”, line 72, in setup_platform
lms = LogitechMediaServer(host, port, username, password)
File “C:\tools\python3\lib\site-packages\homeassistant\components\media_player\squeezebox.py”, line 91, in init
self.http_port = self._get_http_port()
File “C:\tools\python3\lib\site-packages\homeassistant\components\media_player\squeezebox.py”, line 96, in _get_http_port
http_port = self.query(‘pref’, ‘httpport’, ‘?’)
File “C:\tools\python3\lib\site-packages\homeassistant\components\media_player\squeezebox.py”, line 114, in query
response = urllib.parse.unquote(self.get(’ '.join(parameters)))
File “C:\tools\python3\lib\urllib\parse.py”, line 537, in unquote
if ‘%’ not in string:
TypeError: argument of type ‘NoneType’ is not iterable
16-10-25 18:31:40 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-10-25 18:37:10 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-10-25 18:43:40 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-10-25 19:24:10 homeassistant.core: Error inside async loop: Task exception was never retrieved

The squeezebox is being autodetected by the discovery stuff, but it’s using the wrong port which is why it errors (I use a different port) - I’ve added squeezebox manually and it works, but the discovery still attempts to connect to it too.

I’m a bit concerned, I really like HA, but I’ve hardly done anything with it so far (no rules or anything), yet it seems to get into this weird state after a while.

Any ideas?

You may find the scripts at the bottom of this issue helpful in managing this problem…

https://github.com/home-assistant/home-assistant/issues/4162#issuecomment-257922987