home-assistant.io icon indicating copy to clipboard operation
home-assistant.io copied to clipboard

"Now Playing"

Open G8YTZ opened this issue 1 year ago • 4 comments

Feedback

Is there a way of extracting the track/artist metadate in a text form so that I'm able to send to an WS LED Matrix? Current automation that displays only "Playing", "Paused", "Idle" etc. shown below to show the use case.

`alias: Linn Media Player description: "" trigger:

  • platform: state entity_id:
    • media_player.openhome_uuid_4c494e4e_0026_0f21_c4be_01311712013f
    • media_player.linn_dining_room_upnp_av not_to:
    • unknown
    • unavailable condition: [] action:
  • service: rest_command.wled_text metadata: {} data: text: >- {{states['media_player.openhome_uuid_4c494e4e_0026_0f21_c4be_01311712013f'].state}} #{{states['media_title.openhome_uuid_4c494e4e_0026_0f21_c4be_01311712013f'].string}} mode: single`

URL

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

Version

2024.5.4

Additional information

No response

G8YTZ avatar May 22 '24 15:05 G8YTZ

Hey there @bazwilliams, mind taking a look at this feedback as it has been labeled with an integration (openhome) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of openhome can trigger bot actions by commenting:

  • @home-assistant close Closes the feedback.
  • @home-assistant rename Awesome new title Renames the feedback.
  • @home-assistant reopen Reopen the feedback.
  • @home-assistant unassign openhome Removes the current integration label and assignees on the feedback, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information) to the feedback.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information) on the feedback.

home-assistant[bot] avatar May 22 '24 15:05 home-assistant[bot]

Hi, you should be able to extract the artist and title from the media player attributes. For example:

{{ state_attr('media_player.openhome_uuid_4c494e4e_0026_0f21_e768_01357060013f', 'media_title' ) }}
{{ state_attr('media_player.openhome_uuid_4c494e4e_0026_0f21_e768_01357060013f', 'media_artist' ) }}

bazwilliams avatar May 22 '24 16:05 bazwilliams

Many thanks Baz, I'll have a go with that.

G8YTZ avatar May 22 '24 17:05 G8YTZ

Baz, Susssed it - a typo in my yaml! Many thanks!

G8YTZ avatar May 22 '24 18:05 G8YTZ