Hi @mindedc I also have some kinda messy items to script. Iâm not sure if it helps in your case, but are you familiar with Universal media player - Home Assistant - basically make up your own media player from whatever underlying entities you want and once you template things like sources, you can combine a whole bunch of things together into a single player. I then use that with a selector template so that I can control all the navigation using the tv card.
I believe this can all be done with a few additional virtual buttons and home assistant scripts. The logic of which actitivity is active and therefore which device needs to be on and which source needs to be selected can all be done much better in HA. Iâve done this and it works very well. In fact much better than any of my old Harmony Remotes were able to do. Yes you need a bunch of scripts but that is the preferred way, at least thatâs my perspective.
This is what Iâm trying to get these guys to understand. I donât know if youâve used control 4 before. The drivers for the media devices know what inputs and outputs they have. You then virtually connect everything and a default video and audio endpoint are selected per room. If you activate a given source the system automatically traverses the path between the source and the endpoints and it powers on what you need active and powers off what you donât. If you change sources it automatically powers on and off components and selects inputs. When you power the room off it only powers off what is turned on. When you interact with the system its through a single remote proxy and youâre oblibvious as an end user that some commands are going from the remote to many devices. As a programmer it only takes a few seconds to virtually connect the inputs and outputs and enable the sources on the room. I could rebuild my main theater config that has external amps, DSPs, a surround processor, A HDMI switch, two video processors and something like 8 sources in about 10-20 mins including adding drivers to the system.
I have looked into the universal media player and it looks like it would let you have say media controls going to a streamer (like kodi or apple TV) and say volume controls going to an AVR. It doesnât seem to manage power and state for intermediary components like video processors or amplifiers. Unfortunately the examples on the universal media player page are all scenarios that donât fit any traditional âmedia roomâ patterns, its more of a smart TV with internal apps or using HDMI-CEC from a streamer.
When I googled around I canât find anything about âselector templatesâ with respect to universal media player. In the docs it indicates you can use an âactive child templateâ with a Jinja template in the yaml. I donât understand what this does for you as it seems the system should know what media player is active but it seems to let you force the active child media player based on someone say using the deviceâs remote instead of controlling it with HA which in my opinion is a recipe for disasterâŚ.you donât ever want the devices out of sync with the automation platform by using local control. The only other template I see is for state of the media player itself which again seems to be to just say the universal media player is on or off or whatever but seems very ass-backwards as the state of the media player should be maintained by the control system not derived from the devices. I donât see anywhere to tell the universal media player what input a source is on or even to attach a script to it so I assume that would need to be done with a whole pile of external automations.
Even the way that harmony or whatever does it is pretty antiquated compared to the commercial systems. I can build out a hyper complicated config in a few seconds with no programming and no scripting or debuggingâŚIt wouldnât be a terribly complicated integration to set up to monitor and manage a media room and automatically control the devices. Given that HA doesnât track the interconnection between devices you would have to define that to some degree and select whatever action would be needed to say change an input.
I am trying to get these guys to understand that it would help them to bring that kind of functionality to HA. Iâm starting to think I may need to write it myself..
Thanks for sharing your detailed thoughts â this is exactly the kind of insight that helps everyone understand the possibilities and limitations with Home Assistant media control.
I completely agree that Home Assistant scripts and virtual buttons can handle a lot of scenarios, especially for simple setups or single media devices. For example, controlling a single streamer and a whole-home AVR can be done elegantly with some scripts and RosCard button mapping.
Where it starts to get tricky â and where traditional commercial systems like Control4 shine â is in complex media rooms with multiple endpoints, AV processors, HDMI switches, and multiple sources. In those setups:
-
The system needs to track device interconnections (which source is on which input, which amplifier or processor is active).
-
Activating a source should power on/off intermediary devices automatically, without requiring the user to trigger multiple scripts.
-
The state of each component should be maintained by the control system, not inferred from device responses alone.
Home Assistantâs universal media player can combine multiple media controls, but as youâve noticed, it doesnât natively track the intermediate device states or automatically manage power routing between sources and endpoints. Right now, users would have to build a large network of automations and scripts to replicate what commercial control systems do natively. Thatâs feasible, but itâs definitely more work and more fragile.
I think thereâs a real opportunity here: a dedicated media room integration for HA that manages source selection, intermediary device state, and endpoint routing could bring HA closer to the Control4 experience, while still allowing advanced users to script or customize behavior.
Itâs encouraging to see both of you experimenting and pushing the boundaries â your feedback is exactly what drives better integrations and user experiences.
By default, the univeral media player assumes that the first entity in itâs list is the âmainâ entity. So, it will generally pass commands that you donât override to that entity. Using the active_child_template allows you to dynamically change the active child using a template. Itâs useful to minimise the number of overrides you need to have. So, you might do something like
active_child_template: >
{{ âmedia_player.sky_qâ
if is_state_attr(âmedia_player.universalâ, âsourceâ, âSky Qâ)
else None }}
to set the active child to the Sky media player if the source attribute of the universal mp is set to Sky Q - otherwise return None, which then just uses the first entity in the list as the active.
If I understand what youâre saying, then I think youâre right and itâs the way things work. I trigger everything by having automations which are triggered by the change of state of a device. So, if the Sky box is turned on in any way, the automation turns on the relevant devices, sets the sources etc.. All any of my front ends (remotes, HA app etc.) is turn on the Sky box and let the script do the rest.
The template select is just an tidy way to wrap a bunch of commands (calls to scripts etc.) into a single entity. Since the astrion doesnât currently let you pass parameters to a script, I use one to create an entity which has all the navigation keys for the sky device so that i can link them to buttons in the tv card without having to create individual scripts for each one.
So, I do this a simplified version of what I do with universal to create an overall player.
media_player:
- platform: universal
name: Den Universal
unique_id: den_universal
children:
- media_player.den
- media_player.sky_q
- media_player.oppo
active_child_template: >
{% if is_state('input_select.den_media_source', 'Sky Q') %}
media_player.sky_q_
{% elif is_state('input_select.den_media_source', 'Music') %}
media_player.den
{% elif is_state('input_select.den_media_source', 'DVD') %}
media_player.oppo
{% elif is_state('input_select.den_media_source', 'Netflix') %}
media_player.sky_q
{% elif is_state('input_select.den_media_source', 'Prime') %}
media_player.sky_q
{% else %}
none
{% endif %}
attributes:
source_list: >
input_select.den_media_source|options
source: >
input_select.den_media_source.state
commands:
turn_on:
service: script.den_power_on
data:
source: "{{ states('input_select.den_media_source') }}"
turn_off:
service: script.den_all_off
select_source:
service: input_select.select_option
target:
entity_id: input_select.den_media_source
data:
option: '{{ source }}'
Then, I have a helper which contains the source
and i have lots of automations, but for example i trigger on source change
alias: Den Media Switcher
description: ""
triggers:
- trigger: state
entity_id:
- input_select.den_media_source
conditions: []
actions:
- choose:
- conditions:
- condition: state
entity_id: input_select.den_media_source
state:
- Sky Q
sequence:
- action: ...
- conditions:
- condition: state
entity_id: input_select.den_media_source
state:
- Music
sequence:
- action: ....
Hi @peteS-UK,
This is a really great example â thanks for sharing it in detail ![]()
What youâve built here is essentially a Home Assistantâdriven âActivity Engineâ, very similar in concept to how systems like Harmony or even Control4 handle source selection and routing.
Why This Approach Works Well
Your setup nicely demonstrates a powerful pattern:
-
input_selectâ acts as the âcurrent activity/sourceâ -
Universal Media Player â acts as a unified control interface
-
Automations â handle power, routing, and switching logic
This separation is actually very clean and scalable:
-
UI (remote) stays simple
-
Logic stays centralized in Home Assistant
How This Fits with Astrion
This kind of setup works very well with Astrion, especially when combined with:
-
TV Card â for control (D-Pad, volume, etc.)
-
Scene / Script Card â for activity selection
-
Media Player Card â optional for status/feedback
For example:
-
Bind source selection to:
-
Scene buttons
-
Or script buttons (e.g. Watch TV, Watch DVD)
-
-
Use your universal media player (
media_player.den_universal) as:- The main media entity in the TV Card
Nice Advantage of Your Method
Compared to traditional remotes:
Fully customizable logic
Handles complex setups (AVR, multiple sources, etc.)
Easy to extend (just add new options to input_select)
Small Suggestion
One thing to double-check:
media_player.sky_q_
There seems to be a small typo (extra underscore), which might cause issues in the template.
Future Direction (Our Side)
What youâve built is exactly the kind of workflow we see advanced users moving toward.
Weâre actively evaluating ways to make this easier to configure, such as:
-
More native âactivity-styleâ abstraction
-
Easier multi-device control mapping
-
Better UI support for source-based switching
Summary
-
Your setup = excellent best practice

-
Works very well with Astrion today
-
Represents a powerful alternative to traditional âActivityâ systems
Really appreciate you sharing this â itâs super helpful for other users trying to achieve the same kind of setup ![]()
@Charles You really need to allow the Astrion to select Harmony Activities.
I rely on what I have already programed into the Harmony Hub to mange the sequence of ON, OFF and Switching between Activities. I have 5 components that need to be managed in a particular order. Activities built into the Harmony Hub is the best and simplest way to do this.
Adding this ability to the Astrion will allow direct control of the Harmony Hub device that is in Home Assistant. Re-enforcing the Astrions UI only ethos. At the moment the TV ROS Card is only good for direct control of Android TV or Apple TV Devices
This will also keep the Astrion in sync with the Harmony Remote and status of the Harmony Hub device in Home Assistant.
Your script solution is NOT GOOD ENOUGH and duplicates automation that already exists in the Harmony Hub.
Adding a simple dropdown selector to the Astrion that replaces the Power Toggle on the TV ROS Card is the solution you need to implement. Also allowing *.button entities to be directly mapped to the TV ROS card hardware buttons would help.
You need to add a Harmony Device Type in addition to the Android TV or Apple TV Devices in your TV ROS Card. This should allow clean separation between the power behavior of the different devices.
thank you Chaykan, I will ask the team to check and do the evaluation jobs and update you later


