Denon AVR automation help needed

Hello everyone,

I need some help with an automation for the Denon AVR.

  1. What I have:

A Denon AVR integration → media_player.denon_avr
A Denon HEOS integration → media_player.denon_avr_x3600h
A Bubble UPNP server, which manages my playlists and online streams.

Everything works fine with no any issues.

  1. What is happening, I want to change:

Imagine, I start playing a playlist on Bubble UPNP, that contains 40 songs. Bubble starts playing. Denon AVR jumps on and Denon HEOS picks the playlist and displays the album covers.
So far, excellent.

Now my second half comes home and wants to watch TV. So she grabs the remote and switch the Denon AVR to source XS4ALL TV. The Denon AVR does that and she can watch the TV. Until Bubble UPNP sends the next song in my playlist. The Denon AVR automatically switches back to HEOS and plays the song.

Pretty annoying.

  1. What I want to do now:

I would like to write an automation to stop the HEOS playlist, when any another source is selected on the AVR.

trigger - source change on Denon AVR
condition - playback of a playlist is active on HEOS
action - Pause the playlist on HEOS

That should stop this behavior.

  1. So, why I did not make that automation already?

Well, because I do not know, how to work with those states of the media players exactly. In the UI I can’t find simple way to use the source change as a trigger.

So if someone, please, can help me get on the right track with this, I would be thankful :wink:

Template trigger?

{{ state_attr('media_player.denon_avr', 'source') == "XS4ALL TV" }}

And a condition that a playlist is playing.

I just tried the UI,

entity is my yamaha media player.

1 Like

That was the kick in my butt, I so much needed :smiley:

Thank you.

I see, you had much more choice in the pull-down menu.

Then I realized, that maybe the media player needs to be powered ON to see the full list. :slight_smile:

So now I found the correct state.

Because I have two different media handlers on the network, I just added them both to the automation, so no any disruption can occur.

alias: Nieuwe automatisering
description: ''
trigger:
  - platform: state
    entity_id: media_player.denon_avr
    attribute: source
    to: 'XS4ALL TV'
condition:
  - condition: device
    device_id: 7a4718afb775c6dc5fca968c9b8d0884
    domain: media_player
    entity_id: media_player.denon_avr_x3600h
    type: is_playing
action:
  - service: media_player.clear_playlist
    target:
      entity_id:
        - media_player.denon_avr_x3600h
        - media_player.openhome_uuid_b31c8b21_7bf8_5831_0000_00003cc21c2d
  - service: media_player.media_stop
    target:
      entity_id:
        - media_player.denon_avr_x3600h
        - media_player.openhome_uuid_b31c8b21_7bf8_5831_0000_00003cc21c2d
  - service: media_player.turn_off
    target:
      entity_id:
        - media_player.denon_avr_x3600h
        - media_player.openhome_uuid_b31c8b21_7bf8_5831_0000_00003cc21c2d
mode: single

EDIT:

It still does not work. First I assumed, it did work, but coincidentally It was the last song from the playlist, that was played.

So, I found out now, that even, when I press PAUSE on the remote of the Denon, it does not work logically. The current song will be paused, but Bubble immediately sends the next song.
The clear playlist command does not work, even in developer tools. That’s, of course, because the playlist is managed by Bubble.

So I need to find a way to control Bubble directly from Home Assistant. Next challenge… :frowning:

I’m not sure, but doesn’t Bubble also accept a stop command?

no, it does not. Just tested it in developer tools. It does accept pause, and that should be enough.

I had also tested pause in the automation. Did not work.

But now I tried developer tools, there pause works.

So, got back to basic and made this:

alias: Denon Heos off when TV
description: ''
trigger:
  - platform: state
    entity_id: media_player.denon_avr
    attribute: source
    to: XS4ALL TV
condition: []
action:
  - service: media_player.media_pause
    target:
      entity_id: media_player.openhome_uuid_b31c8b21_7bf8_5831_0000_00003cc21c2d
mode: single

Still does not work. I’m now suspecting the trigger is not correct somehow…

Oh my… one simple automation, whole sunday on the run… :smiley:

Ok, but in your automation you’re sending stop to the openhome player. Have you tried with pause?

the last one i just posted is with pause…

ok, it definitelly is the trigger. When I run the automation manually, it works now.
When I switch source on the AVR, it does not trigger…

Closer and closer… :smiley:

Starting with basics is always a good idea :wink: Hope you figure it out!

1 Like

Now I’m ready to shoot myself :smiley: :smiley: :smiley:

I have a working trigger, a working action, and still, the playlist has its own mind and will come back… Looks, like it somehow it gets out of PAUSE itself… pfffffffffffffffffffffffffffffff

Ok, never mind, this could be closed. I’ve got rid of Bubble UPNP, as it seems to be uncontrollable.

Deleted the server from my NAS, took an unused Raspberry and installed Volumio on it.

Why the hell I did not made this choice earlier?

:smiley: