Skip to content

ltomes/ha-media-zone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Media Zone

hacs License: MIT

Orchestrate your entire AV setup as a single media player in Home Assistant. One entity controls volume, playback, source selection, and power across your receiver, display, and source devices.

Status: Early access (0.1.x). Tested on the author's own setup; expect rough edges and occasional breaking changes until 1.0. Please file issues on GitHub if anything is broken.

Screenshots

Playback Idle
Media Zone card during playback Media Zone card when idle

App switcher

graph LR
    subgraph Media Zone
        MZ["media_player.mediaroom_zone"]
    end

    subgraph Devices
        R["Receiver<br/>(Emotiva MC1)"]
        D["Display<br/>(Hisense L9Q)"]
        S["Source<br/>(NVIDIA Shield)"]
    end

    MZ -- "volume / source / power" --> R
    MZ -- "power" --> D
    MZ -- "play / pause / stop" --> S
    S -- "HDMI" --> R
    R -- "HDMI / eARC" --> D

    style MZ fill:#1a73e8,color:#fff
    style R fill:#2d2d2d,color:#fff
    style D fill:#2d2d2d,color:#fff
    style S fill:#2d2d2d,color:#fff
Loading

How It Works

Media Zone creates a virtual media_player entity that acts as a unified remote for your room. Instead of managing 3+ devices separately:

  • Volume and mute route to the receiver
  • Play, pause, stop, next, prev route to whichever source device is active
  • Source and sound mode selection route to the receiver
  • Power on turns on the receiver, then the display
  • Power off shuts down everything -- receiver, display, and source devices
  • Now-playing info is aggregated from the active source through the signal chain

Two Operating Modes

DAG Mode (auto-discovery)

When source integrations expose media_dag_* attributes, Media Zone automatically discovers the signal chain and resolves the active source. The DAG walker follows the chain through multiple hops:

graph LR
    R["Receiver"] -->|active input: HDMI 3| D["Display"]
    D -->|active input: HDMI 3| S["Shield"]
    S -->|playing| J["Jellyfin / PipePipe / etc."]

    style R fill:#444,color:#fff
    style D fill:#444,color:#fff
    style S fill:#444,color:#fff
    style J fill:#1db954,color:#fff
Loading

Companion integrations with DAG support:

Integration What it controls Link
Emotiva MC1 RS232 Audio receiver via serial ha-emotiva-mc1
NVIDIA Shield Shield TV via ADB + Android TV Remote ha-nvidia-shield
Hisense TV Hisense Google TV devices via ADB + AirPlay ha-hisense-tv

Universal Mode (manual mapping)

Works with any HA media_player entities. Map receiver inputs to source device entities in the zone config. No custom attributes needed -- Media Zone reads standard HA attributes (source, volume_level, media_title, etc.).

A Denon receiver + Samsung TV + Apple TV works out of the box in Universal mode.

Features

  • Unified volume, mute, source, sound mode, and playback controls
  • Zone power management with smart plug force-off support
  • Now-playing aggregation from the deepest active source
  • Custom Lovelace card with signal chain visualization, transport controls, and volume slider
  • Multiple zones supported (each config entry is a separate zone)
  • Click-to-set volume bar with absolute volume support

Installation

HACS (recommended)

  1. In HACS, open the overflow menu (⋮) → Custom repositories.
  2. Paste https://github.com/ltomes/ha-media-zone, pick type Integration, click Add.
  3. Find Media Zone in the HACS list and click Download.
  4. Restart Home Assistant.
  5. Go to Settings → Devices & Services → Add Integration, search for Media Zone, and set up the integration (see Configuration).
  6. Add the custom:media-zone-card to a dashboard (the card is auto-registered as a Lovelace resource during step 5).

Manual

Copy custom_components/media_zone to your HA config/custom_components/ directory, restart, then add the integration from Settings → Devices & Services.

Configuration

  1. Settings > Devices & Services > Add Integration > "Media Zone"
  2. Enter a zone name (e.g., "Living Room")
  3. Select your receiver entity
  4. Optionally select a display entity
  5. In Universal mode, map receiver inputs to source device entities

Lovelace Card

The integration auto-registers a custom card. Add it to your dashboard:

type: custom:media-zone-card
entity: media_player.living_room_zone

Media DAG Protocol

Source integrations can expose these attributes to enable DAG mode:

Attribute Description
media_dag_input_map Dict mapping input names to source entity IDs
media_dag_active_source_entity Entity ID of the device on the active input
media_dag_source_entities List of all connected source entity IDs
media_dag_now_playing Dict with title, series, season, episode, duration, position, thumbnail, state
media_dag_role Device role: receiver, source, display, or display_source
media_dag_receiver_entity Which receiver this source is connected to
media_dag_receiver_input Which input on the receiver
media_dag_running_apps List of dicts describing apps running on the source device; enables the card's app switcher

Services

media_zone.switch_app

Bring a specific app to the foreground on the active source device. Requires the source integration to implement async_bring_to_foreground (currently supported by ha-nvidia-shield and ha-hisense-tv).

Field Required Description
entity_id Yes Media zone entity
package Yes Android package name (e.g. org.jellyfin.androidtv)

Part of the Media Zone Ecosystem

This integration is the orchestration layer. For the richest experience, pair it with device-specific integrations that expose the full DAG:

License

MIT

About

Home Assistant integration + Lovelace card that orchestrates a receiver, display, and source devices as a single unified media_player

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors