Can't define MPD as a media player


I just installed Mopidy-MPD on an old RPi which is connected to my LAN. The installation seems to work fine, however, I can’t manage to add the MPD as a media_player.mpd entity to my HA. I added the following to my configuration.yaml:

  - platform: mpd
    port: 6600

And in my HA log I get the following errors:

Logger: homeassistant.components.media_player
Source: components/mpd/
Integration: Media player (documentation, issues)
First occurred: 5:10:44 PM (1 occurrences)
Last logged: 5:10:44 PM

mpd: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mpd/", line 167, in async_update
    await self._connect()
  File "/usr/src/homeassistant/homeassistant/components/mpd/", line 121, in _connect
    await self._client.connect(self.server, self.port)
  File "/usr/local/lib/python3.8/site-packages/mpd/", line 165, in connect
    r, w = await asyncio.open_unix_connection(host, loop=loop)
  File "/usr/local/lib/python3.8/asyncio/", line 111, in open_unix_connection
    transport, _ = await loop.create_unix_connection(
  File "/usr/local/lib/python3.8/asyncio/", line 244, in create_unix_connection
    await self.sock_connect(sock, path)
  File "/usr/local/lib/python3.8/asyncio/", line 496, in sock_connect
    return await fut
  File "/usr/local/lib/python3.8/asyncio/", line 501, in _sock_connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/", line 359, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/", line 466, in async_device_update
    await task
  File "/usr/src/homeassistant/homeassistant/components/mpd/", line 174, in async_update
  File "/usr/src/homeassistant/homeassistant/components/mpd/", line 133, in _disconnect
  File "/usr/local/lib/python3.8/site-packages/mpd/", line 188, in disconnect
    if self.__wfile is not None:
AttributeError: 'MPDClient' object has no attribute '_MPDClient__wfile'

Anyone have ideas?


The mpd integration works fine for me with mopidy, but maybe you can try the new custom component specifically targeted at mopidy and not mpd. Works very good over here so far.

1 Like

I have the feeling your mopidy-mpd config doesn’t allow connections from anything bur
Change the host setting to

And yes, please give my mopidy platform a try :wink:

Thanks man!
I tried this and it works great!!

1 Like