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
73.81k stars 30.9k forks source link

AppleTV Intigration no longer works with tvOS15 #51649

Closed Airey001 closed 2 years ago

Airey001 commented 3 years ago

The problem

AppleTV intigtation can no longer connect with AppleTV's running the new tvOS15 Beta 1. Here are all i could find in the logs

I could see this happen as each of My AppleTV's where upgrade they worked on tvOS14.7. I updated the first one and lost access but the other still worked so i updated the second to verity and it stopped working also

What is version of Home Assistant Core has the issue?

2021.6

What was the last working version of Home Assistant Core?

2021.6

What type of installation are you running?

Home Assistant Core

Integration causing the issue

AppleTV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/apple_tv/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.apple_tv
Source: components/apple_tv/__init__.py:326
Integration: Apple TV (documentation, issues)
First occurred: 3:19:59 PM (148 occurrences)
Last logged: 10:02:06 PM

Failed to connect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 242, in _connect_loop
    await self._connect(conf)
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 326, in _connect
    self.atv = await connect(conf, self.hass.loop, session=session)
  File "/usr/local/lib/python3.8/site-packages/pyatv/__init__.py", line 76, in connect
    await atv.connect()
  File "/usr/local/lib/python3.8/site-packages/pyatv/mrp/__init__.py", line 703, in connect
    await self._protocol.start()
  File "/usr/local/lib/python3.8/site-packages/pyatv/mrp/protocol.py", line 103, in start
    self.device_info = await self.send_and_receive(msg)
  File "/usr/local/lib/python3.8/site-packages/pyatv/mrp/protocol.py", line 180, in send_and_receive
    return await self._receive(identifier, timeout)
  File "/usr/local/lib/python3.8/site-packages/pyatv/mrp/protocol.py", line 188, in _receive
    await asyncio.wait_for(semaphore.acquire(), timeout)
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 501, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

apple_tv documentation apple_tv source (message by IssueLinks)

thoppenreys1 commented 3 years ago

I'm also having this issue. AppleTV ingtegration Stopped working as soon as i upgraded to tvOS 15 Beta 2. Tried to delete the integration and reinstall and Home Assistant starts by reporting a problem with MRP and says that it will be ignored, tries to set up the AirPlay component and a PIN is Displayed on TV, when you enter the PIN into Home Assistant all it does is say that the integration was not fully setup and to try again later. Here are a few screenshots of the attempted integration setup:

Screen Shot 2021-07-09 at 12 16 38 PM

Screen Shot 2021-07-09 at 12 17 52 PM

maniacaris commented 3 years ago

Also on tvOS 15 Beta with the same result.

postlund commented 3 years ago

https://github.com/postlund/pyatv/issues/1168

syedair commented 3 years ago

Facing the same issue.

cinghialino commented 3 years ago

same issue here

postlund commented 3 years ago

The MRP protocol has been removed in tvOS 15 so everyone will face this problem. I'm trying to figure out a different way to get metadata, but I'm not quite there yet.

postlund commented 3 years ago

I have been making good progress with restoring functionality in pyatv so that it works with tvOS 15 and will soon merge that. There are a few more things I want to fix but I don't see any issues (at least for now) to make a release and integrate it with Home Assistant before the final version of tvOS 15 is out. So hopefully we don't end up in the same situation as when tvOS 13 was released.

robyevolution commented 3 years ago

hello when should the fix for tvos 15 be released?

postlund commented 3 years ago

It will be available soon, but I won't give any date. Had to fix a few minor things in pyatv, but should be sorted by tomorrow or so.

robyevolution commented 3 years ago

i upgraded to 0.90 but i can't add apple tv via home assistant integration.

postlund commented 3 years ago

The integration needs some adjustments to work. I will try to get on that tomorrow.

robyevolution commented 3 years ago

Thank you! as soon as you release it let me know so I'll try it

akballow commented 3 years ago

Thanks for the work and effort @postlund , Take your time! These other guys work you like they pay you !

