Szybkie porady Artura - Robimy sobie radio - problem?

Kilka postów wyżej masz całą konfigurację ¦

Niestety nie widzę, może dla kogoś kto jest biegły w tych konfiguracjach jest to oczywiste, niestety dla mnie nie. Mam taką konfigurację w karcie, czy tu musze jakoś dodać kolejny media_player?

entity: media_player.nesthub7b5e
name: Radio FM
shortcuts:
  buttons:
    - id: http://ext03.ic.smcdn.pl:8000/2420-1.mp3
      name: ESKA
      type: music
    - id: http://play.strefa.fm:8000/stream
      name: PTB
      type: music
type: custom:mini-media-player

Jak to zrobić:
https://forum.arturhome.pl/t/szybkie-porady-artura-robimy-sobie-radio-problem/202/75?u=artpc

O konfiguracji Packages czytaj tu https://forum.arturhome.pl/t/package-w-home-assistant/707 @macek

Podziękowania dla użytkownika Kabala Cata z forum HA za udostępnienie kodu.

Nowy styl Obsługi Radia Mushroom Cards
Screenshot - 26.10.2022 , 00_59_19

Kod packages: https://pastebin.com/4nU2bFqS

Kod Karty :

type: custom:stack-in-card
mode: vertical
keep:
  box_shadow: true
  border_radius: true
  margin: true
  outer_padding: true
  background: true
