kalkih / mini-media-player

Minimalistic media card for Home Assistant Lovelace UI
MIT License
1.51k stars 206 forks source link

Option to always show volume slider #509

Closed RoboMagus closed 3 years ago

RoboMagus commented 3 years ago

I'm looking for an option to always show the volume slider and thusfar I've not been able to find a configuration that allows it. My usecase is for the google home (mini) where the volume would not only affect the media, but also reminders and audio feedback. I would like to be able to also change the volume through a single lovelace card without active media playback.

Am I overlooking something, or is this currently not an available feature?

kalkih commented 3 years ago

Hello, you should be able to achieve that by creating a universal media player and "overriding" the state attribute to always be always on, then use that newly created entity in the card.

RoboMagus commented 3 years ago

Thanks for the suggestion. It took some tinkering to get working propperly, but it definately suits my needs.

For future reference, this is the workaround I used:

  - platform: universal
    name: GoogleHomeWrapper
    children:
      - media_player.google_home
    state_template: >
      {% if is_state('media_player.google_home', 'off') %}
        idle
      {% else %}
        {{ states('media_player.google_home') }}
      {% endif %}
    commands:
      volume_set:
        service: media_player.volume_set
        target:
          entity_id: media_player.google_home
        data:
          volume_level: "{{ volume_level }}"
    device_class: speaker