lukecarbis commented 3 years ago

And a friendly reminder that it is possible to sponsor @postlund for his time and effort.

postlund commented 3 years ago

For the ones interested, initial version of the integration supporting tvOS 15 is available here:

https://github.com/postlund/hass-atv-beta

Can also be installed via HACS. Remember to read the instructions before installing.

Pierrodu21 commented 3 years ago

I had this issue as well so I’ve installed the beta and so far it’s awesome! I can even see my HomePod mini now in HA! Thank you so much for your work!

Patrick1610 commented 3 years ago

Thanks for your work 🙏🏼 Will there be features / entities that won’t work due to another method than mrp? Or will the new method contain everything it did before?

postlund commented 3 years ago

Nah, it's same as before. Technically it's still MRP, it's just tunneled over AirPlay now. No other difference. There will be additional features over time, like app launching. But I'm keeping that for a separate PR.

PDekker commented 3 years ago

Wanted to mention my Samsung tv’s get discovered (probably because of AirPlay capability?)

postlund commented 3 years ago

Yeah: https://github.com/postlund/pyatv/issues/1337

Patrick1610 commented 3 years ago

That sounds great 😄 will an on/off button from home assistant also be possible, now that the new remote has one?

wormuths commented 3 years ago

Just wondering if there is a target version for HA yet? I've got no ATV functionality since the update, and don't have HACS to try it out...

postlund commented 3 years ago

I don't want to estimate any release, it will come when it comes but my goal is as fast as possible. You don't need HACS, you can just drop the files in manually.

MarvinSchenkel commented 3 years ago

Glad you are working this out :). I am also experiencing an 'Abort message' when setting up a new connection due to my devices being on different VLANs. Is there anything I can do to help you fix this issue?

postlund commented 3 years ago

I'm working as fast as I can!

You have two choices when the device is on a separate VLAN:

  1. Carry on per usual and ignore the protocols that fail to pair and live with reduced functionality. I suspect it's the Companion protocol? That would be app related features in the future and improved power management for turning on or off a device. None of those features are implemented now.
  2. Move the devices so that they are on the same network

It's a restriction by Apple that devices can't be on separate networks and not something I can "fix" unfortunately.

MarvinSchenkel commented 3 years ago

I'm working as fast as I can!

You have two choices when the device is on a separate VLAN:

  1. Carry on per usual and ignore the protocols that fail to pair and live with reduced functionality. I suspect it's the Companion protocol? That would be app related features in the future and improved power management for turning on or off a device. None of those features are implemented now.
  2. Move the devices so that they are on the same network

It's a restriction by Apple that devices can't be on separate networks and not something I can "fix" unfortunately.

The first one (Airplay) succeeds, but the seconds one (RAOP) fails with the message "Aborted". In the end, it does not add any devices.

postlund commented 3 years ago

That sounds peculiar. What kind of device is that? Do you see anything in the log?

MarvinSchenkel commented 3 years ago

That sounds peculiar. What kind of device is that? Do you see anything in the log?

Yep:

2021-10-13 19:49:16 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 151, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 177, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 256, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/apple_tv/config_flow.py", line 177, in async_step_zeroconf
    return await self.async_find_device_wrapper(self.async_found_zeroconf_device)
  File "/config/custom_components/apple_tv/config_flow.py", line 203, in async_find_device_wrapper
    return await next_func()
  File "/config/custom_components/apple_tv/config_flow.py", line 181, in async_found_zeroconf_device
    await self.async_set_unique_id(self.device_identifier)
  File "/config/custom_components/apple_tv/config_flow.py", line 111, in device_identifier
    if self.atv.identifier in entry.data[CONF_IDENTIFIERS]:
KeyError: 'identifiers'

If you need any more, let me know

postlund commented 3 years ago

Right, that is an unintended feature built into the migration of the config entry I'm afraid. It should not have anything to do with the pairing problems, but just to be sure... Remove all integrations using the front end. Then open .storage/core.config_entries and remove the remaining one manually. Hopefully that should make some sort of difference.