cards:
  - type: vertical-stack
    cards:
      - type: conditional
        conditions:
          - entity: media_player.pokoj_dzienny
            state_not: 'off'
        card:
          type: custom:mini-media-player
          style: |
            :host {
              --mini-media-player-name-font-weight: 500;
              --mini-media-player-artwork-opacity: 1;
              --mini-media-player-media-cover-info-color: white;
              --mini-media-player-overlay-base-color: #2196f3;
            }
          entity: media_player.pokoj_dzienny
          info: scroll
          artwork: cover
          volume_stateless: false
          toggle_power: true
          hide:
            runtime_remaining: false
            runtime: false
            info: false
            power: true
            power_state: false
            progress: false
            source: false
            play_stop: true
            volume_level: false
            controls: true
            volume: true
            icon: true
            name: false
      - type: conditional
        conditions:
          - entity: media_player.artur_s_echo_show
            state_not: standby
        card:
          type: custom:mini-media-player
          style: |
            :host {
              --mini-media-player-name-font-weight: 500;
              --mini-media-player-artwork-opacity: 1;
              --mini-media-player-media-cover-info-color: white;
              --mini-media-player-overlay-base-color: #2196f3;
            }
          entity: media_player.artur_s_echo_show
          info: scroll
          artwork: cover
          volume_stateless: false
          toggle_power: true
          hide:
            runtime_remaining: false
            runtime: false
            info: false
            power: true
            power_state: false
            progress: false
            source: false
            play_stop: true
            volume_level: false
            controls: true
            volume: true
            icon: true
            name: false
      - type: conditional
        conditions:
          - entity: media_player.googlehome4300
            state: playing
        card:
          type: custom:mini-media-player
          style: |
            :host {
              --mini-media-player-name-font-weight: 500;
              --mini-media-player-artwork-opacity: 1;
              --mini-media-player-media-cover-info-color: white;
              --mini-media-player-overlay-base-color: #2196f3;
            }
          entity: media_player.googlehome4300
          info: scroll
          artwork: cover
          volume_stateless: false
          toggle_power: true
          hide:
            runtime_remaining: false
            runtime: false
            info: false
            power: true
            power_state: false
            progress: false
            source: false
            play_stop: true
            volume_level: false
            controls: true
            volume: true
            icon: true
            name: false
      - type: conditional
        conditions:
          - entity: media_player.artur_s_echo_dot
            state: playing
        card:
          type: custom:mini-media-player
          style: |
            :host {
              --mini-media-player-name-font-weight: 500;
              --mini-media-player-artwork-opacity: 1;
              --mini-media-player-media-cover-info-color: white;
              --mini-media-player-overlay-base-color: #2196f3;
            }
          entity: media_player.artur_s_echo_dot
          info: scroll
          artwork: cover
          volume_stateless: false
          toggle_power: true
          hide:
            runtime_remaining: false
            runtime: false
            info: false
            power: true
            power_state: false
            progress: false
            source: false
            play_stop: true
            volume_level: false
            controls: true
            volume: true
            icon: true
            name: false
  - square: false
    columns: 4
    type: grid
    cards:
      - type: custom:mushroom-template-card
        style: |
          :host { 
            --primary-text-color: 
            {% if is_state('input_select.chromecast_radio', 'Lazienka')%} #2196f3
            {% else %} #9e9e9e
            {% endif %}
            }
        secondary: ''
        icon: mdi:shower-head
        entity: media_player.pokoj_dzienny
        primary: Łazienka
        multiline_secondary: true
        icon_color: >-
          {{ is_state("input_select.chromecast_radio", "Lazienka") | iif("blue",
          "disabled") }}
        tap_action:
          action: call-service
          service: input_select.select_option
          service_data:
            option: Lazienka
          target:
            entity_id: input_select.chromecast_radio
        fill_container: true
        hold_action:
          action: more-info
        layout: vertical
      - type: custom:mushroom-template-card
        style: |
          :host { 
            --primary-text-color: 
            {% if is_state('input_select.chromecast_radio', 'Kuchnia')%} #2196f3
            {% else %} #9e9e9e
            {% endif %}
            }
        secondary: ''
        icon: mdi:silverware-fork-knife
        entity: media_player.artur_s_echo_show
        primary: Kuchnia
        multiline_secondary: true
        icon_color: >-
          {{ is_state("input_select.chromecast_radio", "Kuchnia") | iif("blue",
          "disabled") }}
        tap_action:
          action: call-service
          service: input_select.select_option
          service_data:
            option: Kuchnia
          target:
            entity_id: input_select.chromecast_radio
        fill_container: true
        layout: vertical
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        style: |
          :host { 
            --primary-text-color: 
            {% if is_state('input_select.chromecast_radio', 'Salon')%} #2196f3
            {% else %} #9e9e9e 
            {% endif %}
            }
        secondary: ''
        icon: mdi:television-classic
        entity: media_player.googlehome4300
        primary: Salon
        multiline_secondary: true
        icon_color: >-
          {{ is_state("input_select.chromecast_radio", "Salon") | iif("blue",
          "disabled") }}
        tap_action:
          action: call-service
          service: input_select.select_option
          service_data:
            option: Salon
          target:
            entity_id: input_select.chromecast_radio
        fill_container: true
        layout: vertical
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        style: |
          :host { 
            --primary-text-color: 
            {% if is_state('input_select.chromecast_radio', 'Salon Alexa')%} #2196f3
            {% else %} #9e9e9e
            {% endif %}
            }
        secondary: ''
        icon: mdi:laptop
        entity: media_player.artur_s_echo_dot
        primary: Salon Alexa
        multiline_secondary: true
        icon_color: >-
          {{ is_state("input_select.chromecast_radio", "Salon Alexa") |
          iif("blue", "disabled") }}
        tap_action:
          action: call-service
          service: input_select.select_option
          service_data:
            option: Salon Alexa
          target:
            entity_id: input_select.chromecast_radio
        fill_container: true
        layout: vertical
        hold_action:
          action: more-info
  - type: entities
    entities:
      - type: custom:fold-entity-row
        padding: 0
        style:
          ha-icon:
            $: |
              ha-svg-icon {
               color: #ff5722;
                }
        head:
          type: custom:button-card
          name: Polskie Stacje Radiowe
          tap_action:
            action: none
          styles:
            card:
              - margin-bottom: 0px
              - padding-bottom: 0px
              - padding-top: 0px
              - box-shadow: none
            name:
              - justify-self: start
              - padding-left: 8px
              - font-size: 15px
              - font-weight: bold
              - color: '#795548'
        entities:
          - type: custom:mushroom-chips-card
            card_mod:
              style: |
                ha-card {
                  --chip-border-radius: 12px;
                  --primary-text-color: grey;
                }
            chips:
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "RMF FM") |
                  iif("blue", "disabled") }}
                content: RMF FM
                icon: >-
                  {{ is_state("input_select.radio_station", "RMF FM") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: RMF FM
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "Meloradio") |
                  iif("blue", "disabled") }}
                content: Meloradio
                icon: >-
                  {{ is_state("input_select.radio_station", "Meloradio") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: Meloradio
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "RadioZET") |
                  iif("blue", "disabled") }}
                content: RadioZET
                icon: >-
                  {{ is_state("input_select.radio_station", "RadioZET") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: RadioZET
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "Eska") |
                  iif("blue", "disabled") }}
                content: Eska
                icon: >-
                  {{ is_state("input_select.radio_station", "Eska") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: Eska
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "Na Cały Dzień") |
                  iif("blue", "disabled") }}
                content: Na Cały Dzień
                icon: >-
                  {{ is_state("input_select.radio_station", "Na Cały Dzień") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: Na Cały Dzień
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "MagicFM") |
                  iif("blue", "disabled") }}
                content: Magic FM
                icon: >-
                  {{ is_state("input_select.radio_station", "MagicFM") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: MagicFM
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "Rock Radio") |
                  iif("blue", "disabled") }}
                content: Rock Radio
                icon: >-
                  {{ is_state("input_select.radio_station", "Rock Radio") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: Rock Radio
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "RadioMedias") |
                  iif("blue", "disabled") }}
                content: Radio Medias
                icon: >-
                  {{ is_state("input_select.radio_station", "RadioMedias") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: RadioMedias
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "RadioPetrecere") |
                  iif("blue", "disabled") }}
                content: Radio Petrecere
                icon: >-
                  {{ is_state("input_select.radio_station", "RadioPetrecere") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: RadioPetrecere
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "NationalFM") |
                  iif("blue", "disabled") }} 
                content: National FM
                icon: >-
                  {{ is_state("input_select.radio_station", "NationalFM") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: NationalFM
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "WefunkRadio") |
                  iif("blue", "disabled") }}
                content: WeFunk Radio
                icon: >-
                  {{ is_state("input_select.radio_station", "WefunkRadio") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: WefunkRadio
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "FunkyRadio") |
                  iif("blue", "disabled") }}
                content: Funky Radio
                icon: >-
                  {{ is_state("input_select.radio_station", "FunkyRadio") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: FunkyRadio
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "Open FM-Praca") |
                  iif("blue", "disabled") }}
                content: Open FM-Praca
                icon: >-
                  {{ is_state("input_select.radio_station", "Open FM-Praca") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: Open FM-Praca
                  target:
                    entity_id: input_select.radio_station
            alignment: null
  - type: entities
    entities:
      - type: custom:fold-entity-row
        padding: 0
        style:
          ha-icon:
            $: |
              ha-svg-icon {
               color: #ff5722;
                }
        head:
          type: custom:button-card
          name: Lokalne
          tap_action:
            action: none
          styles:
            card:
              - margin-bottom: 0px
              - padding-bottom: 0px
              - padding-top: 0px
              - box-shadow: none
            name:
              - justify-self: start
              - padding-left: 8px
              - font-size: 15px
              - font-weight: bold
              - color: '#795548'
        entities:
          - type: custom:mushroom-chips-card
            card_mod:
              style: |
                ha-card {
                  --chip-border-radius: 12px;
                  --primary-text-color: grey;
                }
            chips:
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "P1") | iif("blue",
                  "disabled") }}
                content: P1
                icon: >-
                  {{ is_state("input_select.radio_station", "P1") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: P1
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "P2") | iif("blue",
                  "disabled") }}
                content: P2
                icon: >-
                  {{ is_state("input_select.radio_station", "P2") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: P2
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "P3") | iif("blue",
                  "disabled") }}
                content: P3
                icon: >-
                  {{ is_state("input_select.radio_station", "P3") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: P3
                  target:
                    entity_id: input_select.radio_station
              - type: template
                entity: input_select.radio_station
                icon_color: >-
                  {{ is_state("input_select.radio_station", "P4") | iif("blue",
                  "disabled") }}
                content: P4
                icon: >-
                  {{ is_state("input_select.radio_station", "P4") |
                  iif("mdi:checkbox-blank-circle",
                  "mdi:checkbox-blank-circle-outline") }}
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    option: P4
                  target:
                    entity_id: input_select.radio_station
  - type: custom:mushroom-chips-card
    chips:
      - type: action
        icon_color: blue
        icon: mdi:play
        tap_action:
          action: call-service
          service: script.radio
          service_data: {}
          target: {}
      - type: action
        icon_color: deep-orange
        icon: mdi:stop
        tap_action:
          action: call-service
          service: script.radiostop
          service_data: {}
          target: {}
      - type: action
        tap_action:
          action: call-service
          service: input_number.decrement
          service_data: {}
          target:
            entity_id: input_number.volume_radio
        icon: mdi:volume-minus
        icon_color: grey
      - type: template
        card_mod: null
        content: >-
          {{ state_attr('media_player.googlehome4300', 'volume_level') |
          round(2,default="0") }}
        style: |
          ha-card {
              box-shadow: 0px 0px;
          }
      - type: action
        icon: mdi:volume-plus
        tap_action:
          action: call-service
          service: input_number.increment
          service_data: {}
          target:
            entity_id: input_number.volume_radio
        icon_color: grey
  - type: custom:mushroom-entity-card
    entity: input_number.volume_radio
  - type: custom:my-slider
    entity: input_number.volume_radio
    height: 20px
    mainSliderColor: '#7dbde8'
    secondarySliderColor: '#f2590c'
    thumbWidth: 5px
    thumbHeight: 30px
    thumbColor: black
    thumbHorizontalPadding: 0px
    thumbVerticalPadding: 0px

Do obsługi suwaka wymagany custom:my-slider
https://github.com/AnthonMS/my-cards

1 polubienie

Super robota ! już widzę u siebie modyfikację i poprawę tego co mam u siebie :slight_smile:
Pytanie dodatkowe - co to są “Lokalne” ? jakieś lokalne odtwarzacze czy jak ?

PS
trochę nieścisłości jest w samym kodzie :slight_smile: - np masz tutja radio MagicFM ale nie ma do niego odwołania, podobnie z RockRadio, za to w odnośnikach jest AntyRadio ale nie ma w wyborze. oczywiście dla mnie no problemo sobie przerobiłem, ale może ktoś za chwile pytac o to :slight_smile:

Nie uzupełnione więc nic tam niema, możesz dodać tam jakieś inne stacje. Kod nie uzupełniony bo każdy i tak musi pod siebie ustawić.

OK :slight_smile: myślałem że to jakieś znowu fajne opcje o których zwykły śmiertelnicy jak ja nie mają pojęcia :slight_smile:
aktualnie modyfikuję aby nie korzystać z mushroom bo jakoś osobiście nie przepadam więc później wrzucę podobne rozwiązanie (bo jest zajebiste!!) dla innych.

EDIT:
dla potomnych jeżeli ktoś nie przepada za Mushroom - poniżej oparte na Custom:button-card:

oczywiście całość zawiera dużo więcej odtwarzaczy jak na screenie, w zależności od uruchomienia więc trzeba dostosować pod siebie.


button_card_templates:
  audio_wybor_glosnika:
    template:
      - ta_powiekszenie
    type: custom:button-card
    name: '[[[ return variables.nazwa ]]]'
    icon: '[[[ return variables.ikona ]]]'
    variables:
      wysokosc: 70px
      ikona: mdi:speaker
      wybrany_glosnik: input_select.audio_select
    triggers_update: all
    show_last_changed: false
    tap_action:
      action: call-service
      service: input_select.select_option
      service_data:
        entity_id: input_select.audio_select
        option: '[[[ return variables.nazwa ]]]'
    state:
      - value: unavailable
        styles:
          icon:
            - color: grey
    styles:
      icon:
        - color: >
            [[[ if (states[variables.wybrany_glosnik].state == variables.nazwa )
            return 'rgba(255, 214, 10, 1)'
                else return 'var(--state-icon-color)'; ]]]
        - border: >
            [[[ if (states[variables.wybrany_glosnik].state == variables.nazwa )
            return 'rgba(255, 214, 10, 1)'
                else return 'var(--state-icon-color)'; ]]]
      grid:
        - grid-template-areas: '"i" "n"'
        - grid-template-rows: 1fr min-content
      card:
        - height: '[[[ return variables.wysokosc ]]]'
        - background-color: rgba(0, 0, 0, 0.1)
        - padding: 5px 5%
        - border: >
            [[[ if (states[variables.wybrany_glosnik].state == variables.nazwa )
            return 'solid 1px deepskyblue'; else return ''; ]]]
        - box-shadow: >
            [[[ if (states[variables.wybrany_glosnik].state == variables.nazwa )
            return '0 0 0.95rem 0.01rem deepskyblue'; else return ''; ]]]
      name:
        - color: '#9e9e9e'
        - font-size: 80%
        - white-space: normal
  audio_wybor_radia:
    template:
      - ta_powiekszenie
    type: custom:button-card
    name: '[[[ return variables.nazwa ]]]'
    icon: '[[[ return variables.ikona ]]]'
    variables:
      wysokosc: 30px
      ikona: mdi:checkbox-blank-circle-outline
      wybor: null
    show_last_changed: false
    tap_action:
      action: call-service
      service: input_select.select_option
      service_data:
        entity_id: input_select.radio_station
        option: >
          [[[ if (variables.wybor == null) return variables.nazwa; else return
          variables.wybor  ]]]  
    state:
      - value: '[[[ return variables.nazwa ]]]'
        styles:
          card:
            - box-shadow: 0 0 0.95rem 0.01rem deepskyblue
          icon:
            - color: rgba(255, 214, 10, 1)
        icon: mdi:checkbox-blank-circle
      - value: '[[[ return variables.wybor ]]]'
        styles:
          card:
            - box-shadow: 0 0 0.95rem 0.01rem deepskyblue
          icon:
            - color: rgba(255, 214, 10, 1)
        icon: mdi:checkbox-blank-circle
    layout: icon_name
    styles:
      grid:
        - grid-template-columns: 25%
      icon:
        - color: '#9e9e9e'
      card:
        - height: '[[[ return variables.wysokosc ]]]'
        - background-color: rgba(0, 0, 0, 0.1)
      name:
        - color: '#9e9e9e'
        - font-size: 70%
        - white-space: normal
  audio_przyciski:
    template:
      - ta_powiekszenie
    type: custom:button-card
    name: '[[[ return variables.nazwa ]]]'
    icon: '[[[ return variables.ikona ]]]'
    variables:
      ikona: mdi:checkbox-blank-circle-outline
      kolor: white
    show_last_changed: false
    show_name: false
    color: auto
    show_icon: true
    tap_action:
      action: call-service
    layout: icon
    styles:
      grid:
        - grid-template-areas: '"i"'
      icon:
        - height: 50%
        - width: 50%
        - color: '[[[ return variables.kolor ]]]'
      card:
        - border-radius: 50%
        - width: min(50vw, 60px)
        - height: min(50vw, 60px)
        - background-color: rgba(0, 0, 0, 0.1)
  ta_powiekszenie:
    style: |
      ha-card:hover {transform: scale(1.05);box-shadow: 0 0 10px;} 

no i oczywiście wkładka do dashboard:

type: vertical-stack
cards:
  - square: false
    columns: 1
    type: grid
    cards:
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.spotify_marcin
            state_not: idle
        card:
          artwork: cover
          type: custom:mini-media-player
          info: scroll
          entity: media_player.spotify_marcin
          source: full
          volume_stateless: false
          group: false
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.spotify_julia
            state_not: idle
        card:
          artwork: cover
          type: custom:mini-media-player
          info: scroll
          entity: media_player.spotify_julia
          source: full
          volume_stateless: false
          group: false
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.spotify_oliwia
            state_not: idle
        card:
          artwork: cover
          type: custom:mini-media-player
          info: scroll
          entity: media_player.spotify_oliwia
          source: full
          volume_stateless: false
          group: false
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.kuchnia
            state_not: 'off'
          - entity: media_player.kuchnia
            state_not: unavailable
        card:
          type: custom:mini-media-player
          entity: media_player.kuchnia
          info: scroll
          hide:
            controls: true
          group: true
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.biuro
            state_not: 'off'
          - entity: media_player.biuro
            state_not: unavailable
        card:
          type: custom:mini-media-player
          entity: media_player.biuro
          info: scroll
          hide:
            controls: true
          group: true
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.julia
            state_not: 'off'
          - entity: media_player.julia
            state_not: unavailable
        card:
          type: custom:mini-media-player
          entity: media_player.julia
          info: scroll
          hide:
            controls: true
          group: true
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.oliwia
            state_not: 'off'
          - entity: media_player.oliwia
            state_not: unavailable
        card:
          type: custom:mini-media-player
          entity: media_player.oliwia
          info: scroll
          hide:
            controls: true
          group: true
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.sypialnia
            state_not: 'off'
          - entity: media_player.sypialnia
            state_not: unavailable
        card:
          type: custom:mini-media-player
          entity: media_player.sypialnia
          info: scroll
          hide:
            controls: true
          group: true
      - type: conditional
        condition: and
        conditions:
          - entity: media_player.salon_music
            state_not: 'off'
          - entity: media_player.salon_music
            state_not: unavailable
        card:
          type: custom:mini-media-player
          entity: media_player.salon_music
          info: scroll
          hide:
            controls: true
          group: true
  - square: false
    columns: 6
    type: grid
    cards:
      - type: custom:button-card
        template:
          - audio_wybor_glosnika
        variables:
          nazwa: Kuchnia
          ikona: mdi:silverware-fork-knife
        entity: media_player.kuchnia
      - type: custom:button-card
        template:
          - audio_wybor_glosnika
        variables:
          nazwa: Biuro
          ikona: mdi:desk
        entity: media_player.biuro
      - type: custom:button-card
        template:
          - audio_wybor_glosnika
        variables:
          nazwa: Julia
          ikona: mdi:face-woman
        entity: media_player.julia
      - type: custom:button-card
        template:
          - audio_wybor_glosnika
        variables:
          nazwa: Oliwia
          ikona: mdi:face-woman
        entity: media_player.oliwia
      - type: custom:button-card
        template:
          - audio_wybor_glosnika
        variables:
          nazwa: Sypialnia
          ikona: mdi:bed
        entity: media_player.sypialnia
      - type: custom:button-card
        template:
          - audio_wybor_glosnika
        variables:
          nazwa: Amplituner
          ikona: mdi:music-box-multiple
        entity: media_player.salon_music
  - type: entities
    entities:
      - type: custom:fold-entity-row
        padding: 0
        open: true
        style:
          ha-icon:
            $: |
              ha-svg-icon {
               color: #ff5722;
                }
        head:
          type: custom:button-card
          name: Spotify
          tap_action:
            action: none
          styles:
            card:
              - margin-bottom: 0px
              - padding-bottom: 0px
              - padding-top: 0px
              - box-shadow: none
            name:
              - justify-self: start
              - padding-left: 8px
              - font-size: 15px
              - font-weight: bold
              - color: '#795548'
        entities:
          - type: custom:layout-card
            clayout: vertical
            cards:
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Daily Mix 1
                  wybor: Spotify Daily Mix 1
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Daily Mix 2
                  wybor: Spotify Daily Mix 2
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Daily Mix 3
                  wybor: Spotify Daily Mix 3
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Daily Mix 4
                  wybor: Spotify Daily Mix 4
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Spotify Trening
                  wybor: Spotify Trening 2022
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Uśmiechnij się
                  wybor: Spotify Uśmiechnij się
                entity: input_select.radio_station
      - type: custom:fold-entity-row
        padding: 0
        style:
          ha-icon:
            $: |
              ha-svg-icon {
               color: #ff5722;
                }
        head:
          type: custom:button-card
          name: Radia klasyczne
          tap_action:
            action: none
          styles:
            card:
              - margin-bottom: 0px
              - padding-bottom: 0px
              - padding-top: 0px
              - box-shadow: none
            name:
              - justify-self: start
              - padding-left: 8px
              - font-size: 15px
              - font-weight: bold
              - color: '#795548'
        entities:
          - type: custom:layout-card
            clayout: vertical
            cards:
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: RMF FM
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: RMF MAXX
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: RMF Classisc
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: AntyRadio
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Classisc Rock
                  wybor: Absolute Radio Classisc Rock
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Meloradio
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Muzo Radio
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: RadioZET
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: ChilliZet
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Eska
                entity: input_select.radio_station
      - type: custom:fold-entity-row
        padding: 0
        style:
          ha-icon:
            $: |
              ha-svg-icon {
               color: #ff5722;
                }
        head:
          type: custom:button-card
          name: Open FM
          tap_action:
            action: none
          styles:
            card:
              - margin-bottom: 0px
              - padding-bottom: 0px
              - padding-top: 0px
              - box-shadow: none
            name:
              - justify-self: start
              - padding-left: 8px
              - font-size: 15px
              - font-weight: bold
              - color: '#795548'
        entities:
          - type: custom:layout-card
            clayout: vertical
            cards:
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Na Cały Dzień
                  wybor: Open FM-Na Cały Dzień
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Praca
                  wybor: Open FM-Praca
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: 90`s Hits
                  wybor: Open FM-90`s Hits
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Polski Rock
                  wybor: Open FM-Polski Rock
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Classic Rock
                  wybor: Open FM-Classic Rock
                entity: input_select.radio_station
              - type: custom:button-card
                template:
                  - audio_wybor_radia
                variables:
                  nazwa: Bieganie
                  wybor: Open FM-Bieganie
                entity: input_select.radio_station
    state_color: true
  - square: false
    columns: 7
    type: grid
    cards:
      - type: custom:button-card
        template:
          - audio_przyciski
        variables:
          nazwa: Play
          ikona: mdi:skip-backward
          kolor: grey
        tap_action:
          action: call-service
          service: media_player.media_previous_track
          service_data:
            entity_id: media_player.spotify_marcin
      - type: custom:button-card
        template:
          - audio_przyciski
        variables:
          nazwa: Play
          ikona: mdi:play
          kolor: deepskyblue
        tap_action:
          action: call-service
          service: script.radio
          service_data: {}
          target: {}
      - type: custom:button-card
        template:
          - audio_przyciski
        variables:
          nazwa: Play
          ikona: mdi:stop
          kolor: red
        tap_action:
          action: call-service
          service: script.radiostop
          service_data: {}
          target: {}
      - type: custom:button-card
        template:
          - audio_przyciski
        variables:
          nazwa: Play
          ikona: mdi:skip-forward
          kolor: grey
        tap_action:
          action: call-service
          service: media_player.media_next_track
          service_data:
            entity_id: media_player.spotify_marcin
      - type: custom:button-card
        template:
          - audio_przyciski
        variables:
          nazwa: Play
          ikona: mdi:volume-minus
        tap_action:
          action: call-service
          service: input_number.decrement
          service_data:
            entity_id: input_number.volume_radio
      - type: custom:button-card
        entity: input_number.volume_radio
        show_name: false
        show_icon: true
        show_state: true
        styles:
          grid:
            - grid-template-areas: '"i" "s"'
            - grid-template-rows: 40% 60%
          icon:
            - height: 50%
            - width: 50%
          card:
            - border-radius: 50%
        tap_action:
          action: none
      - type: custom:button-card
        template:
          - audio_przyciski
        variables:
          nazwa: Play
          ikona: mdi:volume-plus
        tap_action:
          action: call-service
          service: input_number.increment
          service_data:
            entity_id: input_number.volume_radio
  - type: custom:my-slider
    entity: input_number.volume_radio
    height: 20px
    mainSliderColor: '#7dbde8'
    secondarySliderColor: '#f2590c'
    thumbWidth: 5px
    thumbHeight: 30px
    thumbColor: black
    thumbHorizontalPadding: 0px
    thumbVerticalPadding: 0px

wybór radia czy odtwarzacza zbudowany na tej samej zasadzie jak @artpc więc nie będę powtarzać, poza tym każdy robi pod siebie.
Jedynie co to może script się przydać:

  radio:
    alias: Play Radio on Chromecast Audio
    sequence:
    - service: media_player.volume_set
      data_template:
        entity_id: >
            {% if is_state("input_select.audio_select", "Cały dom") %} media_player.home
            {% elif is_state("input_select.audio_select", "Dzieci") %} media_player.kids
            {% elif is_state("input_select.audio_select", "Amplituner") %} media_player.salon_music
            {% elif is_state("input_select.audio_select", "Kuchnia") %} media_player.kuchnia
            {% elif is_state("input_select.audio_select", "Julia") %} media_player.julia
            {% elif is_state("input_select.audio_select", "Oliwia") %} media_player.oliwia
            {% elif is_state("input_select.audio_select", "Sypialnia") %} media_player.sypialnia
            {% elif is_state("input_select.audio_select", "Biuro") %} media_player.biuro
            {% endif %}
        volume_level: '{{  states.input_number.volume_radio.state  }}' 
    - service: media_player.play_media
      data_template:
        entity_id: >
            {% if is_state("input_select.audio_select", "Cały dom") %} media_player.home
            {% elif is_state("input_select.audio_select", "Dzieci") %} media_player.kids
            {% elif is_state("input_select.audio_select", "Amplituner") %} media_player.salon_music
            {% elif is_state("input_select.audio_select", "Kuchnia") %} media_player.kuchnia
            {% elif is_state("input_select.audio_select", "Julia") %} media_player.julia
            {% elif is_state("input_select.audio_select", "Oliwia") %} media_player.oliwia
            {% elif is_state("input_select.audio_select", "Sypialnia") %} media_player.sypialnia
            {% elif is_state("input_select.audio_select", "Biuro") %} media_player.biuro
            {% endif %}
        media_content_id: >
          {% if is_state("input_select.radio_station", "RMF FM") %} http://217.74.72.11/rmf_fm
          {% elif is_state("input_select.radio_station", "RMF MAXX") %} http://www.rmfon.pl/n/rmfmaxxx.pls
          {% elif is_state("input_select.radio_station", "RMF Classic") %} http://rmfstream1.interia.pl:8000/rmf_classic
          {% elif is_state("input_select.radio_station", "AntyRadio") %} http://stream.polandrockfestival.pl:8000/
          {% elif is_state("input_select.radio_station", "Absolute Radio Classisc Rock") %} http://icy-e-bab-04-cr.sharp-stream.com/absoluteclassicrock.mp3
          {% elif is_state("input_select.radio_station", "Meloradio") %} https://ml.cdn.eurozet.pl/mel-net.mp3
          {% elif is_state("input_select.radio_station", "Muzo Radio") %} http://stream4.nadaje.com/muzo
          {% elif is_state("input_select.radio_station", "RadioZET") %} https://zt.cdn.eurozet.pl/zet-tun.mp3
          {% elif is_state("input_select.radio_station", "ChilliZet") %} http://chi-net.cdn.eurozet.pl:8900/
          {% elif is_state("input_select.radio_station", "Eska") %} http://www.pldm.ml/radio.php?id=-1&url=http://www.eskago.pl/radio/eska-malopolska-zakopane
          {% elif is_state("input_select.radio_station", "Złote przeboje") %} http://mainstream.radioagora.pl/tuba9-1.mp3
          {% elif is_state("input_select.radio_station", "Open FM-Na Cały Dzień") %} https://stream.open.fm/69
          {% elif is_state("input_select.radio_station", "Open FM-Praca") %} https://stream.open.fm/109?type=.aac
          {% elif is_state("input_select.radio_station", "Open FM-90`s Hits") %} https://stream.open.fm/14
          {% elif is_state("input_select.radio_station", "Open FM-Polski Rock") %} https://stream.open.fm/29
          {% elif is_state("input_select.radio_station", "Open FM-Classic Rock") %} https://stream.open.fm/32
          {% elif is_state("input_select.radio_station", "Open FM-Bieganie") %} https://stream.open.fm/116
          {% elif is_state("input_select.radio_station", "Jedynka") %} http://mp3.polskieradio.pl:8900/
          {% elif is_state("input_select.radio_station", "Dwójka") %} http://mp3.polskieradio.pl:8902/
          {% elif is_state("input_select.radio_station", "Trójka") %} http://mp3.polskieradio.pl:8904/
          {% elif is_state("input_select.radio_station", "Spotify Daily Mix 1") %} spotify:playlist:37i9dQZF1E3agq9f3jFqW4
          {% elif is_state("input_select.radio_station", "Spotify Daily Mix 2") %} spotify:playlist:2RuNT5VY7IkcBStral458K?si
          {% elif is_state("input_select.radio_station", "Spotify Daily Mix 3") %} spotify:playlist:37i9dQZF1E37s6ucxKOLE4?si
          {% elif is_state("input_select.radio_station", "Spotify Daily Mix 4") %} spotify:playlist:37i9dQZF1E37fQtkWqTQpo?si
          {% elif is_state("input_select.radio_station", "Spotify Trening") %} spotify:playlist:1yaKdsuMvRGpkEl6L0imoz
          {% elif is_state("input_select.radio_station", "Spotify Uśmiechnij się") %} spotify:playlist:37i9dQZF1DX7UmlpB1f1Ip
          {% endif %}
        media_content_type: >
          {% if is_state("input_select.radio_station", "RMF FM") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "RMF MAXX") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "RMF Classic") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "AntyRadio") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Absolute Radio Classisc Rock") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Meloradio") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Muzo Radio") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "RadioZET") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "ChilliZet") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Eska") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Złote przeboje") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Na Cały Dzień") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Open FM-Praca") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Jedynka") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Dwójka") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Trójka") %} 'audio/mp4'
          {% elif is_state("input_select.radio_station", "Spotify Daily Mix 1") %} 'spotify://playlist'
          {% elif is_state("input_select.radio_station", "Spotify Daily Mix 2") %} 'spotify://playlist'
          {% elif is_state("input_select.radio_station", "Spotify Daily Mix 3") %} 'spotify://playlist'
          {% elif is_state("input_select.radio_station", "Spotify Daily Mix 4") %} 'spotify://playlist'
          {% elif is_state("input_select.radio_station", "Spotify Trening") %} 'spotify://playlist'
          {% elif is_state("input_select.radio_station", "Spotify Uśmiechnij się") %} 'spotify://playlist'
          {% endif %}
 
  radiostop:
    alias: Radio Stop
    sequence:
    - service: media_player.turn_off
      data_template:
        entity_id: >
            {% if is_state("input_select.audio_select", "Cały dom") %} media_player.home
            {% elif is_state("input_select.audio_select", "Dzieci") %} media_player.kids
            {% elif is_state("input_select.audio_select", "Amplituner") %} media_player.salon_music
            {% elif is_state("input_select.audio_select", "Kuchnia") %} media_player.kuchnia
            {% elif is_state("input_select.audio_select", "Julia") %} media_player.julia
            {% elif is_state("input_select.audio_select", "Oliwia") %} media_player.oliwia
            {% elif is_state("input_select.audio_select", "Sypialnia") %} media_player.sypialnia
            {% elif is_state("input_select.audio_select", "Biuro") %} media_player.biuro
            {% endif %}  

