home-assistant / home-assistant/android

Matter commissioning potentially uses link-local addresses

Open
#4,528 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
3.9k
Forks
1.1k
Avg merge
1d 12h
Merged PRs (30d)
81

Description

**Home Assistant Android app version(s):**

**Android version(s):**
Android 14

**Device model(s):**
Pixel 8 Pro

**Home Assistant version:**
2024.8.0.dev202407190220

**Last working Home Assistant release (if known):**

**Description of problem, include YAML if issue is related to notifications:**

The current Matter commissioning flow simply returns a pin and IP address. The first implementation passed just the pin, which was problematic as it contains no Matter discriminator. This mean, if two devices were commissionable on the network, the Matter Server potentially picked the wrong device, which made the commissioning to fail (see https://github.com/home-assistant-libs/python-matter-server/issues/463).

Since #4069 we pass also the IPv6 address, which makes this work better. However, if the Android Matter commissioning flow returns a link-local IPv6 address, the Server can't reliably determine which network to use. A work around which scopes the link-local IPv6 addresses server side (see https://github.com/home-assistant-libs/python-matter-server/pull/501) makes it work for the common case (single network interface). However, this means that Matter devices can only be reliably commissioned using Android if they are on the primary network. This is tricky for advanced use cases (e.g. dual-home installation with a separate IoT VLAN, which is not the primary network).

Transporting IPv6 link-local addresses to the Server is really a hack. The underlying Matter SDK API to commission a Matter device through an IP address (`ConnectIP`) is also deprecated.

The Android App should really communicate a setup code/QR code or a pin code _with_ discriminator to the backend. We should check if there are alternative APIs available, or if we can determine the discriminator somehow using the current API.

**Companion App Logs:**

```

```

**Screenshot or video of problem:**

**Additional information:**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.