Linux desktop agent to allow MPRIS multimedia control from Home Assistant
Project description
Linux desktop agent to allow MPRIS multimedia control from Home Assistant
This package contains the agent that Home Assistant connects to in order to govern multimedia playback.
Setup
Dependencies
Install GTK+ 4 and libnotify on your system. These should be packages provided by the system.
This package
Install this package on your computer, then run the program
hassmpris-settings
to turn the agent on.
Firewall rules
Don't forget to open the requisite firewall ports to allow communication from Home Assistant:
- TCP port 40051
- TCP port 40052
Pair with Home Assistant
Once the agent is running you can connect to your computer from Home Assistant.
Troubleshooting and help
The client utility available here will help you debug issues by allowing you to connect to the agent from your machine or another machine.
If the agent is giving you trouble or not working as it's meant to, you may want
to look at your system logs. E.g. if running the agent under your desktop
session, look at the log files for the session using journalctl
or under the
file ~/.xsession-errors
. You should make a copy of any traceback of interest.
Found a bug or a traceback?
Please report it in the project's issue tracker.
Technical information
The MPRIS desktop agent is composed of two different servers:
- An authentication server (listening on TCP port 40052).
- An MPRIS gRPC server (listening on TCP port 40051).
The authentication server
The authentication server doles out credentials for clients that want to connect to the MPRIS gRPC server. It follows the CAKES scheme documented in that project and implemented in the reference HASS MPRIS client.
The MPRIS gRPC server
The MPRIS gRPC server provides an event-based interface to properly- authenticated clients, relaying status information as it happens to them via a bidirectional gRPC channel, and accepting commands for the media players running locally via that gRPC channel.
This server implements a gRPC interface formalized in package hassmpris (direct link to protobuf). The protobuf interface documents what commands and properties are supported at any point in time, and the README.md file of that project contains useful information as well.
Interface between gRPC and desktop media players in the agent
Bound to the gRPC server is a D-Bus interface listener that monitors media players and relays that information back to the gRPC server for broadcast to remote clients, as well as accepting command requests from the gRPC client and effecting those commands onto the media players of the system where this program runs.
In addition to providing a command and event interface for MPRIS media players, the D-Bus interface listener also provides façades for certain media players that are not necessarily fully compliant with the MPRIS specification.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.