alandtse / alexa_media_player

This is a custom component to allow control of Amazon Alexa devices in Home Assistant using the unofficial Alexa API.
Apache License 2.0
1.41k stars 274 forks source link

Installing Alexa app on different phones result in multiple media_player.this_device with the same identity_ID #2206

Closed Adrian7654321 closed 2 months ago

Adrian7654321 commented 5 months ago

IMPORTANT: Please search the issues, including closed issues, and the FAQ before opening a new issue. The template is mandatory; failure to use it will result in issue closure.

Describe the bug

To Reproduce 1) install alexa app on an android device 2) reload the alexa integration 3) confirm the media_player.this_device is present 4) install alexa app on another android device 5) reload the alexa integration 6) confirm a new entity media_player.this_device_2 is present 7) the older instance will be marked with an error message about a duplicate identity_ID 8) After restarting HA, the error message on the older instance will change to : This entity is no longer being provided by the alexa_media integration. If the entity is no longer in use, delete it in settings.

Expected behavior

Each Alexa installation should result in the creation of a new media_player.this_device but with a different name and different identity_ID

Screenshots picture1

System details

Logs 2024-03-09 20:57:58.145 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up alexa_media platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_setup_platform await asyncio.gather(pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 630, in async_add_entities or not any(entity.should_poll for entity in entities) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 630, in or not any(entity.should_poll for entity in entities) ^^^^^^^^^^^^^^^^^^ File "/config/custom_components/alexa_media/sensor.py", line 591, in should_poll return not (self.hass.data[DATA_ALEXAMEDIA]["accounts"][self._account]["http2"]) ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'data' 2024-03-09 21:02:09.911 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities media_player.this_device are missing or not currently available 2024-03-09 21:11:58.146 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'alexa_media' accesses hass.components.group. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from group directly at custom_components/alexa_media/notify.py, line 240: entities.extend(self.hass.components.group.expand_entity_ids(entities)), please create a bug report at https://github.com/alandtse/alexa_media_player/issues 2024-03-09 21:50:17.762 ERROR (MainThread) [homeassistant.components.switch] Error while setting up alexa_media platform for switch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/alexa_media/switch.py", line 55, in async_setup_platform raise ConfigEntryNotReady homeassistant.exceptions.ConfigEntryNotReady: None 2024-03-09 21:50:17.766 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up alexa_media platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/alexa_media/sensor.py", line 73, in async_setup_platform raise ConfigEntryNotReady homeassistant.exceptions.ConfigEntryNotReady: None 2024-03-09 21:50:17.767 ERROR (MainThread) [homeassistant.components.alarm_control_panel] Error while setting up alexa_media platform for alarm_control_panel Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/alexa_media/alarm_control_panel.py", line 59, in async_setup_platform raise ConfigEntryNotReady homeassistant.exceptions.ConfigEntryNotReady: None 2024-03-09 21:50:17.770 ERROR (MainThread) [homeassistant.components.light] Error while setting up alexa_media platform for light Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/alexa_media/light.py", line 61, in async_setup_platform raise ConfigEntryNotReady homeassistant.exceptions.ConfigEntryNotReady: None 2024-03-09 21:50:17.772 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up alexa_media platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/alexa_media/binary_sensor.py", line 43, in async_setup_platform raise ConfigEntryNotReady homeassistant.exceptions.ConfigEntryNotReady: None 2024-03-09 21:50:53.963 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'alexa_media' accesses hass.components.persistent_notification. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from persistent_notification directly at custom_components/alexa_media/init.py, line 1290: hass.components.persistent_notification.async_dismiss(, please create a bug report at https://github.com/alandtse/alexa_media_player/issues 2024-03-09 21:51:03.294 ERROR (MainThread) [homeassistant.components.media_player] Platform alexa_media does not generate unique IDs. ID xxxxxxxxxxxxxxxxxxxxxxxxx already exists - ignoring media_player.this_device 2024-03-09 21:51:03.317 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up alexa_media platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_setup_platform await asyncio.gather(pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 630, in async_add_entities or not any(entity.should_poll for entity in entities) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 630, in or not any(entity.should_poll for entity in entities) ^^^^^^^^^^^^^^^^^^ File "/config/custom_components/alexa_media/sensor.py", line 591, in should_poll return not (self.hass.data[DATA_ALEXAMEDIA]["accounts"][self._account]["http2"]) ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'data' 2024-03-09 22:00:07.834 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities media_player.this_device are missing or not currently available

github-actions[bot] commented 2 months ago

The issue has received no activity for 60 days and will be closed in a week.