Add mac address to mqtt device connections#4071
Open
flabbamann wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the same device is added to Home Assistant by multiple integrations, HA can merge these devices into one based on the information these devices provide. I added the devices mac address to the auto discovery messages as described in https://www.home-assistant.io/integrations/sensor.mqtt/#device :
{ "device": { "identifiers": ["watermeter"], "connections": [["mac", "A1:B2:C3:D4:E5:F6"]], "name": "watermeter", "model": "Meter Digitizer", "manufacturer": "AI on the Edge Device", "sw_version": "main (a1ccda2)", "configuration_url": "http://192.168.47.78" } }My FritzBox router has an integration that adds all connected devices to HA. Initially I had two devices in HA, one from my FritzBox and one from MQTT (AI-on-the-edge-device). With this change these devices get merged into one:

With this I also think we don't need the mac address as a seperate entity/topic anymore, but I don't know if people want/need this for their setups 🤔.