Controlling a Denon AVR

So, I’m looking around at gear I already have, that I might be able to leverage Home Assistant to control.
Enter the Denon AVR-2313.

I’ve managed to get it to turn on, set the volume, and change source:

  action:
- service: media_player.turn_on
  data_template:
    entity_id: media_player.denon_avr
- delay: '00:00:03'
- service: media_player.volume_set
  data_template:
    entity_id: media_player.denon_avr
    volume_level: '0.1'
- service: media_player.select_source
  data:
    entity_id: media_player.denon_avr
    source: 'TUNER'

Has anybody had any success passing an instruction to tune to a specific frequency?
And failing that, has anyone had any success getting it to switch to one of its “Favourite” presets? These can be configured on the unit itself and I could make one for the desired radio station.

3 Likes

After a few Home Assistant upgrades, I’d hoped this would magically fix itself. It hasn’t lol.

The more basic issue really appears to be the instruction sent to the AVR for the tuner. I can switch sources to “CD”, “AUX”, “Blu-ray”, etc. I can’t get it to switch to “FM” which is what it calls its Tuner Module.

Looking at some of the info here: https://github.com/scarface-4711/denonavr it would appear that there are units that call it “TUNER” and those that call it “FM”. I’ve followed the paths listed there and found that mine does specifically call it “FM” in http://deviceip//goform/Deviceinfo.xml
If I use the media_player.select_source dev tool to send source instructions, I get the following results:

{
 "entity_id": "media_player.denon_avr_33_lounge",
 "source": "AUX"
}

Changes successfully to AUX.

{
  "entity_id": "media_player.denon_avr_33_lounge",
  "source": "Blu-ray"
}

Changes successfully to Blu-ray.

{
  "entity_id": "media_player.denon_avr_33_lounge",
  "source": "TUNER"
}

Produces this error: “No mapping for input source TUNER”

{
  "entity_id": "media_player.denon_avr_33_lounge",
  "source": "FM"
}

Produces no error but does not change the source.

I guess I need to talk to whoever wrote the HA Denon code??

4 Likes

Would like this as well! ++

After a few hours of research I found out about denonavr.get_command here https://www.home-assistant.io/integrations/denonavr/ . There is a link to A comprehensive list of telnet protocol commands http://assets.denon.com/_layouts/15/xlviewer.aspx?id=/DocumentMaster/us/AVR-X6400H_X4400H_X3400H_X2400H_X1400H_S930H_S730H_PROTOCOL_V01.xlsx
These seem to be generic for Denon, as they work for my AVR-X1600H DAB as well.

It requires some sifting through all those commands, but it literally opens up about everything there is to control about your Denon AVR.

My DAB+ station presets are controlled by the analog protocol-commands (strangely enough). You can test any command using the Developer tools, like so…

entity_id: media_player.denon_avr_x1600h_2
command: /goform/formiPhoneAppDirect.xml?TPAN01

TP is the prefix for radio Presets, AN is Analogue, 01 is preset channel 01. All command prefixes and suffixes are documented in the spreadsheet above.

You can also add Denon controls like input channels and station presets under any Lovelace buttons. This is the code I use to tell the Denon AVR to switch to radio channel preset 01:

 - cards:
      - entity: media_player.denon_avr_x1600h_2
        hold_action:
          action: more-info
        icon_height: 25px
        show_icon: true
        show_name: true
        show_state: false
        name: Veronica
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_x1600h_2
            command: /goform/formiPhoneAppDirect.xml?TPAN01
        type: button

This works like:
Screenshot 2020-08-01 at 14.45.45

2 Likes

Looks like I’ll have to have another go at mine then!

1 Like

@Maverick thank you so much.
I just bought the AVR-X1600H DAB. The HEOS APP cannot control the DAB channels and the Denon Remote App 2016 is a monstrosity.
I can’t use the remote in my Zone 2 as obviously it is in a different room than the receiver.
However thanks to your clever research I can now control it from my Home Assistant Companion App :smiley:
I might have returned the device if it wasn’t for you!

2 Likes

Glad it helped! :smiley:

@Maverick… This works perfect, thanks for sharing.

One thing that I can’t seem to find is how to set the Internet Radio presets using the API.
There are other versions of the Denon AVR Control Protocol document (like this v6 doc), but for whatever reason they miss the commands to manage the Internet Radio.

