alexa_media_player: Duplicated entities when using Home-Assistant-Matter-Hub custom Add-on
Describe the bug/issue
I started to use the custom add-on Home-Assistant-Matter-Hub which creates a Matter Hub whereby HA devices can be controlled via Alexa without using the Alexa via Home Assistant Cloud via Nabu Casa or the manually created Amazon Alexa Smart Home Skill (very slick!)
The Alexa Media Player application has logic already to handle devices added via the official Alexa Integration when using Include devices connected via Echo.
I duplicated this issue here so it can be a combined effort to find a good solution!
Here an example of a debug logs from a switch device:
{
"applianceId": "AAA_SonarCloudService_<void>",
"endpointTypeId": "",
"driverIdentity": {
"namespace": "AAA",
"identifier": "SonarCloudService"
},
"manufacturerName": "TestVendor",
"friendlyDescription": "TestVendor smart device",
"modelName": "",
"deviceType": "",
"version": "0",
"friendlyName": "Camara",
"friendlyNameModifiedAt": 1733084691197,
"capabilitiesModifiedAt": 1733084691197,
"ipAddress": "",
"port": "",
"entityId": "<void>",
"applianceNetworkState": {
"reachability": "REACHABLE",
"lastSeenAt": 1733130114179,
"createdAt": 1733084691197,
"lastSeenDiscoverySessionId": {
"value": "<void>"
}
},
"tags": {
"tagNameToValueSetMap": {}
},
"additionalApplianceDetails": {
"additionalApplianceDetails": {}
},
"firmwareVersion": "0",
"actions": [],
"capabilities": [
{
"capabilityType": "AVSInterfaceCapability",
"type": "AlexaInterface",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": true,
"retrievable": true,
"readOnly": false
},
"interfaceName": "Alexa.PowerController"
},
{
"capabilityType": "AVSInterfaceCapability",
"type": "AlexaInterface",
"version": "3",
"properties": {
"supported": [
{
"name": "connectivity"
}
],
"proactivelyReported": true,
"retrievable": true,
"readOnly": false
},
"interfaceName": "Alexa.EndpointHealth"
}
],
"applianceTypes": [
"SMARTPLUG"
],
"isEnabled": true,
"aliases": [],
"connectedVia": "Echo Comedor",
"alexaDeviceIdentifierList": [],
"applianceKey": "<void>",
"identifiers": {},
"applianceDriverIdentity": {
"namespace": "AAA",
"identifier": "SonarCloudService"
},
"ipaddress": "",
"applianceLambdaControlled": true,
"mergedApplianceIds": [
"AAA_SonarCloudService_<void>"
]
}
Maybe an option to exclude a likst of manufacturers or any other specific key will be useful.
- Setup new matther hub using https://github.com/t0bst4r/home-assistant-matter-hub/
- Enable
Include devices connected via Echo - Duplicated instances will show up all over the place
Expected behavior
Screenshots
System details
- Home Assistant version: latest
- alexa_media version (from
const.pyor HA startup log): latest - alexapy version (from
pip show alexapyin homeasssistant container or HA startup log): latest - Is Amazon 2FA/2SV enabled <!—We will not debug login issues if unanswered—> (y/n): y
- Amazon Domain: es
Debug Logs (alexa_media & alexapy) Please provide logs.
Additional context
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (1 by maintainers)
Commits related to this issue
- fix: ignore home-assistant-matter-hub entities (#2730) closes #2709 — committed to alandtse/alexa_media_player by danielbrunt57 2 years ago
- alexa_entity: Detect known HA Matter bridges Detect the association between leaf appliances and bridge appliances, and detect known HA matter bridges using the bridge appliance. This allows us to mor... — committed to kennylevinsen/alexa_media_player by kennylevinsen 2 years ago
- alexa_entity: Detect known HA Matter bridges Detect the association between leaf appliances and bridge appliances, and detect known HA matter bridges using the bridge appliance. This allows us to mor... — committed to kennylevinsen/alexa_media_player by kennylevinsen 2 years ago
It is unfortunately not correct for a matter bridge to report the bridge’s vendor on bridged devices. The vendor information there is meant to be that of the bridged device, e.g. “Philips” for a Hue bulb, not that of the bridge. The bridge vendor is only meant to be set on its own device node.
@danielbrunt57’s idea of getting the ID of the bridge device (which would still have the
t0bst4rvendor, and also detail that it is a matter hub if one wanted to filter those out more generically) and checking an appliance ID prefix seems like a more viable long-term approach on first glance…Yes, I forgot to set the vendor details for every device. Instead I only set it for the bridge. I’ve changed that and will release it tomorrow.
@danielbrunt57 it works fine 💅
Unless a
_LOGGER_debugstatement has been modified to specifically print it out, the only place I think you’ll see it is in the multi-page, single log entry:2024-12-04 03:29:08.552 DEBUG (MainThread) [alexapy.alexaapi] d****l@b******a: get_network_details response:get_network_details.txt
That is in my
alexaapi.pythat logs that entry:I think I modified that to use
login.debugto conditionally log the entry, which is this configuration flag:Correct! In addition to that, the user will need a way to somehow input that “skill” friendly name exclusion into AMP UI config. Currently,
exclude_devicesis the friendly name but only the friendly name of the device.FYI, AMP YAML Configuration has/is being deprecated and 5.0.0 now issues a warning to that effect. Alan failed to provide me with version numbers for the warning so my PR says v4.14.0 will eliminate it but he jumped from 4.13.8 to 5.0.0 on the latest merge/release! I’m not sure now which next version will totally ignore it but it definitely will be gone soon.