I have no doubt whatsoever this could be streamlined, and that will be the very next question after getting the source to switch over to HEOS Music. Seems to fail due to the space in the command, tried single & double quotes in various places. Any hints for this?
Thanks for reading.
Here’s the source list:
source_list:
- AUX
- Alexa
- Blu-ray
- Bluetooth
- DVD
- Game
- HEOS Music
- Media Player
- TV Audio
- Tuner
And here’s my script I’ve attached to a button my HA dashboard.
If I use SIDVD for example, it switches the channel.
I lifted these commands from here and have only the vaguest use what I’m doing tbh, however I’ve seen the version of commands you’re using littered about the place here, just didn’t know how to input them.
Yes, I am fairly sure this works in my quick test then. Cheers for that. Now I can also make sure the correct “HEOS radio station” is playing using that too I suppose.
I don’t use zones so can’t help with that, but sounds like it’s working.
The only way I have found to select a HEOS radio station is to create a favorite for it with the HEOS app. Then I use
media_player to play the favorite.
It’s literally a spare Denon amp used in a master suite, so it’s zone 1 bedroom, zone 2 bathroom and a physical DPDT switch for a roof terrace from zone 1, which is all extremely confusing in Denon’s HA entities because the names are confusing.
I don’t know of a way to query the favorites. However, they will only show up in the source list of the media_player that is associated with the HEOS integration. They are not in the source list of the media_player of the Denon AVR integration.
If you go to the developer tools states tab you should see both media players and the HEOS one should have the favorites in the source list.
No problem. It’s definitely confusing having two media players associated withe the receiver. I actually have three media players associated with mine.
I added a universal media player for my Denon which combines the other two.
I added the following to my configuration.yaml to create the media player.
media_player:
- platform: universal
name: denon_avr
unique_id: denon_avr
device_class: receiver
children:
- media_player.denon_avr_x1800h
- media_player.denon_avr_x1800h_2
browse_media_entity: media_player.denon_avr_x1800h_2
# state_template required because otherwise when you leave it on HEOS it shows wrong status
state_template: >
{% if is_state_attr('media_player.denon_avr_x1800h', 'source', 'HEOS Music') %}
{{states('media_player.denon_avr_x1800h_2')}}
{% else %}
{{states('media_player.denon_avr_x1800h')}}
{% endif %}
# active_child_template required because otherwise you can't start/stop properly with HEOS
active_child_template: >
{% if is_state_attr('media_player.denon_avr_x1800h', 'source', 'HEOS Music') %}
media_player.denon_avr_x1800h_2
{% else %}
media_player.denon_avr_x1800h
{% endif %}
commands:
turn_off:
service: media_player.turn_off
data:
entity_id: media_player.denon_avr_x1800h
turn_on:
service: media_player.turn_on
data:
entity_id: media_player.denon_avr_x1800h
volume_up:
service: media_player.volume_up
data:
entity_id: media_player.denon_avr_x1800h
volume_down:
service: media_player.volume_down
data:
entity_id: media_player.denon_avr_x1800h
select_sound_mode:
service: media_player.select_sound_mode
target:
entity_id: media_player.denon_avr_x1800h
data:
sound_mode: "{{ sound_mode }}"
attributes:
sound_mode: media_player.denon_avr_x1800h|sound_mode
sound_mode_raw: media_player.denon_avr_x1800h|sound_mode_raw
sound_mode_list: media_player.denon_avr_x1800h|sound_mode_list
# source_list required because otherwise HEOS Music source does not show up when AVR is active child
source_list: media_player.denon_avr_x1800h_2|source_list
Oh ok, sorry, yours was calling it by favourite number so figured I had to assign numbers to them first.
I shall try that.
Ideal world I guess a prompt asking which one you’d like from a compiled list of favourites, but that’s for another time when I understand things more.
You probably need to first change the source to Heos Music and then select the radio source.
You can test the service calls from the developer tools services tab.
Add the Denon media players to a dashboard page and you will be able to see if it changed stations. You should also be able to select different sources using the dashboard.