Also, setting a specific frequency for the (FM) Radio does not work for me.
I tried a couple of variants of the following, based on the documentation (for 104.1MHz)
/goform/formiPhoneAppDirect.xml?TFAN104.100
/goform/formiPhoneAppDirect.xml?TFAN0104.10

Did you manage to get this working, or anyone has any ideas?

1 Like

Hey @JoFie I made some presets for the radio, in my case I use DAB, but that seems to work the same as FM. In my case, my 6th radio preset is for Sky Radio, for which I have a button using:

command: /goform/formiPhoneAppDirect.xml?TPAN06

Looking at the Excel I shared, I don’t think you are allowed to use decimal separators. I have uninstalled the Denon integration atm, because of the log flooding errors with the current firmware, but I would try:

/goform/formiPhoneAppDirect.xml?TFAN104100

As for the Internet Radio, I haven’t tried that either. Will try this as soon as the firmware is fixed again :grinning:

My guess would be to try the Online Music section in the Excel sheet, and try the Preset Memory commands. The ones with NSC00

In this protocol pdf the example they provide is indeed in the format TFAN105000 (for an AM station), so your proposal looks logical. But, alas…

Zone Command Parameter Function Example
Tuner Control TF AN******
(6 digits)
****.** kHz at AM band (>050000 is AM.)
****.** MHz at FM band (<050000 is FM)
TFAN105000
(1050.00kHz at AM)

I now installed the Denon Remote App on my iPhone, and will see if I can capture the messages send to the Denon. I suspect that the (latest firmware) API does not support all the commands listed in those protocol docs. Maybe the Internet Radio falls in that category, as it is not even covered in the phone App. Maybe they want to push us to “radiodenon.com” so that we can hand them over some money.


Regarding the errors…
I also had a lot of Denon-related errors when the AVR was turned off, and managed to get rid of it with the below logger settings in configuration.yaml. Especially the last entry (DenonAVR: critical) did the trick for me.

logger:
  default: error
  logs:
    homeassistant.component.media_player.denonavr: critical
    homeassistant.components.denonavr.receiver: critical
    DenonAVR: critical
2 Likes

The excel with all the commands not only lists commands that make the Denon AVR do things, but also commands that are supposed to send you something back.
I’m very interest in the “TPAN?” command which is supposed to send back the number of that the tuner is set to.
I have no clue where the reply is being sent to.
Is there a way for the DenonAVR integration to capture the response and for me to then use it?
I assume there is because after all the DenonAVR integration also knows whether the AVR is on or off and the volume etc.

@JoFie to control internet radio I’m using the HEOS integration.

1 Like

I was also looking for a way to capture the response from those Denon APIs where you can query the state of some object, but I (still) don’t know how to do so and make the data visible in HA. I posted a question in another forum, but did not get any reply.

You can get some information from the AVR by using the attributes of your Denon entity (mine is “media_player.denon_avr_2113”). Depending on what you set your AVR source to, you will get different attributes.
e.g. when listening to a “Favorites” Internet Radio:

volume_level: 0.215
is_volume_muted: false
media_content_type: music
media_title: The Rolling Stones - Start me up
media_artist: ANTENNE BAYERN 80er Kulthits
source: Favorites
sound_mode: MUSIC
sound_mode_raw: PLII Music
friendly_name: DENON AVR-2113
entity_picture: >-
  /api/media_player_proxy/media_player.denon_avr_2113?token=bd68929&cache=70058e3f222
supported_features: 85949

You could then show the wanted attribute value in your UI using something like this:

${states['media_player.denon_avr_2113'].attributes.source}
${states['media_player.denon_avr_2113'].attributes.media_title}

And for the volume, you have to multiply the attribute value with 100 if you want to show it as an integer instead of a fraction:

${Math.round((states['media_player.denon_avr_2113'].attributes.volume_level)*100)}

My HA is currently down because of a corrupt SSD, else I could be more specific. It actually crashed the night I completed a reasonably nice Denon interface, so it was not included in a snapshot/backup yet. But if I’m lucky I can still recover the data on the SSD, then I will share it here.

So it turns out it is possible to get information about the status of the AVR using the commands documented in the Excel.
Basically you send a status request like /goform/formiPhoneAppDirect.xml?TPAN? (the command to ask what DAB channel is being used) using for example the DenonAVR integration.
You can then catch the reply using this node which you can install in the node-red addon:

Just to give some pointers for using the input from the node:

If you ask for the used DAB channel, the node will read the following:

