Closed Javisen closed 3 months ago
Ciao! The same thing happens to me; I was forced to create an automation that restarts AMP every 10 minutes to avoid issues.
@Javisen , @nicolacavallo84
Need to see alexa_media
& alexapy
logs at the time you've noticed action: notify.alexa_media_<your_device>
is not working...
Try to delete config\.storage\alexa_media.xxxxx@xxxx.xxx.pickle
Hi, also follow the discussion on the issue #2438 which is very similar to this one
Registrador: homeassistant.config_entries Fuente: config_entries.py:819 Ocurrió por primera vez: 11:36:41 (2 ocurrencias) Último inicio de sesión: 11:40:14
Error unloading entry ****@hotmail.com - amazon.es 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!
This is the error log when I reload AMP. I have deleted the .pikcle archive.
This is the error I get when I try to call the service and AMP does not respond:
Registratore : alexapy.helpers Fonte : runner.py:190 Prima occorrenza : 14:57:04 ( 6 occorrenze ) Ultima registrazione : 14:57:13
alexaapi.run_behavior((<oggetto alexapy.alexaapi.AlexaAPI in 0x7f27edc4b380>, {'@type': 'com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode', 'type': 'AlexaAnnouncement', 'operationPayload': {'deviceType': 'A3VRME03NAXFUB', 'deviceSerialNumber': 'G****AX9', 'locale': 'it-it', 'customerId': 'AE8D', 'expireAfter': 'PT5S', 'content': [{'locale': 'it-it', 'display': {'title': 'Home Assistant', 'body': 'ciao'}, 'speak': {'type': 'text', 'value': 'ciao'}}], 'target': {'customerId': 'AE8D', 'devices': [{'deviceSerialNumber': 'G****AX9', 'deviceTypeId': 'A3VRME03NAXFUB'}]}, 'skillId': 'amzn1.ask.1p.routines.messaging'}}), {'queue_delay': 1.5}): Si è verificato un errore durante l'accesso ad AlexaAPI: si è verificata un'eccezione di tipo AlexapyLoginError. Argomenti: ('Errore di accesso rilevato; nessuna API in contatto',) alexaapi.send_sequence((<oggetto alexapy.alexaapi.AlexaAPI in 0x7f27edc4b380>, 'AlexaAnnouncement'), {'customer_id': 'ASP312D0MJE8D', 'expireAfter': 'PT5S', 'content': [{'locale': 'it-it', 'display': {'title': 'Home Assistant', 'body': 'ciao'}, 'speak': {'type': 'text', 'value': 'ciao'}}], 'target': {'customerId': 'A*****E8D', 'devices': [{'deviceSerialNumber': 'G****AX9', 'deviceTypeId': 'A3VRME03NAXFUB'}]}, 'skillId': 'amzn1.ask.1p.routines.messaging', 'queue_delay': 1.5}): Si è verificato un errore durante l'accesso ad AlexaAPI: si è verificata un'eccezione di tipo AlexapyLoginError. Argomenti: ('Errore di accesso rilevato; nessuna API in contatto',) alexaapi.send_announcement((<alexapy.alexaapi.Oggetto AlexaAPI in 0x7f27edc4b380>, 'ciao'), {'customer_id': 'ASP312D0MJE8D', 'targets': ['G0014D0601760AX9'], 'title': 'Home Assistant', 'method': 'all', 'queue_delay': 1.5}): Si è verificato un errore durante l'accesso ad AlexaAPI: si è verificata un'eccezione di tipo AlexapyLoginError. Argomenti: ('Errore di accesso rilevato; nessuna API in contatto',)
this one instead is a few minutes before calling the service.
Registratore: alexapy.helpers Fonte: custom_components/alexa_media/init.py:785 Integrazione: Alexa Media Player (documentazione, problemi) Prima occorrenza: 14:55:50 (2 occorrenze) Ultima registrazione: 14:55:50
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f27ff9acc20>,), {'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Unauthorized',) alexaapi.get_last_device_serial((<alexapy.alexalogin.AlexaLogin object at 0x7f27ff9acc20>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Unauthorized',)
+1
After a few hours I have same the error
+1
Every time I restart AMP I get this error in the logs:
Registratore: homeassistant.config_entries Fonte: config_entries.py:819 Prima occorrenza: 16:09:43 (1 occorrenze) Ultima registrazione: 16:09:43
Error unloading entry xxxxxx@gmail.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!
+1
Every time I restart AMP I get this error in the logs:
Registratore: homeassistant.config_entries Fonte: config_entries.py:819 Prima occorrenza: 16:09:43 (1 occorrenze) Ultima registrazione: 16:09:43
Error unloading entry xxxxxx@gmail.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!
This error is expected and probably not the cause of the issue. I believe the root issue lies in your previous log.
Este en cambio es unos minutos antes de llamar al servicio.
Registro: alexapy.helpers Fuente: custom_components/alexa_media/ init .py:785 Integración: Alexa Media Player ( documentación , problemas ) Primera aparición: 14:55:50 (2 apariciones) Último registro: 14:55:50
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f27ff9acc20>,), {'max_record_size': 10}): Se produjo un error al acceder a AlexaAPI: se produjo una excepción del tipo AlexapyLoginError. Argumentos: ('No autorizado',) alexaapi.get_last_device_serial((<alexapy.alexalogin.AlexaLogin object at 0x7f27ff9acc20>,), {}): Se produjo un error al acceder a AlexaAPI: se produjo una excepción del tipo AlexapyLoginError. Argumentos: ('No autorizado',)
The same thing happens to me as to you, I deleted the file and restarted and they still don't notify Alexa
Same problem here. After updating HA to 2024.8 and solving all the problems related to AMP and alexapy by upgrading both to the latest (AMP 4.12.7 and AlexaPy 1.28.2), login now kind of works, but TTS notifications are not working correctly after a while and this is the error I get
2024-08-10 10:47:37.792 WARNING (MainThread) [alexapy.helpers] alexaapi.send_sequence((<alexapy.alexaapi.AlexaAPI object at 0x7f63c45280>, 'Alexa.Speak'), {'customer_id': 'A**********UL8', 'textToSpeak': 'This is a test message', 'target': {'customerId': 'A**********UL8', 'devices': [{'deviceSerialNumber': 'G************2WJ', 'deviceTypeId': 'A2H4LV5GIZ1JFT'}]}, 'skillId': 'amzn1.ask.1p.saysomething', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments:
('Login error detected; not contacting API',)
2024-08-10 10:47:37.792 WARNING (MainThread) [alexapy.helpers] alexaapi.send_tts((<alexapy.alexaapi.AlexaAPI object at 0x7f63c45280>, 'This is a test message'), {'customer_id': 'A**********UL8', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments:
('Login error detected; not contacting API',)
2024-08-10 10:47:37.793 ERROR (MainThread) [homeassistant] 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 889, in send_tts
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
So, it seems even TTS notifications problems have to do with login errors ("Login error detected; not contacting API"). I guess a fix is needed in that area of the code somehow. FWIW, my amazon domain is amazon.it.
I believe most of the errors being reported one after the other on AMP are somehow all tied to this login issue. For instance, I've just tried to call the service alexa_media.update_last_called, called in many of my automations, and I get a different log, but always tight to login issues:
2024-08-10 11:18:52.241 WARNING (MainThread) [alexapy.helpers] alexaapi.get_state((<alexapy.alexaapi.AlexaAPI object at 0x7f63aa98b0>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments:
('Login error detected; not contacting API',)
I don't want to go off topic here, but just saying all the errors being reported on AMP recently might have a similar root-cause.
The same thing happens to me, after 30 minutes it stops notifying anything, if I reload Alexa Media Player or restart Home Assistant it works but what I said after 30 minutes it stops notifying And apart from stopping notifying every so often it asks me to authenticate, in the end I downgraded the version, this is not worth it for me, thanks to the people of the project because I know that you are working hard to solve the problem
I'm putting the logs back up in case it helps at all.
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
alexaapi.send_tts((<alexapy.alexaapi.AlexaAPI object at 0x7fa8e0d4bf50>, 'Puerta principal abierta'), {'customer_id': 'A1A18GQN4AHK1F', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)
If possible, can you guys provide a giant/full log? I want to look if there are any other problems with the HTTP2 pings, or HTTP2 in general. You can ommit any occurences of cookies and tokens for security.
Remember to leave the debug logging activated in AMP throughout the day when the issue occurs, otherwise nothing of use will be logged. I'm having issues replicating the error since my domain (amazon.com.br) is different and I had no issues so far, so probably something related to EU if all else is OK.
If possible, can you guys provide a giant/full log? I want to look if there are any other problems with the HTTP2 pings, or HTTP2 in general. You can ommit any occurences of cookies and tokens for security.
Remember to leave the debug logging activated in AMP throughout the day when the issue occurs, otherwise nothing of use will be logged. I'm having issues replicating the error since my domain (amazon.com.br) is different and I had no issues so far, so probably something related to EU if all else is OK.
2024-08-10 18:33:01.532 DEBUG (MainThread) [alexapy.alexahttp2] Received raw message: Content-Type: application/json
{"directive":{"header":{"namespace":"Alexa.Mobile.Push","name":"RenderUpdate","messageId":"b85c5ea9-b8b3-4d64-ac45-f5d4af05e5ea"},"payload":{"renderingUpdates":[{"route":"EventBus:tcomm::message","resourceId":"PUSH_EQUALIZER_STATE_CHANGE","resourceMetadata":"{\"command\":\"PUSH_EQUALIZER_STATE_CHANGE\",\"timeStamp\":1723307581469,\"payload\":\"{\\"dopplerId\\":{\\"deviceSerialNumber\\":\\"G0922M05243705WV\\",\\"deviceType\\":\\"A2DS1Q2TPDJ48U\\"},\\"bass\\":0,\\"midrange\\":0,\\"treble\\":0,\\"destinationUserId\\":\\"A1A18GQN4AHK1F\\"}\"}"}]}}} --------abcde123
2024-08-10 18:33:01.533 DEBUG (MainThread) [custom_components.alexa_media] j**9@h*****m: Received http2push command: PUSH_EQUALIZER_STATE_CHANGE : {'dopplerId': {'deviceSerialNumber': 'G****5WV', 'deviceType': 'A2DS1Q2TPDJ48U'}, 'bass': 0, 'midrange': 0, 'treble': 0, 'destinationUserId': 'A**K1F'} 2024-08-10 18:33:01.533 DEBUG (MainThread) [custom_components.alexa_media] Updating media_player availability {'dopplerId': {'deviceSerialNumber': 'G****5WV', 'deviceType': 'A2DS1Q2TPDJ48U'}, 'bass': 0, 'midrange': 0, 'treble': 0, 'destinationUserId': 'A**K1F'} 2024-08-10 18:33:01.537 DEBUG (MainThread) [alexapy.alexahttp2] Received raw message: Content-Type: application/json
{"directive":{"header":{"namespace":"Alexa.Mobile.Push","name":"RenderUpdate","messageId":"c8da2e0b-79b9-4557-ab6a-3d848d90034b"},"payload":{"renderingUpdates":[{"route":"EventBus:tcomm::message","resourceId":"PUSH_VOLUME_CHANGE","resourceMetadata":"{\"command\":\"PUSH_VOLUME_CHANGE\",\"timeStamp\":1723307581473,\"payload\":\"{\\"dopplerId\\":{\\"deviceSerialNumber\\":\\"G0922M05***\\",\\"deviceType\\":\\"A2DS1Q2TPDJ48U\\"},\\"volumeSetting\\":37,\\"isMuted\\":false,\\"destinationUserId\\":\\"A1A18GQN4AHK1F\\"}\"}"}]}}} --------abcde123
2024-08-10 18:33:01.540 DEBUG (MainThread) [custom_components.alexa_media] j**9@h*m: Received http2push command: PUSH_VOLUME_CHANGE : {'dopplerId': {'deviceSerialNumber': 'G****5WV', 'deviceType': 'A2DS1Q2TPDJ48U'}, 'volumeSetting': 37, 'isMuted': False, 'destinationUserId': 'A**K1F'} 2024-08-10 18:33:01.540 DEBUG (MainThread) [custom_components.alexa_media] Updating media_player volume: {'dopplerId': {'deviceSerialNumber': 'G****5WV', 'deviceType': 'A2DS1Q2TPDJ48U'}, 'volumeSetting': 37, 'isMuted': False, 'destinationUserId': 'A**K1F'} 2024-08-10 18:33:01.540 DEBUG (MainThread) [custom_components.alexa_media.media_player] j**9@h*m: Echo Dot de Sonia volume updated: 37
2024-08-10 18:35:11.889 DEBUG (MainThread) [custom_components.alexa_media.notify] Target type: <class 'list'>
2024-08-10 18:35:11.889 DEBUG (MainThread) [custom_components.alexa_media.notify] Processing: media_player.echo_dot_estudio
2024-08-10 18:35:11.889 DEBUG (MainThread) [custom_components.alexa_media.notify] Processed Target by string: ['media_player.echo_dot_estudio']
2024-08-10 18:35:11.890 DEBUG (MainThread) [custom_components.alexa_media.notify] TTS by
With version 2024.8.1, notifications still fail? Many thanks to the developers who do what they can and I know it is difficult and we all want it to work but developers also have their private lives and do what they can, I repeat again many thanks to the developers
Con la versión 2024.8.1 siguen fallando las notificaciones? Muchas gracias a los desarrolladores que hacen lo que pueden y se que es difícil y todos queremos que funcione pero los desarrolladores también tienen su vida privada y hacen lo que pueden, repito nuevamente muchas gracias a los desarrolladores
I'm with you. They are people who help everyone altruistically and invest their precious time in helping others. On the other hand, voice notifications keep failing and if you reload the integration too often it asks you to reauthenticate. But... WITHOUT REAUTHENTIFYING IT STILL WORKS AND YOU HAVE VOICE NOTIFICATIONS
With version 2024.8.1, notifications still fail? Many thanks to the developers who do what they can and I know it is difficult and we all want it to work but developers also have their private lives and do what they can, I repeat again many thanks to the developers
Having the same issue with voice notifications in HA core 2024.8.1, and AMP 4.12.7
Same here on 2024.8.1 and 4.12.7 .. it worked on 2024.7.x but broke when upgrading to 2024.8.1 (I skipped 2024.8.0)
I was trying to gather some more data on my HA instance with AMP debugs enabled. What I noticed is that both GET and POST requests are failing, the former returning a non-fatal HTTP 400 (Bad Request), the latter raising exception because of a login error during the request:
GET - Non-fatal error while refreshing:
2024-08-11 12:13:21.000 DEBUG (MainThread) [custom_components.alexa_media.media_player] l*************2@g*******m: Echo Dot Cameretta: Last_called check: self: G************7XN reported: G************7XU
2024-08-11 12:13:21.001 DEBUG (MainThread) [alexapy.alexaapi] l*************2@g*******m: Trying get: https://alexa.amazon.it/api/np/player?deviceSerialNumber=<redacted>&deviceType=A2U21SRK4QGSE1&screenWidth=2560&_=1723371201000 : with uri: /api/np/player data None query {'deviceSerialNumber': '<redacted>', 'deviceType': 'A2U21SRK4QGSE1', 'screenWidth': 2560, '_': 1723371201000}
2024-08-11 12:13:21.189 DEBUG (MainThread) [alexapy.alexaapi] l*************2@g*******m: GET: https://alexa.amazon.it/api/np/player?deviceSerialNumber=<redacted>&deviceType=A2U21SRK4QGSE1&screenWidth=2560&_=1723371201000 returned 400:Bad Request:application/json
2024-08-11 12:13:21.190 DEBUG (MainThread) [alexapy.alexaapi] Returning None due to status: 400
2024-08-11 12:13:21.191 DEBUG (MainThread) [custom_components.alexa_media.media_player] l*************2@g*******m: Disabling polling and scheduling last update in 300 seconds for Echo Dot Cameretta
POST - This is the fatal error, happening when issuing a TTS:
2024-08-11 12:36:06.790 DEBUG (MainThread) [custom_components.alexa_media.notify] Message: Test, kwargs: {'target': ['<redacted>'], 'data': None}
2024-08-11 12:36:06.791 DEBUG (MainThread) [custom_components.alexa_media.notify] Target type: <class 'list'>
2024-08-11 12:36:06.791 DEBUG (MainThread) [custom_components.alexa_media.notify] Processing: <redacted>
2024-08-11 12:36:06.791 DEBUG (MainThread) [custom_components.alexa_media.notify] Processed Target by string: ['<redacted>']
2024-08-11 12:36:06.792 DEBUG (MainThread) [custom_components.alexa_media.notify] TTS by <entity media_player.echo_dot_cameretta=standby> : Test
2024-08-11 12:36:06.903 DEBUG (MainThread) [custom_components.alexa_media.notify] Message: Test, kwargs: {'target': ['<redacted>'], 'data': None}
2024-08-11 12:36:06.904 DEBUG (MainThread) [custom_components.alexa_media.notify] Target type: <class 'list'>
2024-08-11 12:36:06.904 DEBUG (MainThread) [custom_components.alexa_media.notify] Processing: <redacted>
2024-08-11 12:36:06.904 DEBUG (MainThread) [custom_components.alexa_media.notify] Processed Target by string: ['<redacted>']
2024-08-11 12:36:06.905 DEBUG (MainThread) [custom_components.alexa_media.notify] TTS by <entity media_player.echo_dot_cameretta=standby> : Test
2024-08-11 12:36:08.295 DEBUG (MainThread) [alexapy.alexaapi] l*************2@g*******m: Queue changed while waiting 1.5 seconds
2024-08-11 12:36:08.407 DEBUG (MainThread) [alexapy.alexaapi] l*************2@g*******m: Creating sequence for 2 items
2024-08-11 12:36:08.408 DEBUG (MainThread) [alexapy.alexaapi] l*************2@g*******m: Running behavior with data: {"behaviorId": "PREVIEW", "sequenceJson": "{\"@type\": \"com.amazon.alexa.behaviors.model.Sequence\", \"startNode\": {\"@type\": \"com.amazon.alexa.behaviors.model.SerialNode\", \"nodesToExecute\": [{\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"Alexa.Speak\", \"operationPayload\": {\"deviceType\": \"A2U21SRK4QGSE1\", \"deviceSerialNumber\": \"<redacted>\", \"locale\": \"it-it\", \"customerId\": \"<redacted>\", \"textToSpeak\": \"Test\", \"target\": {\"customerId\": \"<redacted>\", \"devices\": [{\"deviceSerialNumber\": \"<redacted>\", \"deviceTypeId\": \"A2U21SRK4QGSE1\"}]}, \"skillId\": \"amzn1.ask.1p.saysomething\"}}, {\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"Alexa.Speak\", \"operationPayload\": {\"deviceType\": \"A2U21SRK4QGSE1\", \"deviceSerialNumber\": \"<redacted>\", \"locale\": \"it-it\", \"customerId\": \"<redacted>\", \"textToSpeak\": \"Test\", \"target\": {\"customerId\": \"<redacted>\", \"devices\": [{\"deviceSerialNumber\": \"<redacted>\", \"deviceTypeId\": \"A2U21SRK4QGSE1\"}]}, \"skillId\": \"amzn1.ask.1p.saysomething\"}}]}}", "status": "ENABLED"}
2024-08-11 12:36:08.409 DEBUG (MainThread) [alexapy.alexaapi] l*************2@g*******m: Trying post: https://alexa.amazon.it/api/behaviors/preview : with uri: /api/behaviors/preview data {'behaviorId': 'PREVIEW', 'sequenceJson': '{"@type": "com.amazon.alexa.behaviors.model.Sequence", "startNode": {"@type": "com.amazon.alexa.behaviors.model.SerialNode", "nodesToExecute": [{"@type": "com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode", "type": "Alexa.Speak", "operationPayload": {"deviceType": "A2U21SRK4QGSE1", "deviceSerialNumber": "<redacted>", "locale": "it-it", "customerId": "<redacted>", "textToSpeak": "Test", "target": {"customerId": "<redacted>", "devices": [{"deviceSerialNumber": "<redacted>", "deviceTypeId": "A2U21SRK4QGSE1"}]}, "skillId": "amzn1.ask.1p.saysomething"}}, {"@type": "com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode", "type": "Alexa.Speak", "operationPayload": {"deviceType": "A2U21SRK4QGSE1", "deviceSerialNumber": "<redacted>", "locale": "it-it", "customerId": "<redacted>", "textToSpeak": "Test", "target": {"customerId": "<redacted>", "devices": [{"deviceSerialNumber": "<redacted>", "deviceTypeId": "A2U21SRK4QGSE1"}]}, "skillId": "amzn1.ask.1p.saysomething"}}]}}', 'status': 'ENABLED'} query None
2024-08-11 12:36:08.409 DEBUG (MainThread) [alexapy.alexaapi] l*************2@g*******m:Login error detected; ignoring post request to /api/behaviors/preview with {'behaviorId': 'PREVIEW', 'sequenceJson': '{"@type": "com.amazon.alexa.behaviors.model.Sequence", "startNode": {"@type": "com.amazon.alexa.behaviors.model.SerialNode", "nodesToExecute": [{"@type": "com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode", "type": "Alexa.Speak", "operationPayload": {"deviceType": "A2U21SRK4QGSE1", "deviceSerialNumber": "<redacted>", "locale": "it-it", "customerId": "<redacted>", "textToSpeak": "Test", "target": {"customerId": "<redacted>", "devices": [{"deviceSerialNumber": "<redacted>", "deviceTypeId": "A2U21SRK4QGSE1"}]}, "skillId": "amzn1.ask.1p.saysomething"}}, {"@type": "com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode", "type": "Alexa.Speak", "operationPayload": {"deviceType": "A2U21SRK4QGSE1", "deviceSerialNumber": "<redacted>", "locale": "it-it", "customerId": "<redacted>", "textToSpeak": "Test", "target": {"customerId": "<redacted>", "devices": [{"deviceSerialNumber": "<redacted>", "deviceTypeId": "A2U21SRK4QGSE1"}]}, "skillId": "amzn1.ask.1p.saysomething"}}]}}', 'status': 'ENABLED'} None
2024-08-11 12:36:08.410 WARNING (MainThread) [alexapy.helpers] alexaapi.run_behavior((<alexapy.alexaapi.AlexaAPI object at 0x7f57f224e0>, {'@type': 'com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode', 'type': 'Alexa.Speak', 'operationPayload': {'deviceType': 'A2U21SRK4QGSE1', 'deviceSerialNumber': 'G************7XN', 'locale': 'it-it', 'customerId': 'A**********UL8', 'textToSpeak': 'Test', 'target': {'customerId': 'A**********UL8', 'devices': [{'deviceSerialNumber': 'G************7XN', 'deviceTypeId': 'A2U21SRK4QGSE1'}]}, 'skillId': 'amzn1.ask.1p.saysomething'}}), {'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments:
('Login error detected; not contacting API',)
2024-08-11 12:36:08.411 WARNING (MainThread) [alexapy.helpers] alexaapi.send_sequence((<alexapy.alexaapi.AlexaAPI object at 0x7f57f224e0>, 'Alexa.Speak'), {'customer_id': '<redacted>', 'textToSpeak': 'Test', 'target': {'customerId': 'A**********UL8', 'devices': [{'deviceSerialNumber': 'G************7XN', 'deviceTypeId': 'A2U21SRK4QGSE1'}]}, 'skillId': 'amzn1.ask.1p.saysomething', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments:
('Login error detected; not contacting API',)
2024-08-11 12:36:08.411 WARNING (MainThread) [alexapy.helpers] alexaapi.send_tts((<alexapy.alexaapi.AlexaAPI object at 0x7f57f224e0>, 'Test'), {'customer_id': '<redacted>', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments:
('Login error detected; not contacting API',)
2024-08-11 12:36:08.412 ERROR (MainThread) [homeassistant] 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 889, in send_tts
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
Could those failures be due to wrong cookies set in the request? I see one of the recent alexapy commits in July this year touched those cookies for example.
FWIW, this is the diff between the last alexapy version that worked for me (1.27.10) and the latest not-working one (1.28.2): https://gitlab.com/keatontaylor/alexapy/-/compare/v1.27.10...v1.28.2?from_project_id=7993293&straight=true
Maybe the issue might lie in one of those lines changed?
Another thing I noticed is that in the requests, "com.amazon.alexa.behaviors" is used even if my domain is not .com, but .it. Could that perhaps explain why this works for people with .com domain and not for other local domains? Maybe it's not a problem as that's just a value carried in the request attributes, but just wondering in case anyone knows more about this.
Once deleted .pickle file it has been recreated after HA restart
@LeoCal
Thank you. I also think the problem is around there. The AlexapyLoginError being raised is caused by the key [""login_successful"] being set to False inside AlexaLogin class. When you attempt to send a TTS, when making the POST request, this key is checked, and if its False, it raises AlexapyLoginError.
It starts as False, then becomes True once finalize_login() is called (log message is "Login confirmed for %s - %s; saving cookie to %s").
It can be set to False on following conditions:
Can you search for those logs in your instance? Remember to not search for %s occurences, as these are replaced by data related to your instance.
Also, I think it might be worth changing your Amazon account password, even if no logs mentioning this are present.
Hello,
In case it helps you, I have tried removing the integration, changing my Amazon.es password disabling 2FA and enabling it as the manual says to put the integration back on. It installed correctly but after 10 minutes the problem persists, not allowing to send TTS.
Thank you.
Hello again,
After the above, I deleted config\.storage\alexa_media.xxxxx@xxxx.xxx.pickle
and completely restarted Home Assistant and it has been working correctly for a couple of hours. Maybe it's a coincidence, but if any more of you can try it we can see if it may have something to do with it.
Best regards and thanks
Deleting the pickle file and restarting didn't work for me at first, and I'm not sure if it's related, but after a minute or two I got a message telling me I need to reauthenticate with Amazon, which I did, and now TTS works. Let's see if it'll stay working.
Bad news, after a few hours we are back to the initial situation, it gives again the errors you have mentioned.
@LeoCal
Thank you. I also think the problem is around there. The AlexapyLoginError being raised is caused by the key [""login_successful"] being set to False inside AlexaLogin class. When you attempt to send a TTS, when making the POST request, this key is checked, and if its False, it raises AlexapyLoginError.
It starts as False, then becomes True once finalize_login() is called (log message is "Login confirmed for %s - %s; saving cookie to %s").
It can be set to False on following conditions:
- Got a 401 response somewhere. This will create a log of the form ("Got 401! Request headers: %s");
- JSONDecodeError, CookieError and ContentTypeError exceptions. These will create logs of the form:
- "%s.%s(%s, %s): A login error occurred: %s"
- "%s.%s(%s, %s): A login error occurred; Amazon may want you to change your password: %s"
Can you search for those logs in your instance? Remember to not search for %s occurences, as these are replaced by data related to your instance.
@chrisvblemos None of those two logs show up in the debugs I collected on my system...
I have noticed an html file alexa_mediayouremail@yourdomain.comget.html
in the HA configuration folder that causes you to resolve a chapta. That file contains a script that gives you the chapta to resolve.
It is very likely that it has nothing to do with it but I deleted the file in case it is the problem of not logging in correctly and I have been working with notifications for more than 3 hours and it has not asked me to reauthenticate the integration.
I am not a programmer and I do not know if it has something to do with it. Thanks for all the effort.
I have noticed an html file
alexa_mediayouremail@yourdomain.comget.html
in the HA configuration folder that causes you to resolve a chapta. That file contains a script that gives you the chapta to resolve. It is very likely that it has nothing to do with it but I deleted the file in case it is the problem of not logging in correctly and I have been working with notifications for more than 3 hours and it has not asked me to reauthenticate the integration. I am not a programmer and I do not know if it has something to do with it. Thanks for all the effort.
Hi, can you post the exact file path please? I have tried to locate it but I don't see it.
Thanks
He notado un archivo html
alexa_mediayouremail@yourdomain.comget.html
en la carpeta de configuración de HA que hace que resuelvas una chapta. Ese archivo contiene un script que te da la chapta a resolver. Es muy probable que no tenga nada que ver pero he borrado el archivo por si es el problema de no loguearme correctamente y llevo más de 3 horas trabajando con notificaciones y no me ha pedido que vuelva a autenticar la integración. No soy programador y no sé si tenga algo que ver. Gracias por todo el esfuerzo.Hola, ¿puedes publicar la ruta exacta del archivo, por favor? He intentado localizarlo, pero no lo veo.
Gracias
homeassistant/config
Bad news, after a few hours we are back to the initial situation, it gives again the errors you have mentioned.
Can you check if "Login confirmed for %s - %s; saving cookie to %s" was present? Most likely, at the beggining of AMP logging.
It's been more than 7 hours and the voice notifications are still working, it hasn't asked for reauthentication and there are no logs with login errors. I only deleted the file indicated above. My steps were the following: Disable 2FA on the Amazon account, Change the password to one with only 2 special characters (*#) Log in to the integration and wait for the login error. Log in to the Amazon account and enable 2FA again. Reauthenticate the integration, delete the file described above and restart HA. No error detected. Auto-reload is not enabled. I don't know if I'll help anyone but that's my experience. I hope it holds up like this. If there are any changes I'll let you know.
Can you check if "Login confirmed for %s - %s; saving cookie to %s" was present? Most likely, at the beggining of AMP logging.
Hello,
Indeed when I delete the pickie file and restart it appears in the log:
2024-08-12 11:42:27.213 DEBUG (MainThread) [alexapy.alexalogin] Login confirmed for j****@****.com - amazon.es; saving cookie to /config/.storage/alexa_media.j*****a@x********m.pickle 2024-08-12 11:42:27.216 DEBUG (MainThread) [custom_components.alexa_media] Testing login status: {'login_successful': True} 2024-08-12 11:42:27.217 DEBUG (MainThread) [custom_components.alexa_media] Setting up Alexa devices for j**********a@x*******m 2024-08-12 11:42:27.247 DEBUG (MainThread) [custom_components.alexa_media] j**********a@x*******m: HTTP2 created: <alexapy.alexahttp2.HTTP2EchoClient object at 0x7f6e8fdcd0> 2024-08-12 11:42:27.247 DEBUG (MainThread) [custom_components.alexa_media] j**********a@x*******m: HTTP2push successfully connected 2024-08-12 11:42:27.247 DEBUG (MainThread) [custom_components.alexa_media] j**********a@x*******m: Creating coordinator 2024-08-12 11:42:27.248 DEBUG (MainThread) [custom_components.alexa_media] j**********a@x*******m: Refreshing coordinator 2024-08-12 11:42:27.248 DEBUG (MainThread) [alexapy.alexahttp2] Starting message parsing loop. 2024-08-12 11:42:27.248 DEBUG (MainThread) [alexapy.alexahttp2] Connecting to https://alexa.eu.gateway.devices.a2z.com/v20160207/directives with {'method': 'GET', 'path': '/v20160207/directives', 'authority': 'alexa.eu.gateway.devices.a2z.com', 'scheme': 'https', 'authorization': 'Bearer Atna|
Now I have disabled the options to enable newly added entities and to enable polling for updates and so far it has not stopped (since 12:00).
Best regards and thanks
Disabling polling is not a solution imho
Han pasado más de 7 horas y las notificaciones de voz siguen funcionando, no ha pedido reautenticación y no hay logs con errores de login. Solo borré el archivo indicado arriba. Mis pasos fueron los siguientes: Deshabilitar 2FA en la cuenta de Amazon, Cambiar la contraseña a una con solo 2 caracteres especiales (*#) Iniciar sesión en la integración y esperar el error de login. Iniciar sesión en la cuenta de Amazon y habilitar 2FA nuevamente. Reautenticar la integración, eliminar el archivo descrito arriba y reiniciar HA. No se detecta ningún error. La recarga automática no está habilitada. No sé si ayudaré a alguien pero esa es mi experiencia. Espero que se mantenga así. Si hay algún cambio se los haré saber.
Is everything still working okay for you?
Han pasado más de 7 horas y las notificaciones de voz siguen funcionando, no ha solicitado reautenticación y no hay registros con errores de inicio de sesión. Solo borre el archivo indicado arriba. Mis pasos fueron los siguientes: Deshabilitar 2FA en la cuenta de Amazon, Cambiar la contraseña a una con solo 2 caracteres especiales (*#) Iniciar sesión en la integración y esperar el error de inicio de sesión. Inicia sesión en la cuenta de Amazon y habilita 2FA nuevamente. Vuelva a autenticar la integración, elimine el archivo descrito arriba y reinicie HA. No se detecta ningún error. La recarga automática no está habilitada. No sé si ayudaré a alguien pero esa es mi experiencia. Espero que se mantenga así. Si hay algún cambio se los haré saber.
¿Todo sigue funcionando bien para ti?
Yes. All services ok
Han pasado más de 7 horas y las notificaciones de voz siguen funcionando, no se ha solicitado reautenticación y no hay registros con errores de inicio de sesión. Solo borre el archivo indicado arriba. Mis pasos fueron los siguientes: Deshabilitar 2FA en la cuenta de Amazon, Cambiar la contraseña a una con solo 2 caracteres especiales (*#) Iniciar sesión en la integración y esperar el error de inicio de sesión. Inicia sesión en la cuenta de Amazon y habilita 2FA nuevamente. Vuelva a autenticar la integración, elimine el archivo descrito arriba y reinicie HA. No se detecta ningún error. La recarga automática no está habilitada. No sé si ayudaré a alguien pero esa es mi experiencia. Espero que se mantenga así. Si hay algún cambio se los haré saber.
¿Todo sigue funcionando bien para ti?
Sí. Todos los servicios están bien.
I wanted to thank you and express my gratitude for your selfless work to make this integration work. Since yesterday at 9pm until today, Alexa has been notifying me when it is her turn. Thank you very much.
so what is the solution?
I'm going on just over 12 hours of voice announcements being back! Thank you! What I did was:
Now I have disabled the options to enable newly added entities and to enable polling for updates and so far it has not stopped (since 12:00).
Now that it's working, could you test enabling just polling for updates as that is how I now have mine set and it's working fine for me.
Now that it's working, could you test enabling just polling for updates as that is how I now have mine set and it's working fine for me.
Just re-enabled polling for updates here .. crosses fingers
If http2push is connected and seconds between scans
is 60, it should only poll once every 10 minutes (seconds between scans
x10) which should not trigger a too many requests
error. I think it might just be the added work of scanning for new devices that triggers it...
Ora ho disabilitato le opzioni per abilitare le entità appena aggiunte e per abilitare il polling per gli aggiornamenti e finora non si è fermato (dalle 12:00).
Ora che funziona, potresti provare ad abilitare solo il polling per gli aggiornamenti, dato che è così che ho impostato il mio sistema e funziona bene per me.
Hi, I also tried to enable only polling for updates, but after 10 minutes it asked me to re-authenticate. I restarted AMP without the polling updates and it seems to work without errors. So it didn't work for me.
Voice notifications only work when you reload the integration, but after a while they stop working.
System details
const.py
or HA startup): 4-12-7pip show alexapy
or HA startup):Logs no