Restructure how displays are exposed in Home Assistant:
Each physical monitor is now its own HA device linked to the media-server
hub via `via_device`. The hub keeps the media_player + script buttons; per-
display devices hold the power switch, brightness slider, and the new
capability entities. This lets users place displays in their own area/room
and keeps related entities grouped together in the UI.
New platforms:
- sensor: DisplayResolutionSensor (diagnostic, from EDID)
- binary_sensor: DisplayPrimaryBinarySensor + DisplayPowerControlBinarySensor
(both diagnostic; help users see why a power switch is or isn't created)
- select: DisplayInputSourceSelect (HDMI1/DP1/...), DisplayColorPresetSelect
(color temperature), DisplayPictureModeSelect (VCP 0xDC scene modes)
- number: added DisplayContrastNumber alongside brightness
Other changes:
- display_device helper centralises the per-display DeviceInfo; pulls real
manufacturer/model from EDID; device name no longer prepends the hub
title since via_device already shows the hierarchy.
- api_client gains set_display_{contrast,input_source,color_preset,picture_mode}
and stops forcing `?refresh=true` on every poll so HA can ride the
server's TTL cache instead of triggering full DDC/CI probes per entity.
- select / number entities now check the server's `success` flag and re-
sync from the actual monitor state when a write was silently rejected
(some monitors honor reads but ignore writes for certain DDC/CI codes).
Bumps manifest.json to 0.3.0 - the device topology change is user-visible
and existing brightness/power entities migrate to per-display devices on
first reload (unique_ids are preserved).
Remote Media Player - Home Assistant Integration
A Home Assistant custom integration that allows you to control a remote PC's media playback as a media player entity.
Features
- Full media player controls (play, pause, stop, next, previous)
- Volume control and mute
- Seek support with smooth timeline updates
- Displays current track info (title, artist, album, artwork)
- Real-time updates via WebSocket (with HTTP polling fallback)
- Turn on/off/toggle support - Execute custom actions (e.g., lock screen on turn off)
- Script buttons - Execute pre-defined scripts (shutdown, restart, lock, sleep, etc.)
- Configurable via Home Assistant UI
Requirements
- Home Assistant 2024.1.0 or newer
- A running Media Server on your PC
Media Server
This integration requires the Media Server to be running on the PC you want to control.
Media Server Repository: media-player-server
See the Media Server documentation for installation and setup instructions.
Installation
HACS (Recommended)
- Open HACS in Home Assistant
- Click the three dots menu > Custom repositories
- Add this repository URL:
https://git.dolgolyov-family.by/alexei.dolgolyov/haos-hacs-integration-media-player - Select category: Integration
- Click Add
- Search for "Remote Media Player" and click Download
- Restart Home Assistant
Manual Installation
- Download the latest release from the Releases page
- Extract and copy the
custom_components/remote_media_playerfolder to your Home Assistantconfig/custom_components/directory - Restart Home Assistant
Configuration
- Go to Settings > Devices & Services
- Click + Add Integration
- Search for "Remote Media Player"
- Enter the connection details:
- Host: IP address or hostname of your PC running Media Server
- Port: Server port (default: 8765)
- API Token: The authentication token from your Media Server
- Name: Display name for this media player (optional)
Usage
Once configured, the integration creates:
Media Player Entity
A full-featured media player entity with:
- Play/Pause/Stop controls
- Next/Previous track
- Volume control and mute
- Seek functionality
- Current track information
- Turn on/off/toggle actions (execute server-side callbacks)
Turn On/Off/Toggle
The media player supports media_player.turn_on, media_player.turn_off, and media_player.toggle actions. These execute optional callbacks configured on the Media Server (e.g., lock screen on turn off).
Configure callbacks in Media Server's config.yaml:
callbacks:
on_turn_on:
command: "echo PC turned on"
timeout: 10
shell: true
on_turn_off:
command: "rundll32.exe user32.dll,LockWorkStation"
timeout: 5
shell: true
on_toggle:
command: "echo Toggle triggered"
timeout: 10
shell: true
Script Button Entities
Button entities for each script defined on your Media Server:
- Lock/unlock workstation
- Shutdown, restart, sleep, hibernate
- Custom scripts
Execute Script Service
Call remote_media_player.execute_script to run any server-defined script with typed parameters:
service: remote_media_player.execute_script
data:
script_name: set_brightness
params:
level: 75
monitor: primary
Parameters are validated against the script's schema on the server. Scripts define their parameters in config.yaml:
scripts:
set_brightness:
command: "python set_brightness.py"
label: "Set Brightness"
icon: "mdi:brightness-6"
timeout: 10
parameters:
level:
type: integer
required: true
min: 0
max: 100
description: "Brightness level (0-100)"
monitor:
type: select
options: ["primary", "secondary", "all"]
default: "primary"
description: "Target monitor"
Supported parameter types: string, integer, float, boolean, select.
Parameters are passed to scripts as environment variables prefixed with SCRIPT_PARAM_ (e.g., SCRIPT_PARAM_LEVEL=75, SCRIPT_PARAM_MONITOR=primary).
Scripts without parameters work as before — just omit params.
Example Lovelace Card
type: media-control
entity: media_player.remote_media_player
Documentation
For detailed documentation, see custom_components/remote_media_player/README.md.
Support
License
MIT License