Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 109024

Select Radio MP3 stream (in a way similar to selecting playlists, without specifying which speakers to use)

$
0
0

media_player_example_v01

With the ytube_music_player I can easily select which speakers (or groups) to use (media_player.select_source), and it is also easy to select the playlist (entity_id: media_player.ytube_music_player, media_content_id: PLxxxxx, media_content_type: playlist), and no need for Helpers, and each can be chosen independantly (when I set a playlist I do not need to respecify which speakers I already selected for playing when switching to another playlist, or change speaker without respecifying the playlist. All great :slight_smile:

How do I do that for a radio/mp3 music stream (without specifying which speakers I have already selected)?

I would like it if it could work something like this:

type: custom:mushroom-template-card
primary: QMusic 80's
icon: mdi:radio
tap_action:
  action: call-service
  service: media_player.play_media
  service_data:
    **entity_id: "{{ state_attr('media_player.ytube_music_player', 'remote_player_id') }}"**
    media_content_id: https://icecast-qmusicnl-cdp.triple-it.nl/Qmusic_nl_fouteuur_96.mp3
    media_content_type: music

I am fine with using a different media_player (I understand the one I use now is focussed on YouTube Music). Only the dynamic setting of the speaker isn’t working in the code above. I like code to be self contained as much as possible (no helpers/automations if it can be avoided) How do I chose a radio mp3 stream without saying explicitly which speaker (google cast) entities to use? (for example by using the attribute value: remote_player_id, of: media_player.ytube_music_player, which contains the chosen speaker)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 109024

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>