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
72.64k stars 30.41k forks source link

Seems that the pairing workflow for OwnTone has broken? #60568

Closed EagleDTW closed 2 years ago

EagleDTW commented 2 years ago

The problem

When attempting to pair the OwnTone server using Apple TV remote interface it has a 400 error followed by a 500 bad url error for attempting to connect to the server ip/api/pairing? This had been working in 2021.11.4, but is now broken.

the forked-daapd connects just fine.

Thank you, Daniel

What version of Home Assistant Core has the issue?

2021.11.5

What was the last working version of Home Assistant Core?

2021.11.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Apple TV

Link to integration documentation on our website

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

Example YAML snippet

The HA Apple TV remote will not pair with OwnTone (forked-daapd) and times out with 400 and 500 error bad gateway and url bad

Anything in the logs that might be useful for us?

No response

Additional information

No response

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

apple_tv documentation apple_tv source (message by IssueLinks)

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

Hey there @postlund, mind taking a look at this issue as it has been labeled with an integration (apple_tv) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

postlund commented 2 years ago

I believe this is because pyatv announces the pairing service on interfaces/addresses that are not accessible by owntone. I added an addresses argument so that it is possible to specify which addresses to use, but I'm not sure how to determine the correct addresses to use:

https://pyatv.dev/development/scan_pair_and_connect/#dmap-specifics

Maybe @bdraco can help out with this, aren't you the author of network which I guess can be used to solve this?

bdraco commented 2 years ago

Here is how we get the list of source ips in yeelight

   async def _async_build_source_set(self) -> set[IPv4Address]:
        """Build the list of ssdp sources."""
        adapters = await network.async_get_adapters(self._hass)
        sources: set[IPv4Address] = set()
        if network.async_only_default_interface_enabled(adapters):
            sources.add(IPv4Address("0.0.0.0"))
            return sources

        return {
            source_ip
            for source_ip in await network.async_get_enabled_source_ips(self._hass)
            if not source_ip.is_loopback and not isinstance(source_ip, IPv6Address)
        }
postlund commented 2 years ago

Fair enough, I will steal that. Thanks! 👍

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.