Cant install cmus component

Trying to install cus component: cmus - Home Assistant

So added just this to config:

Example configuration.yaml entry

media_player:

  • platform: cmus

But I got this error:

16-12-19 22:48:14 homeassistant.components.media_player: Error while setting up platform cmus
Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 150, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/cmus.py”, line 51, in setup_platform
cmus_remote = CmusDevice(host, password, port, name)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/cmus.py”, line 71, in init
self.cmus = remote.PyCmus()
File “/home/homeassistant/.homeassistant/deps/pycmus/remote.py”, line 60, in init
self.socket_file = self._get_socket_path(socket_path)
File “/home/homeassistant/.homeassistant/deps/pycmus/remote.py”, line 110, in _get_socket_path
conf_dir = self._get_cmus_conf_dir()
File “/home/homeassistant/.homeassistant/deps/pycmus/remote.py”, line 83, in _get_cmus_conf_dir
if self.socket_path:
AttributeError: ‘PyCmus’ object has no attribute ‘socket_path’

Any idea?

Hmmm, just added “homeassistant” user to group “audio”, now I’m able to run “cmus” inside venv (cmus-remote also working inside venv), but still cannot launch cmus component - still same error :frowning:

AttributeError: ‘PyCmus’ object has no attribute ‘socket_path’

Same thing here.

@maximkrusina, @github-0, did you have any success with this? i am getting the same error.

2017-08-19 22:08:11 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform cmus
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
    return fut.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/cmus.py", line 51, in setup_platform
    cmus_remote = CmusDevice(host, password, port, name)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/cmus.py", line 71, in __init__
    self.cmus = remote.PyCmus()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pycmus/remote.py", line 60, in __init__
    self.socket_file = self._get_socket_path(socket_path)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pycmus/remote.py", line 110, in _get_socket_path
    conf_dir = self._get_cmus_conf_dir()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pycmus/remote.py", line 83, in _get_cmus_conf_dir
    if self.socket_path:
AttributeError: 'PyCmus' object has no attribute 'socket_path'

I get similar but not quite the same…

2017-11-16 15:29:51 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.cmusic fails
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
    yield from self.async_device_update()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 309, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/media_player/cmus.py", line 78, in update
    status = self.cmus.get_status_dict()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pycmus/remote.py", line 225, in get_status_dict
    status_str = self.status()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pycmus/remote.py", line 216, in status
    return self.send_cmd('status\n')
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pycmus/remote.py", line 123, in send_cmd
    self.socket.sendall(six.binary_type(passwd_str.encode('utf8')))
BrokenPipeError: [Errno 32] Broken pipe

Check the cmus socket_path if you use local unix socket.

https://github.com/NAStools/homeassistant/blob/master/homeassistant/components/media_player/cmus.py
/home/pi/.homeassistant/deps/lib/python3.5/site-packages/pycmus/remote.py


   48     def __init__(self, server=None, socket_path=None, password=None,
   49                  port=3000):
   50         super(PyCmus, self).__init__()
   51         self.port = port
   52         if server:
   53             self.server = server
   54             if not password:
   55                 raise exceptions.ConfigurationError(
   56                     "A password is required if using a remote connection")
   57             self.password = password
   58             self.socket_file = None
   59         else:
   60             self.socket_file = self._get_socket_path(socket_path)
   61             self.server = None
   62             self.password = None
   63             if password:
   64                 LOG.warning("Provided password is ignored in the local case")
   65         if not self.server:
   66             self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
   67             if not self.socket_file:
   68                 LOG.warning("Could not find cmus socket file")
   69             LOG.warning(self.socket_file)
   70             self.socket_file= '/run/user/1000/cmus-socket'
   71             self.socket.connect(self.socket_file)