Trying to connect to a remote CMUS instance on a raspberry pi zero w but HA will not connect.
Environment:
HA running in docker container
CMUS running on a raspberry pi zero w with --listen 0.0.0.0 and a password set
Relevant configuration entry:
media_player:
- platform: cmus
host: 10.0.6.32
port: 3000
name: 'Test CMUS'
password: SomePassword
Error:
Error while setting up platform cmus
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/app/homeassistant/components/media_player/cmus.py", line 51, in setup_platform
cmus_remote = CmusDevice(host, password, port, name)
File "/usr/src/app/homeassistant/components/media_player/cmus.py", line 68, in __init__
server=server, password=password, port=port)
File "/usr/local/lib/python3.6/site-packages/pycmus/remote.py", line 79, in __init__
"Unable to connect to server %s" % self.server)
pycmus.exceptions.ConfigurationError: A configuration error occured
Details: Unable to connect to server 10.0.6.32
Steps I’ve done trying to debug the problem:
- Restart HA (docker instance)
- Install pycmus on my desktop, and connected using same code as cmus.py like 67-68
- docker exec -it hass python and do the same thing
- import the cmus.py into repl and manually created a CmusDevice
All steps connect just fine and allow me to do a get_status_dict() or a device.status after an update without an error… yet HA refuses to connect with the exact same error msg.
example of what I typed into the repl:
from homeassistant.components.media_player import cmus
q = cmus.CmusDevice('10.0.6.32','SomePassword', 3000, 'test')
q.update()
q.status
{'tag': {}, 'set': {'aaa_mode': 'all', 'continue': 'true', 'play_library': 'true', 'play_sorted': 'true', 'replaygain': 'disabled', 'replaygain_limit': 'true', 'replaygain_preamp': '0.000000', 'repeat': 'false', 'repeat_current': 'false', 'shuffle': 'false', 'softvol': 'false', 'vol_left': '0', 'vol_right': '0'}, 'status': 'stopped'}
Not sure where to move forward and would love some guidance.
Thanks in advance.