> {"payload":{"event":"raw","data":[84,80,65,78,48,50,13]},"_msgid":"3364990b.711646"}

If you then link a function node to it with the following code:

msg.payload = msg.payload.data.toString();
msg.payload = msg.payload.replace(/\r/g,"");
return msg;

The output of that function node will be:

{"payload":"TPAN02","_msgid":"b645b255.5e441"}

You then know that the DAB channel is set to the second channel.
The reason the function node also has this replace functionality is that there is a carriage return “\r” at the end of TPAN02 that we need to remove to be able to work with it :slight_smile:
Obviously the DAB channel is just an example.

This input node will by the way also give feedback even if you don’t ask for it. So if you for example you use the remote control or denonavr to mute your receiver, this input node will return “MUON” as msg.payload.

1 Like

Thanks for that information.
I’ve been using the other Denon palette in Node Red, but it doesn’t provide the Denon’s reply.
Going to try this palette instead, and see how it works.

Randy

Below is a panel I made to control my Denon AVR, should anyone be interested.

Some notes:

  • It makes use of the Custom Button Card.
  • Replace my entity id “media_player.denon_avr_2113” with your own AVR entity.
  • The buttons only cover functions I want to use in HA, mainly internet radio. A lot of stuff is missing, like DVD controls etc. Change/add buttons as you need, using the API commands from this list .
  • I use scripts to help with some of the functionality. The definitions are given below.
  • Change the colors to match your scheme.