MarvinSchenkel commented 3 years ago

I removed all the config entries and rebooted home assistant, then, I manually added my Apple TV 4K and got this error now:

2021-10-14 09:16:41 ERROR (MainThread) [custom_components.apple_tv.config_flow] Authentication problem
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pyatv/support/__init__.py", line 33, in error_handler
    return await func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pyatv/protocols/companion/auth.py", line 54, in start_pairing
    resp = await self.protocol.exchange_opack(
  File "/usr/local/lib/python3.9/site-packages/pyatv/protocols/companion/protocol.py", line 80, in exchange_opack
    unpacked_object, _ = opack.unpack(payload)
  File "/usr/local/lib/python3.9/site-packages/pyatv/protocols/companion/opack.py", line 108, in unpack
    return _unpack(data, [])
  File "/usr/local/lib/python3.9/site-packages/pyatv/protocols/companion/opack.py", line 115, in _unpack
    if data[0] == 0x01:
IndexError: index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/config/custom_components/apple_tv/config_flow.py", line 285, in async_pair_next_protocol
    await self.pairing.begin()
  File "/usr/local/lib/python3.9/site-packages/pyatv/protocols/companion/pairing.py", line 53, in begin
    await error_handler(
  File "/usr/local/lib/python3.9/site-packages/pyatv/support/__init__.py", line 41, in error_handler
    raise fallback(str(ex)) from ex
pyatv.exceptions.PairingError: index out of range
postlund commented 3 years ago

Ah, that's a different problem with a type in OPACK that I have not implemented. There's a fix in #1373 that I have not merged yet, I will try to do that soon. You can continue without Companion for now, it's not used anyways and you can trigger a re-pair from device options later.

MarvinSchenkel commented 3 years ago

Ah, that's a different problem with a type in OPACK that I have not implemented. There's a fix in #1373 that I have not merged yet, I will try to do that soon. You can continue without Companion for now, it's not used anyways and you can trigger a re-pair from device options later.

I'll wait until that PR has been merged. Currently, it doesn't set up any device at all so I cannot continue without Companion ;-). Hopefully I can help you test after the PR has been merged.

kdvlr commented 3 years ago

@postlund - I wasn't sure if I needed to open another issue for this, but I have 3 AppleTVs that I am not able to add to HomeAssistant. While I do use VLANs. In this case, all the Apple TVs are hardwired into the main VLAN that HASS is on.

Here are the logs

2021-10-27 21:38:18 DEBUG (MainThread) [pyatv.airplay.pairing] Starting AirPlay pairing with credentials 
2021-10-27 21:38:18 DEBUG (MainThread) [pyatv.airplay.srp] Authentication keys )
2021-10-27 21:38:18 DEBUG (MainThread) [pyatv.support.http] Connected to 192.168.100.38
2021-10-27 21:38:18 DEBUG (MainThread) [pyatv.support.http] Sending HTTP/1.1 message: b'POST /pair-pin-start HTTP/1.1\r\nUser-Agent: AirPlay/320.20\r\nConnection: keep-alive\r\n\r\n'
2021-10-27 21:38:18 DEBUG (MainThread) [pyatv.support.http] Received: b'HTTP/1.1 200 OK\r\nDate: Thu, 28 Oct 2021 02:38:18 GMT\r\nContent-Length: 0\r\nServer: AirTunes/595.15.41\r\n\r\n'
2021-10-27 21:38:18 DEBUG (MainThread) [pyatv.support.http] Got HTTP response: HttpResponse(protocol='HTTP', version='1.1', code=200, message='OK', headers={'date': 'Thu, 28 Oct 2021 02:38:18 GMT', 'content-length': '0', 'server': 'AirTunes/595.15.41'}, body=''):
2021-10-27 21:38:22 DEBUG (MainThread) [pyatv.airplay.pairing] AirPlay PIN changed to 2985
2021-10-27 21:38:22 DEBUG (MainThread) [pyatv.support.http] Sending HTTP/1.1 message: b'POST /pair-setup-pin HTTP/1.1\r\nUser-Agent: pyatv/0.8.2\r\nContent-Length: 85\r\n\r\nbplist00\xd2\x01\x02\x03\x04VmethodTuserSpin_\x10\x105CD0752CE95CA85B\x08\r\x14\x19\x1d\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000'
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Received: b'HTTP/1.1 200 OK\r\nDate: Thu, 28 Oct 2021 02:38:23 GMT\r\nContent-Length: 342\r\nContent-Type: application/x-apple-binary-plist\r\nServer: AirTunes/595.15.41\r\n\r\nbplist00\xd2\x01\x02\x03\x04RpkTsaltO\x11\x01\x00\x1e\xc9i/\xd7\x90\xb8e\x9d@\xe5O\x1135 \x1f\xff\xc8\x02r\xaf\xf1\x84\x17\xbbd\x97\xaco\x95\x8dq\xf4\x82\xef\x10d^<\xf8;\x91\x15G\x02b|\x1e\x92\x9d\x1b\x02;s\xa0\xd9\xf1\'\xc6L\xd8\xc8\xf9\xb5\x85T\x11\x03n\x88\x13z.\xf7\xfa\xce\x13\xc4xt\xff\xede"\xfe\x8e\xe5 \xce\xb0 \xa1\xc7\xe1\xc5Q\x7fGd# \xfd\x97\x88S\x18U\xfa\xfb\x91<\xce\x0c\x84\xb3\xbbz`\x97\xe5\x05\xb6\xcb\x02"\x02F=\xda\x15]\x1f\xf2\xe0\x88\x0b}M\x9c\xa4\xa0\x83\r\xe4Y\x82\x1e\x07\xf6~\xb9\xbe\x83\x85\x91=\xa7\xcb\xd6n\x80d\xddx,o\x11\x96@\xed\xe3\x82\x8e\xb5\xb0d\x87Io\xcb\xf0ki\xc9-\xc6\x92\x07)\xe4\xaf8\x82:\xdbz\xe1\xc1pZ\xebGs\x8c\xa1;!\xd8\xcbF\x02\xe2\xc3G\x93y\xd8\x91v~"\x081\x8e\xd9\xe33\x99V>\xb8\xfb\xf1\xff\x13U\xaf\xb1|D\xb1\x9a\xcd\xbauT\xfc%\xd7\x06^\xb0j\x0e\xdfO\x10\x10\xaf\t\\\xd2\xde\x88?N)T\xa0G\xd6|>\r\x00\x08\x00\r\x00\x10\x00\x15\x01\x19\x00\x00\x00\x00\x00\x00\x02\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01,'
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Got HTTP response: HttpResponse(protocol='HTTP', version='1.1', code=200, message='OK', headers={'date': 'Thu, 28 Oct 2021 02:38:23 GMT', 'content-length': '342', 'content-type': 'application/x-apple-binary-plist', 'server': 'AirTunes/595.15.41'}, body=b'bplist00\xd2\x01\x02\x03\x04RpkTsaltO\x11\x01\x00\x1e\xc9i/\xd7\x90\xb8e\x9d@\xe5O\x1135 \x1f\xff\xc8\x02r\xaf\xf1\x84\x17\xbbd\x97\xaco\x95\x8dq\xf4\x82\xef\x10d^<\xf8;\x91\x15G\x02b|\x1e\x92\x9d\x1b\x02;s\xa0\xd9\xf1\'\xc6L\xd8\xc8\xf9\xb5\x85T\x11\x03n\x88\x13z.\xf7\xfa\xce\x13\xc4xt\xff\xede"\xfe\x8e\xe5 \xce\xb0 \xa1\xc7\xe1\xc5Q\x7fGd# \xfd\x97\x88S\x18U\xfa\xfb\x91<\xce\x0c\x84\xb3\xbbz`\x97\xe5\x05\xb6\xcb\x02"\x02F=\xda\x15]\x1f\xf2\xe0\x88\x0b}M\x9c\xa4\xa0\x83\r\xe4Y\x82\x1e\x07\xf6~\xb9\xbe\x83\x85\x91=\xa7\xcb\xd6n\x80d\xddx,o\x11\x96@\xed\xe3\x82\x8e\xb5\xb0d\x87Io\xcb\xf0ki\xc9-\xc6\x92\x07)\xe4\xaf8\x82:\xdbz\xe1\xc1pZ\xebGs\x8c\xa1;!\xd8\xcbF\x02\xe2\xc3G\x93y\xd8\x91v~"\x081\x8e\xd9\xe33\x99V>\xb8\xfb\xf1\xff\x13U\xaf\xb1|D\xb1\x9a\xcd\xbauT\xfc%\xd7\x06^\xb0j\x0e\xdfO\x10\x10\xaf\t\\\xd2\xde\x88?N)T\xa0G\xd6|>\r\x00\x08\x00\r\x00\x10\x00\x15\x01\x19\x00\x00\x00\x00\x00\x00\x02\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01,'):
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.airplay.srp] Client session key: b'4ad28661dbed3c5ef70f27f76bf9eec197573729a06d80894068ba01acbafbbd77f251cf80401ca2'
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.airplay.srp] Client public: 84b39610f4fdefc36192019bb5460f1e9f6e8baf74a7f438413c5e786977263ed13101622fd06a6e51ff5832b93b8f1d2a14f75a98925148ffacdf2342b412b666e29944ae7fb3a434d2e3045ab5c773edff00e2ceac129a2d89a79f1b2cc76d1426fd7b159decc241f5d7017355f017d3826abc2b68562ff81bf14df9f33ef090268d227160adce117519330f035c333e7cd9b5c301c44219ef7b611dfb04c2795a428a5c801102c163237a32f70ef366e79521d8e0edcc4c4f2e9e0dd31850f6f4bc5546d8f336de58a71a345b00d45e70f503d0eb4707ebac3cab13f3b8540d83bed3d585045df9513affda6eb4bf25fb3bf703ad68f7ceab8eb9e6dcb159, proof: b'c8c8bd60c3a103e1964adf71751c10405c2d1e58'
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Sending HTTP/1.1 message: b'POST /pair-setup-pin HTTP/1.1\r\nUser-Agent: pyatv/0.8.2\r\nContent-Length: 347\r\n\r\nbplist00\xd2\x01\x02\x03\x04RpkUproofO\x11\x01\x00\x84\xb3\x96\x10\xf4\xfd\xef\xc3a\x92\x01\x9b\xb5F\x0f\x1e\x9fn\x8b\xaft\xa7\xf48A<^xiw&>\xd11\x01b/\xd0jnQ\xffX2\xb9;\x8f\x1d*\x14\xf7Z\x98\x92QH\xff\xac\xdf#B\xb4\x12\xb6f\xe2\x99D\xae\x7f\xb3\xa44\xd2\xe3\x04Z\xb5\xc7s\xed\xff\x00\xe2\xce\xac\x12\x9a-\x89\xa7\x9f\x1b,\xc7m\x14&\xfd{\x15\x9d\xec\xc2A\xf5\xd7\x01sU\xf0\x17\xd3\x82j\xbc+hV/\xf8\x1b\xf1M\xf9\xf3>\xf0\x90&\x8d"q`\xad\xce\x11u\x193\x0f\x03\\3>|\xd9\xb5\xc3\x01\xc4B\x19\xef{a\x1d\xfb\x04\xc2yZB\x8a\\\x80\x11\x02\xc1c#z2\xf7\x0e\xf3f\xe7\x95!\xd8\xe0\xed\xccLO.\x9e\r\xd3\x18P\xf6\xf4\xbcUF\xd8\xf36\xdeX\xa7\x1a4[\x00\xd4^p\xf5\x03\xd0\xebG\x07\xeb\xac<\xab\x13\xf3\xb8T\r\x83\xbe\xd3\xd5\x85\x04]\xf9Q:\xff\xdan\xb4\xbf%\xfb;\xf7\x03\xadh\xf7\xce\xab\x8e\xb9\xe6\xdc\xb1YO\x10\x14\xc8\xc8\xbd`\xc3\xa1\x03\xe1\x96J\xdfqu\x1c\x10@\\-\x1eX\x00\x08\x00\r\x00\x10\x00\x16\x01\x1a\x00\x00\x00\x00\x00\x00\x02\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x011'
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Received: b'HTTP/1.1 200 OK\r\nDate: Thu, 28 Oct 2021 02:38:23 GMT\r\nContent-Length: 75\r\nContent-Type: application/x-apple-binary-plist\r\nServer: AirTunes/595.15.41\r\n\r\nbplist00\xd1\x01\x02UproofO\x10\x14\xc0\xdb\xa5\x94\xb1\x96\x9fY\\\xd0\xc3(\x17\xa0\xa8\xe6\xd2\xf3\x9fy\x08\x0b\x11\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00('
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Got HTTP response: HttpResponse(protocol='HTTP', version='1.1', code=200, message='OK', headers={'date': 'Thu, 28 Oct 2021 02:38:23 GMT', 'content-length': '75', 'content-type': 'application/x-apple-binary-plist', 'server': 'AirTunes/595.15.41'}, body=b'bplist00\xd1\x01\x02UproofO\x10\x14\xc0\xdb\xa5\x94\xb1\x96\x9fY\\\xd0\xc3(\x17\xa0\xa8\xe6\xd2\xf3\x9fy\x08\x0b\x11\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00('):
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.airplay.srp] Increase last byte from 247 to 248
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.airplay.srp] Pair-Setup-AES (IV=73243f32959ffe3644f26344a70870f8, Key=30536c2fe68e3c4b291cfe8102f07d59)
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.airplay.srp] Pair-Setup EPK+Tag (EPK=4d024bffc26021349731a45ea356cd2f1dca07526c524d5f52a5ccd79622dddc, Tag=dd4176b0b4e67fdc12b31143d21c2ddc)
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Sending HTTP/1.1 message: b'POST /pair-setup-pin HTTP/1.1\r\nUser-Agent: pyatv/0.8.2\r\nContent-Length: 116\r\n\r\nbplist00\xd2\x01\x02\x03\x04WauthTagSepkO\x10\x10\xddAv\xb0\xb4\xe6\x7f\xdc\x12\xb3\x11C\xd2\x1c-\xdcO\x10 M\x02K\xff\xc2`!4\x971\xa4^\xa3V\xcd/\x1d\xca\x07RlRM_R\xa5\xcc\xd7\x96"\xdd\xdc\x08\r\x15\x19,\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00O'
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Received: b'HTTP/1.1 200 OK\r\nDate: Thu, 28 Oct 2021 02:38:23 GMT\r\nContent-Length: 116\r\nContent-Type: application/x-apple-binary-plist\r\nServer: AirTunes/595.15.41\r\n\r\nbplist00\xd2\x01\x02\x03\x04SepkWauthTagO\x10 \xcf\x0b\x98k,\xe7\x1c\xd3?&%\xf4\xecc]!\xfa\x160\x7f\x01Bd\x8cJ\xb0\x00\xd5\xfaa\t\xc9O\x10\x10\xa7c\xaaF\xabx\x1b\xda\x91\xd8\x93\\\x1eK`\xf5\x08\r\x11\x19<\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00O'
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Got HTTP response: HttpResponse(protocol='HTTP', version='1.1', code=200, message='OK', headers={'date': 'Thu, 28 Oct 2021 02:38:23 GMT', 'content-length': '116', 'content-type': 'application/x-apple-binary-plist', 'server': 'AirTunes/595.15.41'}, body=b'bplist00\xd2\x01\x02\x03\x04SepkWauthTagO\x10 \xcf\x0b\x98k,\xe7\x1c\xd3?&%\xf4\xecc]!\xfa\x160\x7f\x01Bd\x8cJ\xb0\x00\xd5\xfaa\t\xc9O\x10\x10\xa7c\xaaF\xabx\x1b\xda\x91\xd8\x93\\\x1eK`\xf5\x08\r\x11\x19<\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00O'):
2021-10-27 21:38:23 DEBUG (MainThread) [pyatv.support.http] Connection closed

