-
-
Notifications
You must be signed in to change notification settings - Fork 29k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mac address as connection for matter device #121257
Add mac address as connection for matter device #121257
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
38efa9c
to
11a296d
Compare
I've marked this PR, as changes are requested that need to be processed. Thanks! 👍 ../Frenck |
11a296d
to
e3f84fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
@agners Oh no, that doesn't look right. I suspect the devices all share the invalid |
Yeah I have at least two devices which return I guess technically, this is a valid MAC address. But these devices don't use this as physical address (according to my AP). Technically, the Matter standard says Anyhow, given that Matter devices return such addresses, this is more a Matter problem. I'd suggest to filter them out on Matter integration side. |
Btw, what is the exact use case/motivation behind this PR? Do you have a device where this connects up with other integrations or something? I am a bit worried since MAC address privacy extensions become more and more commonplace. The Matter standard also mentions that when it comes to host name generation. It seems we have to expect that devices rotate MAC addresses:
|
Unfortunately, I can't work on this today. @agners I still have the checks that I removed here: def is_NULL(self) -> bool:
"""Check if the address is NULL value/should not be used.
See: https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf
'Values based on a zero-valued OUI [...] shall not be used as identifiers.'
"""
return self.address[:3] == b"\x00\x00\x00"
def is_individual(self) -> bool:
"""Check if the address is an individual address, not a group address."""
return self.address[0] & 0x01 == 0
def _valid_connection(self) -> bool:
return self.is_individual() and not self.is_NULL() |
Oh I see. I just looked up OUI, and with 00:00:00 Xerox came up, so assumed it is valid. |
@agners I have a matter device that wants to connect to the manufacturer to make auto-updates, which I don't want. My router integration adds a switch for every connected device to block its internet access. And it annoys me that I regularly have duplicate devices in my list. |
@agners You are right to point out that there will be more devices with address rotation in the future, which could be an issue for mac addresses to be used as unique device identifiers. However, this should not cause any severe problems in HA. Also, as I understand it, the addresses are only stored until the integration that provides the entity reloads. So even when the addresses rotate, it wouldn't spam the device registry with addresses. (Also, I guess that most Matter devices won't move from network to network regularly, and therefore manufacturers won't bother with implementing privacy enhancing rotating addresses.) |
Proposed change
This PR adds a mac address connection for matter devices that have a mac address, so that they can be matched with existing devices in the registry.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: