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

Media Player: Unknown name and no attribute with Line-In #1305

Open
brain-wash opened this issue Mar 3, 2025 · 1 comment
Open

Media Player: Unknown name and no attribute with Line-In #1305

brain-wash opened this issue Mar 3, 2025 · 1 comment

Comments

@brain-wash
Copy link

brain-wash commented Mar 3, 2025

Hi,

I have a speaker which can operate both in Wifi and Line-In mode. When I am using the Line-In mode, I still have a play/pause button, even though it has no real use. Also it always defaults to the play being active, which leads to an unknown interpret, unknown song name and won't show any attributes (like the volume). I always have to manually press the pause button to see the name of the speaker, state and attribute. But it won't stay in pause. Often when I reload the page it is back to the play state where I can't see the names etc. again.

Image

Image

Is there a way to force the pause state when in Line-In mode? And maybe hide the play/pause button in this mode as well since it has no use?


I think I have an idea on how this could work, but so far I am struggeling with the syntax of CSS, since I have never really used it before.

I guess it should be something along does lines:

action:
  - service_template: |
      {% if is_state('media_player.pc_speaker', 'Unknown') %}
        media_pause
        hide:
          play_pause_button: true
      {% else %}
        media_play
        hide:
          play_pause_button: false
      {% endif %}

But I probably need some additional commands and figure out the indentations etc.

@Clooos
Copy link
Owner

Clooos commented Mar 10, 2025

Hi! I'm not sure but you could probably create a universal media player for this, take a look at this documentation:

https://www.home-assistant.io/integrations/universal/

And if this don't solve your issue, you can conditionally hide it with custom styles and templates:

https://github.com/Clooos/Bubble-Card/?tab=readme-ov-file#templates

Something like this can be done (hidden when media_player.pc_speaker is Unknown):

styles: |
  .bubble-play-pause-button {
    display: ${hass.states['media_player.pc_speaker']?.state == 'Unknown' ? 'none' : ''} !important;
  }

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