Skip to content
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

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

Open
Adrian7654321 opened this issue Mar 10, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed no-issue-activity

Comments

@Adrian7654321
Copy link

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

  • When Installing the Alexa app on 2 different android devices (with the same account) it will result in one entity called media_player.this_device and another one called media_player.this_device_2
  • only the last instance media_player.this_device_2 will be accessible to play media.
  • the older entity will have an error message:<This entity ('media_player.this_device') does not have a unique ID, therefore its settings cannot be managed from the UI. See the documentation for more detail.>

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

  • Home-assistant (version): Core 2024.3.0, Supervisor 2024.02.1, Operating System 12.0, Frontend 20240306.0
  • alexa_media : 4.9.2
  • alexapy 4.9.2
  • Amazon [2FA is enabled] YES

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

@alandtse alandtse added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 23, 2024
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed no-issue-activity
Projects
None yet
Development

No branches or pull requests

2 participants