type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        entity: media_player.denon_avr_2113
        name: Denon
        color_type: label-card
        show_state: true
        icon: |
          [[[
            if (entity.state == 'off')
              return "mdi:amplifier-off"
            else if (entity.attributes.source == 'TV AUDIO')
              return "mdi:television-classic";
            else if (entity.attributes.source == 'DVD')
              return "mdi:music-circle-outline";
            else if (entity.attributes.media_title == 'AirPlay')
              return "mdi:cast-audio"
            else if (entity.state == 'playing' || entity.attributes.source == 'FM')
              return "mdi:radio"
            else
              return "mdi:cast-connected";
          ]]]
        size: 90%
        styles:
          card:
            - height: 175px
            - border-radius: 5%
            - background-image: >-
                linear-gradient(90deg, rgba(13, 44, 99,1) 0%, rgba(9, 34, 79,1)
                7%, rgba(81, 132, 224,1) 100%)
            - padding: 4%
            - padding-left: 6%
            - color: lime
            - font-size: 13px
            - text-shadow: 1px 1px 5px black
          icon:
            - color: lightgrey
            - margin-top: 1%
            - padding: 0px 10px 0px 0px
          img_cell:
            - justify-content: end
            - align-items: start
          name:
            - font-weight: bold
            - color: white
            - font-size: 33px
            - padding: 10px 0px 5px 170px
          state:
            - font-weight: bold
            - font-size: 16px
            - justify-self: middle
            - padding: 0px 10px
          grid:
            - position: relative
            - grid-template-areas: >-
                "n . i" "volume . i" "muted . i" "source . i" "title title
                title" "artist artist s" 
            - grid-template-columns: 1fr 1fr 1fr
            - grid-template-rows: 1fr min-content min-content min-content min-content
          custom_fields:
            volume:
              - padding-top: 15px
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
            muted:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
            source:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
            title:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
            artist:
              - align-self: middle
              - justify-self: start
        custom_fields:
          volume: |
            [[[
              if ( entity.state == 'off' )
                return ``
              else 
                return `<ha-icon
                icon="mdi:volume-high"
                style="width: 18px; height: 17px; color: deepskyblue;">
                </ha-icon><span> &nbsp; Volume: &nbsp;<span style="color: var(--text-color-sensor);">${Math.round((states['media_player.denon_avr_2113'].attributes.volume_level)*100)}</span></span>`
            ]]]
          muted: |
            [[[
              if ( entity.state == 'off' )
                return ``
              else 
                return `<ha-icon
                icon="mdi:volume-off"
                style="width: 18px; height: 17px; color: deepskyblue;">
                </ha-icon><span> &nbsp; Muted: &nbsp; &nbsp;<span style="color: var(--text-color-sensor);">${states['media_player.denon_avr_2113'].attributes.is_volume_muted}</span></span>`
            ]]]
          source: |
            [[[
              if ( entity.state == 'off' )
                return ``
              else 
                return `<ha-icon
                icon="mdi:dlna"
                style="width: 18px; height: 17px; color: deepskyblue;">
                </ha-icon><span> &nbsp; Source: &nbsp; <span style="color: var(--text-color-sensor);">${states['media_player.denon_avr_2113'].attributes.source} </span></span>`
            ]]]
          title: |
            [[[
              if ( entity.state == 'off' || !(entity.attributes.title) )
                return ``
              else if ( entity.state == 'playing' || (entity.state == 'on' && entity.attributes.source != 'TV AUDIO') )
                return `<ha-icon
                icon="mdi:form-textbox"
                style="width: 18px; height: 17px; color: deepskyblue;">
                </ha-icon><span> &nbsp; Title: &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: var(--text-color-sensor);">${states['media_player.denon_avr_2113'].attributes.media_title} </span></span>`
              else 
                return ``
            ]]]
          artist: |
            [[[
              if ( entity.state == 'off' || !(entity.attributes.media_artist) )
                return ``
              else
                return `<ha-icon
                icon="mdi:account-voice"
                style="width: 18px; height: 17px; color: deepskyblue;">
                </ha-icon><span> &nbsp; Artist: &nbsp; &nbsp; &nbsp;<span style="color: var(--text-color-sensor);">${states['media_player.denon_avr_2113'].attributes.media_artist} </span></span>`
            ]]]
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MV15
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        color_type: blank-card
      - type: 'custom:button-card'
        entity: media_player.denon_avr_2113
        size: 25px
        name: power
        show_name: false
        show_state: false
        color_type: card
        color: 'rgb(45, 79, 140)'
        state:
          - value: 'off'
            icon: 'mdi:power'
            color: 'rgb(109, 117, 138)'
            styles:
              icon:
                - color: 'rgb(230, 235, 148)'
            tap_action:
              action: call-service
              service: denonavr.get_command
              service_data:
                entity_id: media_player.denon_avr_2113
                command: /goform/formiPhoneAppDirect.xml?MUOFF
          - operator: default
            icon: 'mdi:power-settings'
            styles:
              icon:
                - color: yellow
            tap_action:
              action: call-service
              service: denonavr.get_command
              service_data:
                entity_id: media_player.denon_avr_2113
                command: /goform/formiPhoneAppDirect.xml?MUON
      - type: 'custom:button-card'
        color_type: blank-card
      - type: 'custom:button-card'
        show_name: false
        icon: |
          [[[
            if ( states['media_player.denon_avr_2113'].attributes.is_volume_muted ) return 'mdi:volume-off';
            else return 'mdi:volume-high';
          ]]]
        size: 25px
        color_type: card
        color: 'rgb(45, 79, 140)'
        tap_action:
          action: call-service
          service: script.denon_mute_unmute
      - type: 'custom:button-card'
        icon: 'mdi:volume-minus'
        size: 25px
        color_type: card
        color: 'rgb(45, 79, 140)'
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MVDOWN
        double_tap_action:
          action: call-service
          service: script.denon_vol_decrease
          service_data:
            stepcount: 10
      - type: 'custom:button-card'
        icon: 'mdi:volume-plus'
        size: 25px
        color_type: card
        color: 'rgb(45, 79, 140)'
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MVUP
        double_tap_action:
          action: call-service
          service: script.denon_vol_increase
          service_data:
            stepcount: 10
      - type: 'custom:button-card'
        color_type: blank-card
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        name: 10
        color_type: card
        color: 'rgb(40, 69, 120)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MV10
      - type: 'custom:button-card'
        name: 15
        color_type: card
        color: 'rgb(40, 69, 120)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MV15
      - type: 'custom:button-card'
        name: 20
        color_type: card
        color: 'rgb(40, 69, 120)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MV20
      - type: 'custom:button-card'
        name: 25
        color_type: card
        color: 'rgb(40, 69, 120)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MV25
      - type: 'custom:button-card'
        name: 28
        color_type: card
        color: 'rgb(40, 69, 120)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MV28
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        icon: 'mdi:arrow-up-thick'
        size: 22px
        color_type: card
        color: 'rgb(35, 58, 99)'
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MNCUP
      - type: 'custom:button-card'
        icon: 'mdi:arrow-down-thick'
        size: 22px
        color_type: card
        color: 'rgb(35, 58, 99)'
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MNCDN
      - type: 'custom:button-card'
        icon: 'mdi:arrow-left-thick'
        size: 22px
        color_type: card
        color: 'rgb(35, 58, 99)'
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MNCLT
      - type: 'custom:button-card'
        icon: 'mdi:arrow-right-thick'
        size: 22px
        color_type: card
        color: 'rgb(35, 58, 99)'
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MNCRT
      - type: 'custom:button-card'
        name: Enter
        tooltip: Enter
        Xicon: 'mdi:subdirectory-arrow-right'
        icon: 'mdi:arrow-right-bold-outline'
        size: 22px
        color_type: card
        color: 'rgb(35, 58, 99)'
        show_name: false
        styles:
          name:
            - font-size: 14px
            - padding: 1px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?MNENT
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        name: Fav
        color_type: card
        color: 'rgb(50, 52, 97)'
        styles:
          name:
            - font-size: 16px
            - padding: 3px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?SIFVP
      - type: 'custom:button-card'
        name: iFav
        color_type: card
        color: 'rgb(50, 52, 97)'
        styles:
          name:
            - font-size: 16px
            - padding: 3px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?SIFAVORITES
      - type: 'custom:button-card'
        name: iRadio
        color_type: card
        color: 'rgb(50, 52, 97)'
        styles:
          name:
            - font-size: 16px
            - padding: 3px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?SIIRADIO
      - type: 'custom:button-card'
        name: Recent
        color_type: card
        color: 'rgb(50, 52, 97)'
        styles:
          name:
            - font-size: 16px
            - padding: 3px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?SIIRP
      - type: 'custom:button-card'
        name: TV
        color_type: card
        color: 'rgb(50, 52, 97)'
        styles:
          name:
            - font-size: 16px
            - padding: 3px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?SITV
      - type: 'custom:button-card'
        name: DVD
        color_type: card
        color: 'rgb(50, 52, 97)'
        styles:
          name:
            - font-size: 16px
            - padding: 3px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?SIDVD
      - type: 'custom:button-card'
        name: Tuner
        color_type: card
        color: 'rgb(50, 52, 97)'
        styles:
          name:
            - font-size: 16px
            - padding: 3px 0px
        tap_action:
          action: call-service
          service: denonavr.get_command
          service_data:
            entity_id: media_player.denon_avr_2113
            command: /goform/formiPhoneAppDirect.xml?SITUNER
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        name: Sky
        tooltip: Pop
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 1
      - type: 'custom:button-card'
        name: 538
        tooltip: Pop
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 2
      - type: 'custom:button-card'
        name: 100%NL
        tooltip: Dutch
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 3
      - type: 'custom:button-card'
        name: SLAM
        tooltip: Pop
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 4
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        name: SkyL
        tooltip: Lounge
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 5
      - type: 'custom:button-card'
        name: Arrow Rock
        tooltip: Rock
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 6
      - type: 'custom:button-card'
        name: Splash
        tooltip: Lounge
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 7
      - type: 'custom:button-card'
        name: Antenne
        tooltip: 80s Hits
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 8
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        name: Radio32
        tooltip: Oldies
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 9
      - type: 'custom:button-card'
        name: RTL
        tooltip: Pop
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 10
      - type: 'custom:button-card'
        name: 1Live
        tooltip: Pop
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 11
      - type: 'custom:button-card'
        name: Radio2
        tooltip: Dutch
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 12
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        color_type: blank-card
      - type: 'custom:button-card'
        name: 100% Classic
        tooltip: Cliassic
        color_type: card
        color: 'rgb(30, 45, 71)'
        styles:
          card:
            - height: 34px
          name:
            - font-size: 16px
            - padding: 2px 0px
        tap_action:
          action: call-service
          service: script.denon_favorite_station
          service_data:
            stepcount: 13
      - type: 'custom:button-card'
        color_type: blank-card
  - type: 'custom:button-card'
    color_type: label
    color: var(--primary-color)
    styles:
      card:
        - border-radius: 80%;
        - height: 20px
        - background-image: >-
            linear-gradient(90deg, rgba(13, 44, 99,1) 0%, rgba(9, 34, 79,1) 7%,
            rgba(81, 132, 224,1) 100%)