oczywiście gdyby ktoś chciał jeszcze input_select to dać znać i też wrzucę :slight_smile:

!! EDIT 2 !! dorobilem taką ciekawostkę, może się komuś przydać … przez chwilę zastanawiałem się nad nowym postem ale w razie czego admin proszę o sugestie :slight_smile:
Wpisanie tekst i puszczenie go na głośniku który jest wybrany.
dodajemy input_tekst i tworzymy automatyzację:

alias: Tekst do powiedzenia
description: ""
trigger:
  - platform: state
    entity_id:
      - input_text.tekst_to_powiedzenia
condition: []
action:
  - service: tts.google_say
    data_template:
      entity_id: >
        {% if is_state("input_select.audio_select", "Cały dom") %}
        media_player.home {% elif is_state("input_select.audio_select",
        "Dzieci") %} media_player.kids {% elif
        is_state("input_select.audio_select", "Amplituner") %}
        media_player.salon_music {% elif is_state("input_select.audio_select",
        "Kuchnia") %} media_player.kuchnia {% elif
        is_state("input_select.audio_select", "Julia") %} media_player.julia {%
        elif is_state("input_select.audio_select", "Oliwia") %}
        media_player.oliwia {% elif is_state("input_select.audio_select",
        "Sypialnia") %} media_player.sypialnia {% elif
        is_state("input_select.audio_select", "Biuro") %} media_player.biuro {%
        endif %}
      message: "{{ states.input_text.tekst_to_powiedzenia.state }}"
