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? #162

Open
ishioni opened this issue Aug 25, 2024 · 2 comments
Open

Media player? #162

ishioni opened this issue Aug 25, 2024 · 2 comments

Comments

@ishioni
Copy link

ishioni commented Aug 25, 2024

I'd like to try and add a progress bar to my Kodi instance, but am unsure how to get the desired effect. I see media_player entities have media_position and media_duration attributes that would allow the calculation but not sure how to plug them in?

media_position: 2.488
media_duration: 241
@rianadon
Copy link
Owner

rianadon commented Sep 9, 2024

Hey, I'm not sure the timer bar card is the best fit for this problem. Since media_position updates on its own, something like bar card would be a better fit, even though it won't look the same as this card.

That said, since the player is progressing with time you could probably force the card to work with the media player. The way I'd do it is to use templates to subtract media_position from media_duration to calculate the "media time remaining". Then, you can use media_duration configured as the duration together with "media time remaining" as the remain_time to configure the card. Hope that helps!

@MAGICCC
Copy link

MAGICCC commented Jan 3, 2025

I have the same idea
I am using currently following yaml, but it doesnt work

debug: true
sync_issues: ignore
entities:
  - sensor.ytm_magic_pc
duration:
  attribute: duration
  units: seconds
remain_time:
  entity: sensor.ytm_magic_pc_remaining_time
  units: seconds
  
layout: full_row
text_width: 0px

I see in the debug that Duration: is good, but 'Time remaining:' is not populated despite sensor.ytm_magic_pc_remaining_time is showing good values

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

3 participants