How to select a scene for Yamaha receiver automation after it's turned on?

I would like to modify my automation to turn on my Yamaha A4A receiver and select Scene 6. I’m unsure how to use the select_scene service found in the documentation.

For context, I’m trying to set this automation up in the visual editor as part of a larger automation for my home theater system.

action:
  - service: yamaha.select_scene
    data:
      scene: Your_Scene_Here # it is case sensitive so be careful with capitalisation
    target:
      entity_id: media_player.your_yamaha_media_player_here

I had not added the following to my configuration.yaml file so I did.

# Example configuration.yaml entry
media_player:
  - platform: yamaha

I restarted HA and got the following error:

Logger: homeassistant.components.media_player
Source: components/yamaha/media_player.py:122
Integration: Media player (documentation, issues)
First occurred: 7:50:03 PM (1 occurrences)
Last logged: 7:50:03 PM

Error while setting up yamaha platform for media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/yamaha/media_player.py", line 145, in async_setup_platform
    receivers = await hass.async_add_executor_job(_discovery, config_info)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/yamaha/media_player.py", line 122, in _discovery
    for recv in rxv.find():
  File "/usr/local/lib/python3.10/site-packages/rxv/__init__.py", line 19, in find
    return [RXV(**ri._asdict()) for ri in ssdp.discover(timeout=timeout)]
  File "/usr/local/lib/python3.10/site-packages/rxv/ssdp.py", line 72, in discover
    res = rxv_details(url)
  File "/usr/local/lib/python3.10/site-packages/rxv/ssdp.py", line 91, in rxv_details
    unit_desc_url_local = res.find(UNITDESC_URL_QUERY).text
AttributeError: 'NoneType' object has no attribute 'text'

  • I have also configured the MusicCast integration, but it does not seem to support the selection of a scene.
  • My receiver is the Yamaha RX-A4A.

Any thoughts?

I have an RX-V679 and have only configured the MusicCast integration. When the amp is turned on I have two entities for its primary zone: media_player.lounge from the MusicCast integration and media_player.lounge_2 from the media_player component. This second entity supports scene selection:

However, media_player.yamaha uses the Python rxv library, and others have reported issues with more recent receivers like your error message suggests. This issue includes a comment from someone with an A6A: Not working with RX-V6A/TSR-700 receiver · Issue #67 · wuub/rxv · GitHub . Perhaps that will help you narrow down a solution…

Alternatively, maybe you could create your scenes in HA and use an automation to set all the parameters via the MusicCast controls?

1 Like

I have an RX-V679 and have only configured the MusicCast integration.

@Troon does this mean that you did not add media_player: - platform: yamaha to your config file? If so, how are you able to call the yamaha: Select scene service? The only way from me to call a yamaha service was to add that entry to my config file during the brief time that the Yamaha Network Receivers integration worked (before HA started spitting the error I mentioned in my original post).

I took a look at the issue you linked. Seems like folks decided to ditch the Yamaha Network Receivers integration and use the MusicCast integration. I know the latter allows you to switch sources, but I do not see a way to switch scenes

If there’s an easier way to select a scene for my receiver in HA I’m all ears. The Yamaha Network Receivers integration seems buggy so I’d rather not use it if possible.

It seems to be auto-discovered: then the service is available.

Same here — I was suggesting that you could define equivalents to scenes (source & processing selections; unrelated to HA’s own Scene feature) within HA, and use automations or scripts to select those.