mode: single

EDIT kolejny:

Jak by ktoś chciał to wrzucam filmik krok po kroku jak zrobić ten odtwarzacz:

4 polubienia

Witam. Na początku chciałem przywitać wszystkich forumowiczów :slight_smile:

Od czasu powstania materiału Artura trochę się zmieniło w HA i mam problem z błędem Custom element doesn’t exist: mini-media-player.

Opisywany wcześniej, ale brak jest rozwiązania, więc kombinowałem trochę sam, ale brakuje mi już pomysłów.

W HACS mam komunikat “Nie załadowano w Lovelace
Elementy Lovelace, które nie zostały poprawnie załadowane: 1” i rzeczywiście widać problem z Mini Media Player

Myślę, że rozwiązanie kryje się w prawidłowym adresie URL, który należy podać w zarządzaniu zasobami.
image

Artur podaje tam adres:
/hacsfiles/mini-media-player/mini-media-player.bandle.js
tylko, że obecnie Mini Media Player nie instaluje się w tym miejscu tylko w /config/www/community/mini-media-player/mini-media-player-bundle.js - dodatkowo są dwa pliki w folderze. Próbowałem trzech odwołań (Artura, powyższy i powyższy bezpośrednio do folderu) i dalej bez zmian. Pomożecie? :slight_smile:

