Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The media_player group implementation doesn't honor the 'announce' option #119939

Open
marcelvandorp opened this issue Jun 18, 2024 · 4 comments
Open

Comments

@marcelvandorp
Copy link

marcelvandorp commented Jun 18, 2024

The problem

This is my first issue report, I hope i do well (enough)...

When I use the announce function on a media player (sonos move 2 device) , it works without any problem: the music is reduced in volume, the announcement follows, and the music returns to the original volume level

When I do exactly the same with a media player group, which has the same sonos device in it, then the music stops and the announcement follows, but then silence. I tried with (originally) two and (later) with one sonos media player in the group, but that doesn't make a difference

__

What version of Home Assistant Core has the issue?

core-2024.6.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

# My group config (in separate file under config/media_players) is

- platform: group
  entities:
    - media_player.move_2_1
    - media_player.move_2_2
  name: Sonos Moves
  unique_id: sonos_moves

# And I test with:

service: media_player.play_media
data:
  announce: true
  media_content_type: music
  media_content_id: /local/test_piper.wav
target:
  entity_id:
    - media_player.sonos_moves

# Everything works fine (on one media_player) when I change that last line to : 

    - media_player.move_2_1

Anything in the logs that might be useful for us?

I first tried this on 2024.5.3, but just repeated the tests on 2024.6.3 with the exact same results

Additional information

I also posted this in the forum, and apparently "The group implementation does not pass through the optional attributes in kwargs like announce", according to a reply from PeteRage

See https://community.home-assistant.io/t/media-player-play-media-use-of-announce-option/426917/7

@mcanteri
Copy link

This issue should be tagged against "the Sonos integration" to be considered, but only the author can do that.

@mcanteri
Copy link

mcanteri commented Jul 16, 2024

I tried in the past the following simple setup, where one station is running on the Nest by automation:

service: media_player.play_media
target:
  entity_id: media_player.nest_mini_2
data:
  media_content_id: media-source://radio_browser/dd96c72f-3fbd-4bf7-b332-3882cc69bd6d
  media_content_type: audio/aac
metadata:
  title: " La Top 102.9 FM - San Pedro Sula, Honduras"
  thumbnail: >-
    https://d32139y4w3ahij.cloudfront.net/wp-content/uploads/2021/02/LA-TOP-102.9.png
  media_class: music
  children_media_class: null
  navigateIds:
    - {}
    - media_content_type: app
      media_content_id: media-source://radio_browser
    - media_content_type: music
      media_content_id: media-source://radio_browser/tag
    - media_content_type: music
      media_content_id: media-source://radio_browser/tag/español

and an announcement will come like this:

data:
  announce: true
  media_content_type: music
  media_content_id: media-source://tts/google_translate?message=Have a good day!
target:
  entity_id:
    - media_player.nest_mini_2

but in my case, the attribute announce never worked. So neither is the case with groups (that I have).

@marcelvandorp
Copy link
Author

Well, I redid my tests.

While I'm listening to onlline radio (either started in the Sonos app or started through HA), I do the following tests:

When I select the sonos move 2 directly (media_player.move_2_1), the announce function works nicely. That is: music lowers in volume, the announcement plays, and the music is resumed at the old volume level.

When I go to media -> Text-to-speech -> picoTTS, put in some text and at the bottom select 'move_2_1' as the output channel, the announce function works correct too. I do not have an option to enable/disable "announce", but still the text is output as an announcement (music still playing on a lower volume during the speech output).

When I go to media -> Text-to-speech -> piper, put in some text and at the bottom select 'move_2_1' as the output channel, the announce function works correct too (same as with picoTTS).

When I repeat the last two tests with the target a media_group, then the music goes off, the announcement plays, and that's it. So my conclusion is that the announce option is not honored by the media group construct.

@mcanteri
Copy link

Okay, so at least Sonos honours that parameter while Google Nest doesn't.
Are you able to add a Label (Sonos integration) to the issue like they were asking in the community thread?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants