home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.94k stars 29.59k forks source link

Plex pushing all playback data except cover image when casting on a Google cast device. #112831

Open maxi1134 opened 5 months ago

maxi1134 commented 5 months ago

The problem

It seems like the Plex integration and the Cast integration are only working at 98%. In the sense that the cover image is never pushed to the cast player, while the rest of the data is. (Title, duration and so on )

What version of Home Assistant Core has the issue?

core-2024.3.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Plex, Cast

Link to integration documentation on our website

https://www.home-assistant.io/integrations/cast/, https://www.home-assistant.io/integrations/plex/

Diagnostics information

No response

Example YAML snippet

{% set ns = namespace( cast_entity = "media_player.office_wiim_speaker" ) %}
                {% if state_attr( ns.cast_entity, "entity_picture") and states( ns.cast_entity) != "off"  %}
                      {{ state_attr( ns.cast_entity, "entity_picture") }}
                {% else %}                   
                      {# Look for a media player playing the same media as the main speaker in order to extract the media image #}
                      {# Pull all non-off media players#}
                      {% set ns = namespace( entities = [], final_entities = [],cast_entity = "media_player.office_wiim_speaker"  )%}                      
                      {% for media_player in states.media_player %} 
                        {% if  media_player.state != "off" and media_player.state != "unavailable" and "template" not in media_player.entity_id%}
                          {% set entity = media_player.entity_id %}
                          {% set ns.entities = ns.entities + [entity] %}
                        {% endif %}                  
                      {% endfor %}  
                      {# /Pull all non-off media players#}
                      {# Look for a player with the same song playing and output the entity_picture #}
                      {% for entity in ns.entities %}                                
                          {% set media_title = state_attr( entity, "media_title") %}
                          {% set media_album_name = state_attr( entity, "media_album_name") %}
                          {% set media_album_artist = state_attr( entity, "media_album_artist") %}                          
                          {% set cast_media_title = state_attr( ns.cast_entity, "media_title") %}
                          {% set cast_media_album_name = state_attr( ns.cast_entity, "media_album_name") %}
                          {% set cast_media_album_artist = state_attr( ns.cast_entity, "media_album_artist") %}
                          {% if media_title is not none and media_album_name is not none and media_album_artist is not none and cast_media_title is not none and cast_media_album_name is not none and cast_media_album_artist is not none and (( media_title | string | length ) > 0 and ( media_title | string ) in cast_media_title) and (( media_album_name | string ) in cast_media_album_name) and (( media_album_artist | string ) in cast_media_album_artist) and (( state_attr(entity, 'entity_picture') )) %}
                              {{state_attr(entity, 'entity_picture')}}
                              {% break %}
                        {% endif %}
                      {% endfor %}  
                      {#/Look for a player with the same song playing and output the entity_picture #}                  
                      {# /Look for a media player playing the same media as the main speaker in order to extract the media image #}
                {% endif %}

I am currently using this to extract the image with a third party integration called "template media player"

Anything in the logs that might be useful for us?

No response

Additional information

https://community.home-assistant.io/t/chromecast-entity-picture-null-when-casting-from-plex/315658/6?u=maxi1134

Somebody here thinks this part of the code might be the culprit.

home-assistant[bot] commented 5 months ago

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

Code owner commands Code owners of `cast` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign cast` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


cast documentation cast source (message by IssueLinks)

issue-triage-workflows[bot] commented 2 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

maxi1134 commented 2 months ago

The issue is not solved

lukegackle commented 2 months ago

Just adding my vote for this issue to be looked at, it seems the entity_picture is the only thing that does not come across to the cast entity and has not for some time (if ever), I imagine this would be a rather simple fix to implement but I'm not familiar with home assistants code