Music Player Daemon (MPD)


The mpd integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows you to control a Music Player Daemon from Home Assistant. Unfortunately you will not be able to manipulate the playlist (add or delete songs) or add transitions between the songs.

Even though no playlist manipulation is possible, it is possible to use the play_media service to load an existing saved playlist as part of an automation or scene.

To add MPD to your installation, add the following to your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI.[Learn more] file. After changing the configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI.[Learn more] file, restart Home Assistant to apply the changes. To view the changes, go to Settings > Devices & services > Entities.

# Example configuration.yaml entry
media_player:
  - platform: mpd
    host: IP_ADDRESS

Configuration Variables

host string Required

Hostname or IP address of the Host where Music Player Daemon is running.

port integer (Optional, default: 6600)

Port of the Music Player Daemon.

name string (Optional, default: MPD)

Name of your Music Player Daemon.

password string (Optional)

Password for your Music Player Daemon.

Example script to load a saved playlist called “DeckMusic” and set the volume:

relaxdeck:
    sequence:
    - service: media_player.play_media
      target:
        entity_id: media_player.main
      data:
        media_content_type: playlist
        media_content_id: DeckMusic

    - service: media_player.volume_set
      target:
        entity_id: media_player.main
      data:
        volume_level: 0.60

This platform works with Music Player Daemon and mopidy with Mopidy-MPD as used by Pi MusicBox. While all of these rely on the common MPD protocol, not all implementations support all features, especially with regard to album artwork, embedded artwork and volume control. The platform will fall back gracefully if support isn’t detected.