AppleTV no longer reachable after watching

Note: I’m using the official HA docker image.

I have this weird issue. HomeAssistant detects my AppleTV without any problem, and I can see it’s state from within the HA web interface.

However, after watching a few episodes on NetFlix with my AppleTV, HomeAssistant is no longer able to connect to the ATV. It gives me the message “Establishing a connection to the AppleTV”. Rebooting HomeAssistant solves the issue for me.

I also tried to define my appletv manually:

apple_tv:
  - host: 192.168.30.122
    login_id: 00000001-f255-xxxx-xxxx-d57da19c43b9

A few suspicious thing show up in my logs:

017-08-23 20:53:19 ERROR (Recorder) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/apple_tv.py", line 97, in request_configuration
    fields=[{'id': 'pin', 'name': 'PIN Code', 'type': 'password'}]
TypeError: request_config() got multiple values for argument 'description'

and

2017-08-21 14:07:37 WARNING (MainThread) [homeassistant.components.media_player.apple_tv] A <class 'pyatv.exceptions.AuthenticationError'> error occurred: failed to login: 400
2017-08-21 14:07:47 WARNING (MainThread) [homeassistant.components.media_player.apple_tv] A <class 'pyatv.exceptions.AuthenticationError'> error occurred: failed to login: 400
2017-08-21 14:07:57 WARNING (MainThread) [homeassistant.components.media_player.apple_tv] A <class 'pyatv.exceptions.AuthenticationError'> error occurred: failed to login: 400

I don’t see a reason why the authentication could fail, since it wa working fine a few hours ago, and as I said, restarting HA fixes the issue again (for a while).

I also tried pairing HA with my AppleTV, but that doesn’t work either. I see the PIN code on my ATV screen, but no dialog pops up in HA to enter the PIN code.

1 Like

I am having this same problem. Apple TV had been rock solid for many months, but started to randomly disconnect around upgrade to 0.50 (best I can tell). Reboot fixes it temporarily.

Because I run automations based on the status of Apple TV (playing, paused) I have notifications setup to alert my mobile when the connection fails so that I can fix the connection. Typically this happens after watching an episode or two of something on Netflix.

You are describing exactly the same issue as me. I’m happy I’m not the only one! :slight_smile:

I also have automations like dim lights while watching AppleTV, and now they break. This is a major bummer, as the auto-dim automation was one the main features to convince my significant other to give this home-automation thing a try.

Yep! I auto-dim on play (and turn back on at pause) and it’s my favorite automation by far. What sucks is it worked perfectly for a long time and only recently started to have problems.

Now that I think about it, it may have coincided with 0.48 release which supported multiple Apple TVs: https://github.com/home-assistant/home-assistant/pull/8539

You might want to report this on github

submitted here https://github.com/home-assistant/home-assistant/issues/9133

I posted in the issue, lets continue the investigation there! :+1:

Since the last tvOS update (tvOS 11, I think?), I’m no longer experiencing this issue. Will do some more testing tomorrow.

1 Like

I still get this. I have three Apple TV 4s and two 4Ks on my network and they slowly but surely all started getting this connection issue. I’m on 0.60.1 and re-authenticating with them doesn’t do anything to bring them back.