Below are the scripts used in the panel.

  • mute / unmute the AVR, based on its current status.
  • increase- and decrease volume. Double-click volume up/down will repeatedly send the volume command to the AVR 10x (effectively 5 stops, as the AVR changes 0.5 at a time).
  • selecting a station from the Favorites list. I could not find a command to directly select a specific Favorite station, so I start from the top each time and go down in the list for a specified count to find the desired position in the list. Slow, but it works.

  # Denon AVR - Mute OR Unmute sound (toggle)
  denon_mute_unmute:
    description: Toggle Denon Mute/Unmute status
    sequence:
      - choose:
        # IF Denon is currently MUTED, then unmute
        - conditions: "{{ state_attr('media_player.denon_avr_2113', 'is_volume_muted') }}"
          sequence:
            - service: denonavr.get_command
              data:
                entity_id: media_player.denon_avr_2113
                command: /goform/formiPhoneAppDirect.xml?MUOFF
        # IF Denon is currently UNMUTED, then mute (Note: few seconds delay in state update after change)
        default:
          - service: denonavr.get_command
            data:
              entity_id: media_player.denon_avr_2113
              command: /goform/formiPhoneAppDirect.xml?MUON

  # Denon AVR - Increase the volume by nr of steps provided by parameter
  denon_vol_increase:
    description: Increase Denon volume by specified nr of steps
    fields: 
      stepcount:
        description: Number of UP steps
    variables:
      stepcount: "{{ stepcount | default(2) }}"
    sequence:
      - repeat:
          count: "{{ stepcount }}"
          sequence:
            - delay: 0.1
            - service: denonavr.get_command
              data:
                entity_id: media_player.denon_avr_2113
                command: /goform/formiPhoneAppDirect.xml?MVUP


  # Denon AVR - Decrease the volume by nr of steps provided by parameter
  denon_vol_decrease:
    description: Decrease Denon volume by specified nr of steps
    fields: 
      stepcount:
        description: Number of DOWN steps
    variables:
      stepcount: "{{ stepcount | default(2) }}"
    sequence:
      - repeat:
          count: "{{ stepcount }}"
          sequence:
            - delay: 0.1
            - service: denonavr.get_command
              data:
                entity_id: media_player.denon_avr_2113
                command: /goform/formiPhoneAppDirect.xml?MVDOWN

  # Denon AVR - Favorites + nr of steps down
  denon_favorite_station:
    description: Denon Favorite Station
    fields: 
      stepcount:
        description: Number of DOWN steps
    variables:
      stepcount: "{{ stepcount | default(0) }}"
    sequence:
      - service: denonavr.get_command
        data:
          entity_id: media_player.denon_avr_2113
          command: /goform/formiPhoneAppDirect.xml?SIFAVORITES
      - delay: 2.5
      - repeat:
          count: "{{ stepcount }}"
          sequence:
            - delay: 0.3
            - service: denonavr.get_command
              data:
                entity_id: media_player.denon_avr_2113
                command: /goform/formiPhoneAppDirect.xml?MNCDN
      - delay: 1.5
      - service: denonavr.get_command
        data:
          entity_id: media_player.denon_avr_2113
          command: /goform/formiPhoneAppDirect.xml?MNENT

