home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.17k stars 29.85k forks source link

0.38 Squeezebox Error connect error #5953

Closed stuartlea closed 7 years ago

stuartlea commented 7 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.38.2

Python release (python3 --version): Python 3.4.3

Component/platform: Media Player/Squeezebox

Description of problem:Following upgrading to 38.2 I have an error in the log and squeezebox component fails to start. Error log as follows: 17-02-13 16:09:03 ERROR (MainThread) [homeassistant.components.media_player.squeezebox] Failed communicating with LMS: <class 'aiohttp.errors.ClientResponseError'> 17-02-13 16:09:03 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform squeezebox Traceback (most recent call last): File "/home/stu/.homeassistant/deps/aiohttp/client.py", line 220, in _request yield from resp.start(conn, read_until_eof) File "/home/stu/.homeassistant/deps/aiohttp/client_reqrep.py", line 614, in start message = yield from httpstream.read() File "/home/stu/.homeassistant/deps/aiohttp/streams.py", line 625, in read result = yield from super().read() File "/home/stu/.homeassistant/deps/aiohttp/streams.py", line 456, in read yield from self._waiter File "/usr/lib/python3.4/asyncio/futures.py", line 386, in iter yield self # This tells Task to wait for completion. File "/usr/lib/python3.4/asyncio/tasks.py", line 287, in _wakeup value = future.result() File "/usr/lib/python3.4/asyncio/futures.py", line 275, in result raise self._exception File "/home/stu/.homeassistant/deps/aiohttp/parsers.py", line 139, in feed_data self._parser.send(data) File "/home/stu/.homeassistant/deps/aiohttp/protocol.py", line 251, in call raise errors.BadStatusLine(line) aiohttp.errors.BadStatusLine: POST %2Fjsonrpc.js HTTP%2F1.1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 146, in _async_setup_platform entity_platform.async_add_entities, discovery_info File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/squeezebox.py", line 87, in async_setup_platform players = yield from lms.create_players() File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/squeezebox.py", line 110, in create_players for players in data['players_loop']: TypeError: 'bool' object is not subscriptable

Expected:

Problem-relevant configuration.yaml entries and steps to reproduce:

  - platform: squeezebox
    name: AudioSystem
    host: 192.168.1.150
    port: 9090
stuartlea commented 7 years ago

Just to add tot his - the version of LMS I am using is as follows:

Logitech Media Server Version: 7.8.0 - 1395409907

I have tried restarting the LMS and HASS and still not working.

Any ideas anybody??

frelev commented 7 years ago

Is 9090 your webport? if not, try to disable it and will default to 9000

stuartlea commented 7 years ago

Hi,

Thanks for helping. 9090 is the CLI port which until now has been working fine. 9000 is the http port. I have changed the config to 9000 and it works, starts up and functions although still gives the following error in the log:

17-02-15 20:37:47 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform squeezebox
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 146, in _async_setup_platform
    entity_platform.async_add_entities, discovery_info
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/squeezebox.py", line 56, in async_setup_platform
    host = discovery_info[0]
KeyError: 0

Its not a big issue as its working now.

Thanks for your help.

frelev commented 7 years ago

Great that it is working They changed from CLI to JSON access some releases ago.

There is another issue created for the discovery error.

sdague commented 7 years ago

It definitely would have been nice to have the warning here on the CLI to JSON, it took me a little while to realize I had to delete the port stanza to make this work again.