Support BBC Sounds app in Media Player

When a a google display is playing BBC sounds the state is shown as:

volume_level: 0.6000000238418579
is_volume_muted: false
media_content_id: bbc_radio_fourfm
media_content_type: music
media_position: 3653.751915
media_position_updated_at: '2021-01-25T10:42:54.777990+00:00'
media_title: BBC Radio 4
app_id: 03977A48
app_name: BBC Sounds
entity_picture_local: >-
  /api/media_player_proxy/media_player.kitchen_display?token=xxxxx&cache=xxxxxxda
friendly_name: Kitchen display
entity_picture: 'https://sounds.files.bbci.co.uk/2.2.8/networks/bbc_radio_four/colour_450.png'
supported_features: 152461

However attempting to start this app via a service call is unsuccessful.

alias: Play BBC Radio 4
sequence:
  - service: media_player.play_media
    data:
      media_content_type: cast
      media_content_id: ' { "app_name": "BBC Sounds", "media_content_id": "bbc_radio_fourfm" }'
    entity_id: media_player.kitchen_display
mode: single
2021-01-25 11:40:45 ERROR (SyncWorker_4) [homeassistant.components.cast.media_player] App BBC Sounds not supported

I’ve been looking at this too, did you find a solution? Currently I’m using 'x-mpegurl’s I found on another thread but you don’t get the cover art or meta data obviously which is a shame.

@Smiley1244 / @traylenator - I recently had a PR merged that implements this (and BBC iPlayer). It should be in the next release.

Point of note, metadata doesn’t get automatically picked up by casting, it is sent from the casting app. So to get that showing you will have to provide it yourself when you call the service (docs will be updated with examples once the feature is live).

Brilliant, I’ll keep an eye out and give it a try.
Understood about meta, I’m currently setting the cover in the Lovelace card with the manual feeds.

This has now been released (as of 2021.7.0). Check the Cast documentation for examples.

Wow. Will give it a spin in next few days.

This is so cool, thank you! Have you managed to get PM working? For me I get the cast noise on the nest mini but then nothing plays (it says BBC Sounds on the media card)

Not tried it, but I think the mediaId you have there is for the program, whereas you need to provide the one for the individual episode.

PM - 15/12/2021 - BBC Sounds being m0012fp8 I would imagine.

Not very convenient for playing something with lots of episodes compared to a radio station.

Thank you! I’ve always been seeking a way to play the on-demand episode stuff from the BBC in the same way you can with Spotify playlists etc - it’s never really been possible, even with the BBC voice assistant skills they’re based around playing live radio rather than on demand episodes. Can you see any way that this could be implemented? Maybe pulling a list of episodes in somehow that could be selected from a dynamic input_select?

Hello, is this still working for people? When I follow the radio 1 example in the docs the cast “chime” plays on the best hub but no media plays and I get the error below:


Logger: pychromecast.socket_client
Source: /usr/local/lib/python3.9/site-packages/pychromecast/socket_client.py:726 
First occurred: 14:02:24 (2 occurrences) 
Last logged: 14:44:49

[Kitchen Display(192.168.68.109):8009] Exception caught while sending message to controller ReceiverController: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 3765, 'status': {'applications': [{'appId': '03977A48', 'appType': 'WEB', 'displayName': 'BBC Sounds', 'iconUrl': 'https://lh3.googleusercontent.com/e0FlVyzbXhfUTBf0FPjSLulqvj3mVezQHIn6XQEs-DXwXG9QjNDY13sUl_PLZlypfMLb6W6hRfAvsgHX', 'isIdleScreen': False, 'launchedFromCloud': False, 'namespaces': [{'name': 'urn:x-cast:com.google.cast.debugoverlay'}, {'name': 'urn:x-cast:com.google.cast.cac'}, {'name': 'urn:x-cast:com.google.cast.broadcast'}, {'name': 'urn:x-cast:com.google.cast.media'}, {'name': 'urn:x-cast:uk.co.bbc.cast'}], 'sessionId': '8db2c4e0-543f-4f26-b0b1-f6a0950f6a32', 'statusText': 'BBC Sounds', 'transportId': '8db2c4e0-543f-4f26-b0b1-f6a0950f6a32', 'universalAppId': '03977A48'}], 'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 4, 'peaking_eqs': []}, 'volume': {'controlType': 'attenuation', 'level': 0.6000000238418579, 'muted': False, 'stepInterval': 0.05000000074505806}}, 'type': 'RECEIVER_STATUS'}
[Kitchen Display(192.168.68.109):8009] Exception caught while sending message to controller ReceiverController: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 103, 'status': {'applications': [{'appId': '03977A48', 'appType': 'WEB', 'displayName': 'BBC Sounds', 'iconUrl': 'https://lh3.googleusercontent.com/e0FlVyzbXhfUTBf0FPjSLulqvj3mVezQHIn6XQEs-DXwXG9QjNDY13sUl_PLZlypfMLb6W6hRfAvsgHX', 'isIdleScreen': False, 'launchedFromCloud': False, 'namespaces': [{'name': 'urn:x-cast:com.google.cast.debugoverlay'}, {'name': 'urn:x-cast:com.google.cast.cac'}, {'name': 'urn:x-cast:com.google.cast.broadcast'}, {'name': 'urn:x-cast:com.google.cast.media'}, {'name': 'urn:x-cast:uk.co.bbc.cast'}], 'sessionId': '5f564fb2-4d25-4e1c-9387-88ab0183e9b8', 'statusText': 'BBC Sounds', 'transportId': '5f564fb2-4d25-4e1c-9387-88ab0183e9b8', 'universalAppId': '03977A48'}], 'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 4, 'peaking_eqs': []}, 'volume': {'controlType': 'attenuation', 'level': 0.6000000238418579, 'muted': False, 'stepInterval': 0.05000000074505806}}, 'type': 'RECEIVER_STATUS'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pychromecast/socket_client.py", line 714, in _route_message
    handled = handler.receive_message(message, data)
  File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/receiver.py", line 106, in receive_message
    self._process_get_status(data)
  File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/receiver.py", line 237, in _process_get_status
    self.app_launch_event_function()
  File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/__init__.py", line 85, in <lambda>
    callback_function=lambda: self.send_message_nocheck(
  File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/__init__.py", line 99, in send_message_nocheck
    self._message_func(self.namespace, data, inc_session_id, callback_function)
TypeError: 'NoneType' object is not callable

Hi @blawford - I’ve opened an issue for this FYI