Is there an existing issue for this?
Is your feature request related to a problem? Please describe
When NetAlertX publishes devices to Home Assistant via MQTT Discovery, the generated discovery payload includes device identifiers but does not include a Home Assistant device connection based on the device MAC address.
Currently the MQTT discovery payload contains something similar to:
{
"device": {
"identifiers": ["<device_id>_sensor"],
"manufacturer": "NetAlertX",
"name": "<device_name>"
}
}
The MAC address is available elsewhere in the payload and is already passed into the MQTT publisher (mac=device["devMac"]), but it is not exposed in the device.connections field.
As a result, Home Assistant cannot associate NetAlertX entities with the same physical device discovered by other integrations (e.g. FRITZ!Box Tools, UniFi, Router integrations, etc.), leading to duplicate devices in the Home Assistant device registry.
Describe the solution you'd like
Add the MAC address as a Home Assistant device connection in all MQTT discovery payloads:
{
"device": {
"identifiers": ["<device_id>_sensor"],
"connections": [
["mac", "AA:BB:CC:DD:EE:FF"]
],
"manufacturer": "NetAlertX",
"name": "<device_name>"
}
}
and similarly for device_tracker discovery messages.
Describe alternatives you've considered
If automatic publication is considered a breaking change, a configuration option could be introduced:
MQTT_INCLUDE_MAC_CONNECTION=true
enabled by default for new installations.
Anything else?
The MAC address is already available within the MQTT publisher code and would only need to be added to the generated Home Assistant discovery payload. This appears to be a relatively small change with potentially significant usability benefits for Home Assistant users running multiple network-discovery integrations.
See also: https://developers.home-assistant.io/docs/device_registry_index/
Am I willing to test this? 🧪
Can I help implement this? 👩💻👨💻
Is there an existing issue for this?
Is your feature request related to a problem? Please describe
When NetAlertX publishes devices to Home Assistant via MQTT Discovery, the generated discovery payload includes device identifiers but does not include a Home Assistant device connection based on the device MAC address.
Currently the MQTT discovery payload contains something similar to:
The MAC address is available elsewhere in the payload and is already passed into the MQTT publisher (mac=device["devMac"]), but it is not exposed in the device.connections field.
As a result, Home Assistant cannot associate NetAlertX entities with the same physical device discovered by other integrations (e.g. FRITZ!Box Tools, UniFi, Router integrations, etc.), leading to duplicate devices in the Home Assistant device registry.
Describe the solution you'd like
Add the MAC address as a Home Assistant device connection in all MQTT discovery payloads:
and similarly for device_tracker discovery messages.
Describe alternatives you've considered
If automatic publication is considered a breaking change, a configuration option could be introduced:
MQTT_INCLUDE_MAC_CONNECTION=trueenabled by default for new installations.
Anything else?
The MAC address is already available within the MQTT publisher code and would only need to be added to the generated Home Assistant discovery payload. This appears to be a relatively small change with potentially significant usability benefits for Home Assistant users running multiple network-discovery integrations.
See also: https://developers.home-assistant.io/docs/device_registry_index/
Am I willing to test this? 🧪
netlertx-devimage when requested within 48h and report bugs to help deliver a great user experience for everyone and not to break existing installations.Can I help implement this? 👩💻👨💻