Mini Media Player mam dodany przez HACS
W zasobach mam:

ScreenShot_20221217111146

/hacsfiles/mini-media-player/mini-media-player-bundle.js?hacstag=1485208381165
ScreenShot_20221217111725

Działa jak trzeba po zmianie na:
/hacsfiles/mini-media-player/mini-media-player-bundle.js?hacstag=1485208381165

Bardzo dziękuję!

Skąd wziąłeś hacstag=1485208381165 ?? :sweat_smile:

Może działa to za dużo powiedziane, bo mam jeszcze “Entity media_player.denon_avr_x2500h does not support this service”, ale gdzieś widziałem już ten problem, więc będę szukał dalej. Najważniejsze, że ten podstawowy temat rozwiązałem

Ja znalazłem tu

To jest dziwne, bo w przypadku Garbage Collection rzeczywiście HACS dodał mi automatycznie hacstag, ale w przypadku Media Player tak nie zrobił…

Tak czy inaczej dzięki za wsparcie!

Jeśli MMP instalowałeś dawno, to wtedy HACS nie dodawał tagu repozytorium, jeśli instalowałeś go “z palca” a nie przez HACS, to też go nie ma.

Hej. Temat stary niemal jak to forum, ale skoro dotarł do mnie pierwszy Google Nest to postanowiłem sobie zadziałać w temacie radia.
Skorzystałem z NR, pomocników i kart siatka, picture-entry i oczywiście mini-media-player.
Efekt jak poniżej:


i NR

Pozdrawiam.

poradnik już nie działa

Z jakiego streamu korzystasz w przypadku radia złote przeboje?
W poradnikach znalazłem tylko niedziałający już http://poznan5-6.radio.pionier.net.pl:8000/tuba9-1.mp3

Ja bym szukał tam
https://www.radio-browser.info/

2 polubienia

Dzięki, udało się odnaleźć działający link