Denon AVR Zone controls via Lovelace

I’ve recently started creating a dashboard for Home Assistant on a tablet. I wanted to be in control of the zones of my Denon AVR4300H, however I was unable to find examples for Home Assistant.

After spending a few hours trying out the CLI (telnet on port 1255) and deprecated webinterface (http on port 80), I found some “homemade” documentation on the “hidden” webinterface of my AVR and figured out how to control the zones, etc. It’s kind of a hacky approach, but since I am by no means a developer, this is fine for now.

Having read tons of discussions on the forum, I thought I should contribute.

The controls, nested grids: (“Stue” = living room, “Køkken” = kitchen)

  • Unfortunately there is, to my knowledge at the time of writing this, no state available. I wouldn’t hammer the “API” for a status, as it would probably down the device.

Configure the services:

  • Replace the IP-address 172.16.16.51 with the IP-address of your AVR
  • Edit configuration.yaml or likewise:
rest_command:
  heos_zone1_on:
    url: "http://172.16.16.51:8080/goform/formiPhoneAppDirect.xml?ZMON"
  heos_zone1_off:
    url: "http://172.16.16.51:8080/goform/formiPhoneAppDirect.xml?ZMOFF"
  heos_zone1_volumeup:
    url: "http://172.16.16.51:8080/goform/formiPhoneAppDirect.xml?MVUP"
  heos_zone1_volumedown:
    url: "http://172.16.16.51:8080/goform/formiPhoneAppDirect.xml?MVDOWN"
  heos_zone2_on:
    url: "http://172.16.16.51:8080/goform/formiPhoneAppDirect.xml?Z2ON"
  heos_zone2_off:
    url: "http://172.16.16.51:8080/goform/formiPhoneAppDirect.xml?Z2OFF"
  heos_zone2_volumeup:
    url: "http://172.16.16.51:8080/goform/formiPhoneAppDirect.xml?Z2UP"
  heos_zone2_volumedown:
    url: "http://172.16.16.51:8080/goform/formiPhoneAppDirect.xml?Z2DOWN"

Lovelace card:

type: vertical-stack
cards:
  - type: media-control
    entity: media_player.stue
  - type: grid
    cards:
      - type: markdown
        content: <center><font size=5px>Stue</font size></center>
      - type: markdown
        content: <center><font size=5px>Køkken</font size></center>
    columns: 2
    square: false
  - type: grid
    cards:
      - type: grid
        cards:
          - type: button
            tap_action:
              action: call-service
              service: rest_command.heos_zone1_on
              service_data: {}
              target: {}
            name: Tænd
            icon: hass:check-circle
            show_name: false
          - type: button
            tap_action:
              action: call-service
              service: rest_command.heos_zone1_off
              service_data: {}
              target: {}
            name: Sluk
            icon: hass:close-circle
            show_name: false
          - type: button
            tap_action:
              action: call-service
              service: rest_command.heos_zone1_volumedown
              service_data: {}
              target: {}
            icon: hass:volume-minus
            show_name: false
          - type: button
            tap_action:
              action: call-service
              service: rest_command.heos_zone1_volumeup
              service_data: {}
              target: {}
            name: stue4
            icon: hass:volume-plus
            show_name: false
        columns: 2
      - type: grid
        cards:
          - type: button
            tap_action:
              action: call-service
              service: rest_command.heos_zone2_on
              service_data: {}
              target: {}
            name: Tænd
            icon: hass:check-circle
            show_name: false
          - type: button
            tap_action:
              action: call-service
              service: rest_command.heos_zone2_off
              service_data: {}
              target: {}
            name: Sluk
            icon: hass:close-circle
            show_name: false
          - type: button
            tap_action:
              action: call-service
              service: rest_command.heos_zone2_volumedown
              service_data: {}
              target: {}
            icon: hass:volume-minus
            show_name: false
          - type: button
            tap_action:
              action: call-service
              service: rest_command.heos_zone2_volumeup
              service_data: {}
              target: {}
            name: stue4
            icon: hass:volume-plus
            show_name: false
        columns: 2
    columns: 2

More commands
See the following document I found, it contains a lot of commands. Simply append the commands to the HTTP GET from my example. It’s probably possible to pass arguments to the service, however I didn’t really care to spend more time on that. Let me know if you have a suggestion in regards to calling services with arguments.

https://www.heimkinoraum.de/upload/files/product/IP_Protocol_AVR-Xx100.pdf

Why dont you use the Denon integration? Then you don’t need rest commands

This is, how it looks with the Denon integration. Works just fine:

I didn’t know it existed, perhaps I should work on my google-fu. Thanks for the tip.

That looks great. I will check it out, thank you for the tip.

1 Like

When I looked at the Denon-integration, I was unable to control the zones individually. I found that enabling each zone was required.

It’s a bit slower than polling the AVR via HTTP-GET, but it has states for power and volume, so it’s a lot better than what I came up with. Thanks again.

1 Like

This was a life saver. I have a Marantz SR-7015 receiver with 3 zones and HEOS music source. I’m trying to integrate into my dashboard. I was trying to turn on the receiver and switch the source to HEOS for the Main and Source 2.

I tried to use the denonavr.get_command with a command and parameter on the end:
/goform/formiPhoneAppDirect.xml?

I spent more than a few hours trying to get it to work. This article was the key.

I put this in the configuration file:

rest_command:

  heos_zone1_on:
    url: "http://192.168.1.16:8080/goform/formiPhoneAppDirect.xml?ZMON"
  heos_zone1_off:
    url: "http://192.168.1.16:8080/goform/formiPhoneAppDirect.xml?ZMOFF"
  heos_zone2_on:
    url: "http://192.168.1.16:8080/goform/formiPhoneAppDirect.xml?Z2ON"
  heos_zone2_off:
    url: "http://192.168.1.16:8080/goform/formiPhoneAppDirect.xml?Z2OFF"
  heos_source_on:
    url: "http://192.168.1.16:8080/goform/formiPhoneAppDirect.xml?SINET"
  heos_source2_on:
    url: "http://192.168.1.16:8080/goform/formiPhoneAppDirect.xml?Z2NET"
  tv_source_on:
    url: "http://192.168.1.16:8080/goform/formiPhoneAppDirect.xml?SIMPLAY"

My Automation Script:

  alias: Turn On Music
  trigger:
    entity_id: input_boolean.music_on
    platform: state
    from: 'off'
    to: 'on'
  action:
  - service: rest_command.heos_zone1_on
  - service: rest_command.heos_zone2_on
  - service: rest_command.heos_source_on
  - service: rest_command.heos_source2_on

I use a helper toggle to trigger from the dashboard.

1 Like