After entering the PIN the message I get is

Aborted
The configuration for this device is incomplete. Please try adding it again.
postlund commented 3 years ago

@kdvlr Please install and try with the beta component, a lot has changes there. Make sure you install version 1.6.0 as 1.7.0 will only work with the next version of Home Assistant.

https://github.com/postlund/hass-atv-beta

bcmitri commented 3 years ago

@kdvlr Please install and try with the beta component, a lot has changes there. Make sure you install version 1.6.0 as 1.7.0 will only work with the next version of Home Assistant.

https://github.com/postlund/hass-atv-beta

I'm glad I saw this note before I updated. I don't think that was mentioned in the release notes.

dieugab commented 3 years ago

I updated to 1.7.0 and it did indeed break 😋, luckily easy enough to downgrade. Maybe it's best to add a note to the releaselog? @postlund

postlund commented 3 years ago

I intend to add requires version to HACS (so you can't install it running the wrong version of Home Assistant), but I can't do that right now. As soon as I can I will.

feboun commented 3 years ago

Hi. I downloaded and installed version 1.6 but still nothing. I go to configuration -> integration and I look for AppleTV and now I have an error "Config flow could not be loaded".

mikesalz commented 3 years ago

@postlund I reported this a while back, but it looks like it is still happening in the custom integration. When you restart an Apple TV, it registers errors.

Logger: homeassistant Source: custom_components/apple_tv/config_flow.py:153 Integration: Apple TV First occurred: 10:38:36 AM (2 occurrences) Last logged: 10:38:36 AM

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 197, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 224, in _async_init result = await self._async_handle_step(flow, flow.init_step, data, init_done) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 320, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/apple_tv/config_flow.py", line 153, in async_step_zeroconf service_type = discovery_info[zeroconf.ATTR_TYPE][:-1] # Remove leading . AttributeError: module 'homeassistant.components.zeroconf' has no attribute 'ATTR_TYPE'

SGC1990 commented 3 years ago

The current work around is https://github.com/postlund/hass-atv-beta

postlund commented 3 years ago

I think I managed to use some constants that are on dev but not in the latest release. Things are moving too fast... I will try to fix that as soon as I can.

postlund commented 3 years ago

Please try 1.9.1 once it appears.

adabelleleiram commented 3 years ago

For the ones interested, initial version of the integration supporting tvOS 15 is available here:

https://github.com/postlund/hass-atv-beta

Can also be installed via HACS. Remember to read the instructions before installing.

Is there a reason it might not show up in HACS? I've searched with a bunch of combinations, e.g. Apple TV Beta, hass-atv-beta, but it's not showing up for me. I have the latest version of HA.

postlund commented 3 years ago

@adabelleleiram Someone probably removed it after the previous uplift (tvOS 13) and I haven't made any new PR to add it. Gonna try to finish current PR soon and have it merged.

Patrick1610 commented 3 years ago

I seem to have found something that doesn't quite work 100%, or it is something I'm doing wrong.. Thought I'd just share it here. I have an automation that streams a doorbell video to my AppleTV when the tv is on. This switches the appletv to Airplay. After I return to my app/movie with the menu button on the remote, the card/state of the appletv keeps hanging on Airplay. Only a restart of Home Assisstant fixes this, but only until the next doorbell event..

EDIT: added picture of method used image