11 Likes

Hi,

Does anyone have experience with Denon and Google assistant? I’m happy with the app control i currently have, but i would like to add voice control to my setup. All my light are fine, i can play and pauze, but i can’t change source. For example play spotify or play radio.

type: vertical-stack
cards:
  - type: entities
    entities:
      - type: 'custom:mini-media-player'
        entity: media_player.denon_avr_x2400h_2
        name: Woonkamer
        group: true
        source: icon
        info: short
      - type: 'custom:mini-media-player'
        entity: media_player.heos_3_l
        name: Eetkamer
        group: true
        hide:
          power: true
          source: true
        shortcuts:
          buttons:
            - id: 1
              name: Q-Music
              type: favorite
            - id: 2
              name: NPO 1
              type: favorite
            - id: 3
              name: NPO 2
              type: favorite
          columns: 3
  - type: 'custom:spotify-card'
    limit: 4
    spotify_entity: media_player.spotify_fschade
    account: default
    playlist_type: default
    default_device: Denon + Eetkamer
    hide_chromecast_devices: true
    always_play_random_song: true
    display_style: list
    hide_playback_controls: true
    hide_connect_devices: true

2 Likes

Also have an interest in it

Seems the link to the commands xlsx no longer works.
Googled for it, found this updated list: https://www.denon.com/-/media/files/documentmaster/denonna/fy21avr_denon_protocol_v02_04062020.xlsx

-edit: I downloaded the xlsx so I can use it for as long as I own my Denon :wink:

2 Likes