Yamaha AV-Receiver Subwoofer level control

Hello Guys,

if you want to control the subwoofer level like the volume, you need the following:

The Slider for lovelace
input_number:

input_number:
  subwoofer_level:
    name: Subwoofer Level
    min: -6
    max: 6
    step: 0.5
    unit_of_measurement: db

Command to set subwoofer volume
rest_command:

rest_command:
  setsubwooferlevel:
    url: "http://yourAViP/YamahaExtendedControl/v1/main/setSubwooferVolume?volume={{ (states('input_number.subwoofer_level') | float * 2) | int }}"

Subwoofer level status:

sensor:

  - platform: rest
    resource: http://yourAViP/YamahaExtendedControl/v1/main/getStatus
    value_template: '{{ value_json.subwoofer_volume / 2}}'
    name: Subwoofer Level

Set input slider status:

automations.yaml:

 - alias: setSubwooferLevel
   trigger:
    - platform: state
      entity_id: input_number.subwoofer_level
    - platform: homeassistant
      event: start
   condition:
    condition: template
    value_template: "{{ states('input_number.subwoofer_level') | float != states('sensor.subwoofer_level') | float }}"
   action:
    - service: rest_command.setsubwooferlevel

 - alias: getSubwooferLevel
   trigger:
    - platform: state
      entity_id: sensor.subwoofer_level
   condition:
    condition: template
    value_template: "{{ states('sensor.subwoofer_level') | float != states('input_number.subwoofer_level') | float }}"
   action:
    - service: input_number.set_value
      data_template:
        entity_id: input_number.subwoofer_level
        value: "{{ states('sensor.subwoofer_level') | float }}"

This looks like:

If there are any questions, please contact me!

1 Like

Huh. I always assumed it was line level out of the AV receiver and I had to adjust it via the volume pot on the back of the sub. If this works I can have different levels for music and movies without manual adjustment.

Sure you can do this, I have done the same.
I can provide a few samples If you want.

Thanks but there’s enough detail in your post. The problem I have is that I am 5000km away from home, so it’s a little difficult to test (even now that HA supports camera audio feeds). I have bookmarked it for future use.

Is there any reason are you doing this:

  setsubwooferlevel:
    url: "http://yourAViP/YamahaExtendedControl/v1/main/setSubwooferVolume?volume={{ (states('input_number.subwoofer_level') | float * 2) | int }}"

Rather than just using a -12 to 12 input number with a step of 1?

I also added a couple of conditions to be on the safe side:

- alias: 'Set Cinema Subwoofer Level'
  trigger:
  - platform: state
    entity_id: input_number.cinema_subwoofer_level
  - platform: homeassistant
    event: start
  condition:
  - condition: template
    value_template: "{{ states('input_number.cinema_subwoofer_level') != states('sensor.cinema_subwoofer_level') }}"
  - condition: template
    value_template: "{{ states('input_number.cinema_subwoofer_level') not in ['Unknown', 'None', 'Unavailable'] }}"
  action:
  - service: rest_command.set_cinema_subwoofer_level

- alias: 'Get Cinema Subwoofer Level'
  trigger:
  - platform: state
    entity_id: sensor.cinema_subwoofer_level
  condition:
  - condition: template
    value_template: "{{ states('sensor.cinema_subwoofer_level') != states('input_number.cinema_subwoofer_level') }}"
  - condition: template
    value_template: "{{ states('sensor.cinema_subwoofer_level') not in ['Unknown', 'None', 'Unavailable'] }}"
  action:
  - service: input_number.set_value
    data_template:
      entity_id: input_number.cinema_subwoofer_level
      value: "{{ states('sensor.cinema_subwoofer_level')|float }}"

Good morning!

the reason for the rest command with multiplication is the Yamaha API. You can only set INT not FLOAT.
I wanted to have the real actual Subwoofer DB value in HA. This is possible with calculating the Input slider Volume.

1 Like

Thanks, that makes sense.

You’ve opened up a can of worms. I downloaded the API document and am adding controls for all sorts of things. Vocal level, treble, base, DSP decoder selection, base and enhance switches,

Hi,

I wonder if there’s a way to control the settings in the web ui (ipadress/setup). I’m searching for a way to enable and disable arc in hdmi control. Can’t find it in the api.

Check this thread:

If only this option is included in the API you can create your own RestFULL Command to control it in HA. You can also make a switch so the state of the specific setting is reflected in HA as well.

Another place to check is this one:

Not sure how about the RX-V6A model but previous models have a different API for the old style settings menus. Unfortunatelly there is no comprehensive documentation for it. You can capture the ip traffic e.g. using Wireshark to see what exactly is being called there and implement your own RestFULL Commands or shell commands (using curl). All is triggered via http://yamaha_ip_address/YamahaRemoteControl/ctrl call with a proper XML being sent. Below example for a Pure Direct mode switch implementation in HA:

sensor:
  - platform: rest
    resource: http://10.144.1.12/YamahaRemoteControl/ctrl
    method: POST
    payload: '<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><Main_Zone><Sound_Video><Pure_Direct><Mode>GetParam</Mode></Pure_Direct></Sound_Video></Main_Zone></YAMAHA_AV>'
    scan_interval: 15
    name: Yamaha Pure Direct
    value_template: '{{ value_json.YAMAHA_AV.Main_Zone.Sound_Video.Pure_Direct.Mode }}'
switch:
  - platform: template
    switches:
      yamaha_pure_direct:
        friendly_name: "Yamaha Pure Direct"
        value_template: "{{ is_state('sensor.yamaha_pure_direct', 'On') }}"
        turn_on:
          service: rest_command.yamaha_pure_direct_on
        turn_off:
          service: rest_command.yamaha_pure_direct_off
rest_command:
  yamaha_pure_direct_on:
    url: 'http://10.144.1.12/YamahaRemoteControl/ctrl'
    method: POST
    payload: '<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="PUT"><Main_Zone><Sound_Video><Pure_Direct><Mode>On</Mode></Pure_Direct></Sound_Video></Main_Zone></YAMAHA_AV>'
  yamaha_pure_direct_off:
    url: 'http://10.144.1.12/YamahaRemoteControl/ctrl'
    method: POST
    payload: '<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="PUT"><Main_Zone><Sound_Video><Pure_Direct><Mode>Off</Mode></Pure_Direct></Sound_Video></Main_Zone></YAMAHA_AV>'