An Home Assistant Media Player integration for the mpv media player, using mpv's JSON IPC API.
The integration can be installed by adding it as a custom repository to HACS. In Home Assistant, navigate to
HACS > Integrations > Custom repositories (in the top-right menu). Under Repository enter oxan/home-assistant-mpv
,
and under Category select Integration. The integration should now appear in HACS.
Start mpv with the input-ipc-server
option set to the socket location:
$ mpv --input-ipc-server=/path/to/mpv-socket
Configure the location of the socket in Home Assistant:
media_player:
- platform: mpv
server:
path: /path/to/mpv-socket
Restart Home Assistant and enjoy!
When starting playback through Home Assistant, by default it will stream all media through its own HTTP server. If mpv and Home Assistant can access the media files using the same filesystem path, you can disable this and play media directly from the filesystem. This reduces resource usage and allows mpv to find external subtitle files.
media_player:
- platform: mpv
server:
path: /path/to/mpv-socket
proxy_media: false