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.44k stars 275 forks source link

Notify (TTS) not working: `Login error detected; not contacting API` #2438

Closed liuk4friends closed 2 weeks ago

liuk4friends commented 1 month 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

all amazon devices are available but notify doesn't work

updated to 2024.8.0 and Alexa Media Player 4.12.7

Expected behavior

notify (TTS) to alexa devices is not working with errors:

Screenshots

System details

Logs

Registratore: homeassistant
Fonte: /usr/src/homeassistant/homeassistant/runner.py:148
Prima occorrenza: 19:47:52 (10 occorrenze)
Ultima registrazione: 20:52:43

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 960, in send_announcement
    await self.send_sequence(
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 512, in send_sequence
    await self.run_behavior(node_data, queue_delay=queue_delay)
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 434, in run_behavior
    await self._post_request("/api/behaviors/preview", data=data)
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 226, in _post_request
    return await self._request("post", uri, data, query)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 199, in _request
    raise AlexapyLoginError("Login error detected; not contacting API")
alexapy.errors.AlexapyLoginError: Login error detected; not contacting API

Additional context

danielbrunt57 commented 1 month ago

Note to self: must remember to update the template!

danielbrunt57 commented 1 month ago

Have you cleared the Devices that suppress OTP?

image

danielbrunt57 commented 1 month ago

alexapy.errors.AlexapyLoginError: Login error detected; not contacting API

It's a login error within alexapy. Try deleting your /config/.storage/alexa_media.<config_entry_identifier>.pickle file and restart HA,..

liuk4friends commented 1 month ago

Have you cleared the Devices that suppress OTP?

image

First of all, thanks for the reply, No I don't think I've activated this feature. I don't even remember ever seeing this screen

liuk4friends commented 1 month ago

alexapy.errors.AlexapyLoginError: Login error detected; not contacting API

It's a login error within alexapy. Try deleting your config/.storage/alexa_media.<config_entry_identifier>.pickle file and restart HA,..

Sorry, I use HassOS. I don't see this file in the '/custom_components/alexa_media/' folder

danielbrunt57 commented 1 month ago

I use HassOS. I don't see this file in the alexa_media folder

It's not in /config/custom_components/alexa_media, it's in /config/.storage/

danielbrunt57 commented 1 month ago

No I don't think I've activated this feature. I don't even remember ever seeing this screen

image

kezza2k7 commented 1 month ago

I don't even see the config/.storage/alexa_media.<config_entry_identifier>.pickle file in my files

danielbrunt57 commented 1 month ago

I don't even see the config/.storage/alexa_media.<config_entry_identifier>.pickle file in my files

What are you using to see your files?

kezza2k7 commented 1 month ago

Windows File Explorer, I have also used casaos

500 Internal Server Error
Server got itself in trouble

That's what I get after doing the login

liuk4friends commented 1 month ago

I use HassOS. I don't see this file in the alexa_media folder

It's not in /config/custom_components/alexa_media, it's in /config/.storage/

I found and deleted the file. I restarted HassOS. Now notifications via alexa media player seem to work

danielbrunt57 commented 1 month ago

It's not in /config/custom_components/alexa_media, it's in /config/.storage/

If you see custom_components/alexa_media, there is a .storage/ folder at the same level as custom_components/ but it's likely a hidden folder. Windows Explorer has option to display all files/folders even hidden.

kezza2k7 commented 1 month ago

It's not in /config/custom_components/alexa_media, it's in /config/.storage/

If you see custom_components/alexa_media, there is a .storage/ folder at the same level as custom/components but it's likely a hidden folder. Windows Explorer has option to display all files/folders even hidden.

I can go into the /config/.storage just the file isn't there at all? and Logging in still doesn't work?

danielbrunt57 commented 1 month ago

I can go into the /config/.storage just the file isn't there at all?

There's no .pickle file? Then your initial login isn't even getting to first base to get cookies, put them in the cookie jar and then pickle it. (Kinda sounds like grandma's kitchen doesn't it)

kezza2k7 commented 1 month ago

I can go into the /config/.storage just the file isn't there at all?

There's no .pickle file? Then your initial login isn't even getting to first base to get cookies, put them in the cookie jar and then pickle it. Kinda sounds like grandma's kitchen, doesn't it??

I'm doing it through HACS? Therfore I thought that made the cookied since before it broke, That's how I set it up?

danielbrunt57 commented 1 month ago

HACS is just used to get and install the custom_component into HA. After restart, HA add integrations is where the configuration is done.

kezza2k7 commented 1 month ago

HACS is just used to get and install the custom_component into HA. After restart, HA add integrations is where the configuration is done.

yeah, You go into integration, press on it input your details and then it opens a website where you select Stay Logged in and then do the captcha

danielbrunt57 commented 1 month ago

HACS is just used to get and install the custom_component into HA. After restart, HA add integrations is where the configuration is done.

yeah, You go into integration, press on it input your details and then it opens a website where you select Stay Logged in and then do the captcha

Don't select Stay logged in in the login window or the Don't require OTP on this device in the Two-Step Verification window. You're seeing a captcha before the 2SV window?

kezza2k7 commented 1 month ago

I don't have two-step setup, and I tried it without selecting the Stay Logged in, I still get a Internal Server Error

kezza2k7 commented 1 month ago
Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:426
First occurred: 20:48:36 (5 occurrences)
Last logged: 21:01:36

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 373, in handle_async_request
    resp = await self._pool.handle_async_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
    raise exc from None
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
    response = await connection.handle_async_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
    return await self._connection.handle_async_request(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/http11.py", line 143, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/http11.py", line 113, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/http11.py", line 186, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/http11.py", line 224, in _receive_event
    data = await self._network_stream.read(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 32, in read
    with map_exceptions(exc_map):
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ReadTimeout

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 456, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/alexa_media/config_flow.py", line 1032, in wrapped
    return await cls.handler(request, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/authcaptureproxy/auth_capture_proxy.py", line 439, in all_handler
    resp = await getattr(self.session, method)(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1892, in post
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1574, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1661, in send
    response = await self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1689, in _send_handling_auth
    response = await self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1726, in _send_handling_redirects
    response = await self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1763, in _send_single_request
    response = await transport.handle_async_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 372, in handle_async_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout
Logger: frontend.js.modern.202408061
Source: components/system_log/__init__.py:333
First occurred: 20:54:03 (2 occurrences)
Last logged: 20:54:03

Uncaught error from Chrome 127.0.0.0 on Windows 10 TypeError: Cannot read properties of undefined (reading 'domain') _keyFunction (src/panels/config/integrations/dialog-add-integration.ts:471:16) keyFunction (src/virtualize.ts:116:41) r (src/directives/repeat.ts:56:28) ct (src/directives/repeat.ts:93:52) update (src/directive.ts:134:16) _$AS (src/lit-html.ts:1085:23) S (src/lit-html.ts:1362:12) _$AI (src/async-directive.ts:366:18) setValue (src/virtualize.ts:139:13) dispatchEvent (src/Virtualizer.ts:809:23)
liuk4friends commented 1 month ago

I use HassOS. I don't see this file in the alexa_media folder

It's not in /config/custom_components/alexa_media, it's in /config/.storage/

I found and deleted the file. I restarted HassOS. Now notifications via alexa media player seem to work

Unfortunately after a short time the problem returned. The notifications through alexa media player no longer work. Deleting that file did not solve the problem.

Here is the log:

Registratore: homeassistant
Fonte: /usr/src/homeassistant/homeassistant/runner.py:148
Prima occorrenza: 23:00:04 (2 occorrenze)
Ultima registrazione: 23:10:59

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 960, in send_announcement
    await self.send_sequence(
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 512, in send_sequence
    await self.run_behavior(node_data, queue_delay=queue_delay)
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 434, in run_behavior
    await self._post_request("/api/behaviors/preview", data=data)
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 226, in _post_request
    return await self._request("post", uri, data, query)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 199, in _request
    raise AlexapyLoginError("Login error detected; not contacting API")
alexapy.errors.AlexapyLoginError: Login error detected; not contacting API
chrisvblemos commented 1 month ago

I use HassOS. I don't see this file in the alexa_media folder

It's not in /config/custom_components/alexa_media, it's in /config/.storage/

I found and deleted the file. I restarted HassOS. Now notifications via alexa media player seem to work

Unfortunately after a short time the problem returned. The notifications through alexa media player no longer work. Deleting that file did not solve the problem.

Here is the log:

Registratore: homeassistant
Fonte: /usr/src/homeassistant/homeassistant/runner.py:148
Prima occorrenza: 23:00:04 (2 occorrenze)
Ultima registrazione: 23:10:59

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 960, in send_announcement
    await self.send_sequence(
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 512, in send_sequence
    await self.run_behavior(node_data, queue_delay=queue_delay)
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 434, in run_behavior
    await self._post_request("/api/behaviors/preview", data=data)
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 226, in _post_request
    return await self._request("post", uri, data, query)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 199, in _request
    raise AlexapyLoginError("Login error detected; not contacting API")
alexapy.errors.AlexapyLoginError: Login error detected; not contacting API

Did you enable debug logging as described here? Looking at the code, there should be more logs to look at.

liuk4friends commented 1 month ago

I use HassOS. I don't see this file in the alexa_media folder

It's not in /config/custom_components/alexa_media, it's in /config/.storage/

I found and deleted the file. I restarted HassOS. Now notifications via alexa media player seem to work

Unfortunately after a short time the problem returned. The notifications through alexa media player no longer work. Deleting that file did not solve the problem. Here is the log:

Registratore: homeassistant
Fonte: /usr/src/homeassistant/homeassistant/runner.py:148
Prima occorrenza: 23:00:04 (2 occorrenze)
Ultima registrazione: 23:10:59

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 960, in send_announcement
    await self.send_sequence(
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 512, in send_sequence
    await self.run_behavior(node_data, queue_delay=queue_delay)
  File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 434, in run_behavior
    await self._post_request("/api/behaviors/preview", data=data)
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 226, in _post_request
    return await self._request("post", uri, data, query)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 199, in _request
    raise AlexapyLoginError("Login error detected; not contacting API")
alexapy.errors.AlexapyLoginError: Login error detected; not contacting API

Did you enable debug logging as described here? Looking at the code, there should be more logs to look at.

Thank you for this hint. Now my Alexa devices are in do-not-disturb-mode and my family is sleeping. Tomorrow morning I'll give it a try and then I'll post here the results

ebonzl commented 1 month ago

I can confirm I was getting the same error since upgrading to HA 2024.08, and Alexa 4.12.5 - Have just installed 4.12.7 and all is working again at this time

liuk4friends commented 1 month ago

Did you enable debug logging as described here? Looking at the code, there should be more logs to look at.

I've enabled debug logging. In the meantime I saw that another user opened an issue similar to this one and that, as a temporary solution, he created an automation that reloads the AMP integration every 10 minutes. So I tried to reload AMP to see if the notifications would work again. Indeed, if AMP is reloaded it works again. This is the log immediately after reloading AMP:

Registratore: homeassistant.config_entries
Fonte: config_entries.py:819
Prima occorrenza: 10:07:04 (1 occorrenze)
Ultima registrazione: 10:07:04

Error unloading entry luca.**************@icloud.com - amazon.it for notify
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 819, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 135, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
liuk4friends commented 1 month ago

via 'log viewer' I traced:

Below I publish the logs:

txolo99 commented 1 month ago

Did you enable debug logging as described here? Looking at the code, there should be more logs to look at.

I've enabled debug logging. In the meantime I saw that another user opened an issue similar to this one and that, as a temporary solution, he created an automation that reloads the AMP integration every 10 minutes. So I tried to reload AMP to see if the notifications would work again. Indeed, if AMP is reloaded it works again. This is the log immediately after reloading AMP:

Registratore: homeassistant.config_entries
Fonte: config_entries.py:819
Prima occorrenza: 10:07:04 (1 occorrenze)
Ultima registrazione: 10:07:04

Error unloading entry luca.**************@icloud.com - amazon.it for notify
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 819, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 135, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Same issue with HA updated to 2024.8.0 and Alexa Media Player 4.12.7. As a temporary solution, I've created an automation that reloads the AMP integration every 10 minutes

antoweb commented 1 month ago

I can confirm Alexa media Player integraton must be restart for return to working the voice notification

liuk4friends commented 1 month ago

Same issue with HA updated to 2024.8.0 and Alexa Media Player 4.12.7. As a temporary solution, I've created an automation that reloads the AMP integration every 10 minutes

as a temporary solution I also created an automation that recharges AMP every 10 minutes

antoweb commented 1 month ago

Same issue with HA updated to 2024.8.0 and Alexa Media Player 4.12.7. As a temporary solution, I've created an automation that reloads the AMP integration every 10 minutes

as a temporary solution I also created an automation that recharges AMP every 10 minutes

Me too

liuk4friends commented 1 month ago

If it helps, I share the AMP reboot log. It is not complete but only the initial phase. I deleted my account and tokens for security reasons

AMP reboot

Redrex85 commented 1 month ago

hi, I also have the same problem, especially on the air quality monitor, restarting it works for a while, then it freezes again, how did you do the reload automation?

chpego commented 1 month ago

I can confirm I was getting the same error since upgrading to HA 2024.08, and Alexa 4.12.5 - Have just installed 4.12.7 and all is working again at this time

Work's for me too !

antoweb commented 1 month ago

I can confirm I was getting the same error since upgrading to HA 2024.08, and Alexa 4.12.5 - Have just installed 4.12.7 and all is working again at this time

Work's for me too !

Ha 2024.08 and Alexa 4.12.7 Problem still existing

chrisvblemos commented 1 month ago

https://pastebin.com/EgP3T76p

2024-08-09 18:00:02.084 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.com/api/bootstrap returned 401:Unauthorized with response 

and

2024-08-09 18:00:03.087 DEBUG (MainThread) [alexapy.alexahttp2] HTTP2 Connection Closed.
2024-08-09 18:00:03.089 DEBUG (MainThread) [custom_components.alexa_media] l**************o@i********m: Close requested; will not reconnect http2

are the most interesting to me.

Try the following: For the first one, delete/remove alexa media player from the UI->Settings->Devices&Services, then go into /config/.storage/ (.storage is a hidden folder) and delete the pickle file with your e-mail in it. Then re-add the integration via UI and reconfigure it. Post new logs if issue persists.

As for the second line, I have no idea how HTTP2 is receiving a close request. Tried to backtrack all calls but I think I'm getting lost. Not sure if this log is a problem either way, just something that I haven't seen yet. Know anything @danielbrunt57 ?

liuk4friends commented 1 month ago

Try the following: For the first one, delete/remove alexa media player from the UI->Settings->Devices&Services, then go into /config/.storage/ (.storage is a hidden folder) and delete the pickle file with your e-mail in it. Then re-add the integration via UI and reconfigure it. Post new logs if issue persists.

At this time and also for the next few days I will not have access to my mac. Maybe next Wednesday I will be able to try the path you indicated.

As for the second line, I have no idea how HTTP2 is receiving a close request. Tried to backtrack all calls but I think I'm getting lost. Not sure if this log is a problem either way, just something that I haven't seen yet. Know anything @danielbrunt57 ?

I certainly have no idea but I will follow the developments with interest.

danielbrunt57 commented 1 month ago

Know anything @danielbrunt57 ?

No, not yet as I've not had time to dig into it...

PistolaPeteUK commented 1 month ago

I'm really confused. I've had this issue for a couple of months, and I could sort it using an automation to reload the integration 60 seconds after HA starts. THis was working until 2024.08 where the reload wouldn't work. I tried to delete my .pickle file but it wasn't there, and then I noticed I was on 4.10.2 which is a few weeks out of date - not sure why it's not flagged for an update but hey ho - I updated to the latest version and after a reboot still had the same problem. I could now see a .pickle file which I deleted and rebooted....still no change.

This morning, I'm sat working in my office and I get a TTS notificaton from an automation on my Echo Show. I go an look at the integration and it's now working. I rebooted HA, and it's still working.

andrea-git commented 1 month ago

Once delete .pickle file it has been recreated after HA restart

CoreyJ87 commented 4 weeks ago

Same problem here tried all of the above mentioned things. Nothing worked

liuk4friends commented 4 weeks ago

Try the following: For the first one, delete/remove alexa media player from the UI->Settings->Devices&Services, then go into /config/.storage/ (.storage is a hidden folder) and delete the pickle file with your e-mail in it. Then re-add the integration via UI and reconfigure it. Post new logs if issue persists.

I followed your instructions. After re-authenticating, the integration worked correctly for at least 40 minutes but I am sure that after three hours the voice notifications were inactive again. I am publishing below the error log of the moment I noticed it (an automation that also sends me a telegram notification) and a test I did immediately after...

AMP errors after re-authenticate

After reloading AMP, notifications started working again

liuk4friends commented 4 weeks ago

This a detailed log some hours after ....

AMP errors detailed log

txolo99 commented 4 weeks ago

This a detailed log some hours after ....

https://pastebin.com/Dn0eEwDt

Of all the links you have posted, none of them are valid.... Hyperlinks lead to "url".

danielbrunt57 commented 4 weeks ago

This a detailed log some hours after ....

https://pastebin.com/Dn0eEwDt

The URL needs to be inside the ( ) The [ ] is for the clickable text that will be displayed.

[This is the text and the link is https://pastebin.com/Dn0eEwDt](https://pastebin.com/Dn0eEwDt)

This is the text and the link is https://pastebin.com/Dn0eEwDt

danielbrunt57 commented 4 weeks ago

The offending error is ('Login error detected; not contacting API',).

I re & re'd my integration almost 13 hours ago and my notify.alexa_media services are still working fine. Have you disabled Enable newly added entities?

image

danielbrunt57 commented 4 weeks ago

This a detailed log some hours after .... https://pastebin.com/Dn0eEwDt

Of all the links you have posted, none of them are valid.... Hyperlinks lead to "url".

[https://pastebin.com/Dn0eEwDt](**_url_**)

liuk4friends commented 4 weeks ago

This a detailed log some hours after .... https://pastebin.com/Dn0eEwDt

Of all the links you have posted, none of them are valid.... Hyperlinks lead to "url".

[https://pastebin.com/Dn0eEwDt](**_url_**)

Sorry. I fixed the links in my previous posts

liuk4friends commented 4 weeks ago

Following the discussion in other recent issues, I disabled the two options that concern "adding new entities" and "polling for updates". I did a couple of tests through the 'actions' of 'developer tools'. The notifications seem to work but the automation that restarts AMP every 10 minutes is still enabled

AMP notify test OK after disabling polling

antoweb commented 3 weeks ago

Sorry why closed? The solution Is disabling the polling?

liuk4friends commented 3 weeks ago

Enable newly added entities

I tried disabling 'Enable newly added entities', leaving "Enable polling for updates" enabled instead.

After a few hours, AMP notifications stopped working and now the integration asks for authentication again.

I specify that yesterday I also followed the procedure indicated in another issue (removing AMP, deleting the .pickle file, restarting, reactivating AMP).

This is the log if I try to launch a notification

('Login error detected; not contacting API',) 2024-08-17 18:02:30.996 WARNING (MainThread) [alexapy.helpers] alexaapi.send_sequence((<alexapy.alexaapi.AlexaAPI object at 0x7f5d8efdd0>, 'AlexaAnnouncement'), {'customer_id': 'A1************6L', 'expireAfter': 'PT5S', 'content': [{'locale': 'it-it', 'display': {'title': '', 'body': ''}, 'speak': {'type': 'text', 'value': 'Questo annuncio è soltanto un test'}}], 'target': {'customerId': 'A**********A6L', 'devices': [{'deviceSerialNumber': '8****************************b68', 'deviceTypeId': 'A3NPD82ABCPIDP'}]}, 'skillId': 'amzn1.ask.1p.routines.messaging', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',) 2024-08-17 18:02:30.997 WARNING (MainThread) [alexapy.helpers] alexaapi.send_announcement((<alexapy.alexaapi.AlexaAPI object at 0x7f5d8efdd0>, 'Questo annuncio è soltanto un test'), {'customer_id': 'A1************6L', 'targets': ['85e16bfd04964b03b1d18e225cb0db68'], 'title': 'Home Assistant', 'method': 'speak', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)

I propose to reopen this issue because the problem is not solved and I think that the same should be done for other recent issues, similar to this one, perhaps by reuniting them.

If I'm not wrong, there is one on 'voice notifications' and another that concerns a new authentication problem, all opened, like this one, immediately after the release of Home Assistant 2024.08.