Mabaelst
(Bart Teuwen)
February 1, 2022, 4:04pm
1
Hello all,
I’m still fairly new here and like to experiment with HA.
But now I also run into a problem with apple tv 4k.
Installed beta version and integrated apple TV into HA.
But if the Apple TV is turned off for a while and I turn it back on, it always stays on STANDBY in HA and does not change to PLAYING or IDLE!!! No matter what I do it stays on STANDBY.
If I restart HA everything works normally again. Does anyone have an idea how I solve this?
Thank you for your response.
postlund
(Pierre Ståhl)
February 1, 2022, 5:55pm
2
This is a known bug that I have not had time to fix, I’ll try to do that tomorrow or so. You need to reload the integration to make it work again.
Mabaelst
(Bart Teuwen)
February 1, 2022, 7:26pm
3
postlund
(Pierre Ståhl)
February 1, 2022, 8:43pm
4
It’s not Fix is here if you want to follow progress:
home-assistant:dev
← postlund:atv_disconnect_bug
opened 08:16PM - 01 Feb 22 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
This PR includes they following changes (which are all tangled together):
* Makes sure re-connects are properly made
* Removes some cruft code not needed by pyatv anymore
* Indirectly fixes errors about `BlockedStateError`
Surprisingly there seems to be no open issues about it here but I have one in the pyatv project (as well as lots of reports on the forums).
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [X] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes https://github.com/postlund/pyatv/issues/1621
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [X] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [X] There is no commented out code in this PR.
- [X] I have followed the [development checklist][dev-checklist]
- [X] The code has been formatted using Black (`black --fast homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [ ] Untested files have been added to `.coveragerc`.
The integration reached or maintains the following [Integration Quality Scale][quality-scale]:
<!--
The Integration Quality Scale scores an integration on the code quality
and user experience. Each level of the quality scale consists of a list
of requirements. We highly recommend getting your integration scored!
-->
- [ ] No score or internal
- [ ] 🥈 Silver
- [ ] 🥇 Gold
- [ ] 🏆 Platinum
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[manifest-docs]: https://developers.home-assistant.io/docs/en/creating_integration_manifest.html
[quality-scale]: https://developers.home-assistant.io/docs/en/next/integration_quality_scale_index.html
[docs-repository]: https://github.com/home-assistant/home-assistant.io
Mabaelst
(Bart Teuwen)
February 2, 2022, 2:45pm
5
Thank you for your response, but I don’t understand all this yet, I’m not that far with HA yet.
Am I understanding correctly that the problem is now solved?
postlund
(Pierre Ståhl)
February 2, 2022, 2:55pm
6
It will be resolved in the release coming out tonight. I will try to push the changes to the beta repo as well.
Mabaelst
(Bart Teuwen)
February 2, 2022, 6:30pm
7
Thank you very much for your response. fine, I’ll wait until tomorrow and test it then.
postlund
(Pierre Ståhl)
February 2, 2022, 8:40pm
8
Custom component is updated now as well.
Mabaelst
(Bart Teuwen)
February 3, 2022, 1:56pm
9
Mabaelst
(Bart Teuwen)
February 6, 2022, 3:12pm
10
Hello,
I thought the problem was solved, but since last night I have the same problem again. Do you have an idea what I’m doing wrong?
postlund
(Pierre Ståhl)
February 6, 2022, 4:35pm
11
Did you try restarting the Apple TV?
Mabaelst
(Bart Teuwen)
February 7, 2022, 11:43am
12
Thanks for your response
I turned it off but didn’t restart it.
Do you think that would help?
First of all thank you for your work, I am excited to see this as auto discovered item and can add it through configuration easily. I have setup a automation where it will turn my bedroom lights to a certain scene when we turn our apple tv on after 8 pm…It didnt fire the first night we used it (three nights ago) When I look into history I see Standby, Idle and Playing…My automation is set to fire the scene when the apple tv is turned on…I dont see that in the History though, did I do something wrong? Also is there a way to get certain apps names? it would be so cool to do something like when we play netflix have lights turn red, etc.
1 Like
Mabaelst
(Bart Teuwen)
February 12, 2022, 1:51pm
14
Thanks for your response.
Been on vacation for a few days. But it doesn’t really work for me yet.
I restarted the apple tv and then it works, but if I turn it off for a few hours and turn it back on, it remains “STANDBY” again. What am I doing wrong? Can you help me with this problem?
Mabaelst
(Bart Teuwen)
May 12, 2022, 2:06pm
15
Hello, everyone, does anyone know if this problem has already been solved? Thank you for your response.
Experiencing the issue too. Reload does the trick to bring it back for some time. Any ideas on a resolution coming?
Thanks for the great work
postlund
(Pierre Ståhl)
August 5, 2022, 5:00am
17
Are you running the beta component from HACS? If you are, start by removing that.
Mabaelst
(Bart Teuwen)
August 5, 2022, 12:56pm
18
Hello,
Do you mean I need to uninstall Apple TV Beta?
Thanks for all the work.
Mabaelst
(Bart Teuwen)
August 5, 2022, 1:59pm
20
Thanks for your response, which integration should I set up?