-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Apple TV Integration - Artwork and Title doesnt work by APP change #1900
Comments
Same here. I have modified my application to exit and restart any time the device state changes (idle, playing, paused). This causes a lag while the app scans for Apple TVs (I have four) and connects to each. But it’s better than having wrong information displayed in my app. Even when the Apple TV is powered off, pyatv is telling me the device is powered on and the last thing played is the metadata returned and state is paused. I f I pause a program, but not YouTube video, pyatv tells me that the position is advancing as if playing. If I scrub to a random position, it’s way off. I found this on Apple’s site (somewhat related, and interesting all the same): |
From what I can see in the log, you are seeing expected behavior. The amazon app does not seem to provide any artwork (search for |
@mschwartz Can you still reproduce this with some logs so I can have another look? |
I think it’s easy to reproduce using your command line tool. As you are receiving the push messages, all you need to do is pause the Apple TV for 5 seconds. When you resume, the playback position will be 5 seconds ahead instead of where it was when you paused. It’s really obvious if you scrub the playback (fast forward) and push play. The playback position will be way off. if it works during push, then it may be that I am polling for status 1/sec and the polled routines in pyatv aren’t working right. |
The title and artwork are fine. Though it isn’t returning idle if I go to the Home Screen while playing. |
Yeah, I think I can see it now:
In my case however, the reason for this is my system time not being synced properly (it was about 6min off). After doing an NTP-sync, it works as expected again:
The Apple TV sends timestamps that are compared with the time locally, so both systems must be in sync. Is that the case for you? I however believe we are not dealing with the initial issue anymore... Should maybe get back to that. |
All my systems, iPads, etc. are ntp time synchronized. The problem is after you pause, say for 5 seconds, and resume, the playback position is 5 seconds in the future. |
Oh, I can see now that you are using the beta version from HACS @pimp1310 . That version is really, really old. You should remove the integration and use the version bundled with Home Assistant. A lot has happened since then. |
@mschwartz I don't see that issue with |
👍 absolutely! I think at remote uses a push api? I’m polling once per second, not using the push API. |
@postlund I would be happy to share my python code here. I am not a python expert by any stretch. Maybe I am doing something foolish or wrong. 2 files. One is 149 lines, the other is 263. Not much to see :) I would love to see this kind of thing added to pyatv as well. Just like you have the command line tool, a pyatv<->MQTT bridge might be very useful to people. |
Gah, I'm just mixing things up... I have now tried to reproduce this with the YouTube app (polling, no push). Basically what I have done is:
Is that correct? Does this happen for all apps? |
/Actually, I think YouTube is the only one that works. We watch a lot of shows and movies using the computers app. Playing from a library on a Mac computer. I really do appreciate the help and time you’ve putting into this. what I’ve done I the code I attached above is to exit the program when deviceState changes. It’s automatically restarted by a sh script that runs the program in a loop. In a Docker container. Restart does get the time in sync. If you scrub the video, push select then gesture left or right, it’s really way out of sync. |
Also, I have 4x Apple TVs connected at the same time. Is it possible this is something causing the error? |
I will try to find some time to test this out a bit more and also look at your code. I'll let you know if I make some progress. I don't think the amount of Apple TVs should be any problems. |
Describe the bug
When i change the title for example in Netflix on the AppleTV 4K with TVos 16.2 the artwork picture and title sometimes work, but when i change to another title Movie or Tvshow Episode on antoher App (example Amazon Prime) the artwork and title is empty, he only shows the name of the App, example (Netflix or Amazon Prime)
Or when you play something in Netflix and get all media and than change to amazon video, the title and Artwork is empty!
When i reload the integration, the Artwork and title works well.
Error log
home-assistant_apple_tv_2023-01-07T08-25-22.000Z.log
How to reproduce the bug?
Easy change from the App Netflix to antoher App an play something
What is expected behavior?
that he refreshes the artwork and Title
Operating System
Home Assistant 2023.1.1
Python
3.6
pyatv
i dont know where to find, but i use the hacs addon version 3.0.1
Device
Apple TV 4K 2021 TvOs 16.2 and Apple TV 4K 2017 TvOS 16.2
Additional context
I Provided a Log, where i startet at netflix than changed to Amazon Video and back to Netflix and i played everytime something
when i reload the integration it works well, you can test it with
service: homeassistant.reload_config_entry data: {} target: entity_id: media_player.wohnzimmer
The text was updated successfully, but these errors were encountered: