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

Every time I tried to install the alexa media plugin I got : Too Many Requests #2639

Closed
Traders-Banquet opened this issue Oct 21, 2024 · 37 comments

Comments

@Traders-Banquet
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

<everytime I install the alexa media player plugin I got no devicec and constantly one error : too many request:

I install the amp with my amazon login and password the domain is amazon.de for germany, I entered the local address for my homassistant instanz. When I continue on the next page I enterd my amazon credentials and the otp I got by sms, but I tried the authenticator app too. And if I finished the process the amp is installed but no devices appear and I got in my protokol the error above.
I tried this with the last 7 releases of the plugin. Everytime I delete the amp, restart ha, download it on hacs and redo the procedure. By now everytime with the same result. Instead of the local homeassistant address I enterd the public address too, but with the same result.
Is there anything that I don't know by now ?

Logger: alexapy.helpers
Quelle: runner.py:189
Erstmals aufgetreten: 17:42:35 (6 Vorkommnisse)
Zuletzt protokolliert: 17:47:42

alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7feee6c92000>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyTooManyRequestsError occurred. Arguments: ('Too Many Requests',)
alexaapi.get_network_details((<alexapy.alexalogin.AlexaLogin object at 0x7feee6c92000>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyTooManyRequestsError occurred. Arguments: ('Too Many Requests',)

and :

Logger: alexapy.alexaapi
Quelle: runner.py:189
Erstmals aufgetreten: 17:42:35 (3 Vorkommnisse)
Zuletzt protokolliert: 17:47:42

Giving up _static_request(...) after 5 tries (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)

System details

  • Home Assistant version:
  • Core 2024.10.3
    Supervisor 2024.10.2
    Operating System 13.2
    Frontend 20241002.3
  • alexa_media version (from const.py or HA startup log): 4.13.5
  • alexapy version (from pip show alexapy in homeasssistant container or HA startup log):
  • Is Amazon 2FA/2SV enabled <!---We will not debug login issues if unanswered---> (y/n): Y
  • Amazon Domain: amazon.de
@danielbrunt57
Copy link
Collaborator

I give up! ¯_(ツ)_/¯

@Traders-Banquet
Copy link
Author

I think to give up is not a solution. I heard about others that installed HA new on a test system and installed the Alexa Media Player there a few days before without any problems. This indicates that the installation should work. I remarked on another implementation that if you delete the entities and then the implementation and the rest in the hacs store, that not all is really deleted. Some information still be left on haos and if you try to install it later again, some information are already there. I think this could be my problem with the alexa media player.

@danielbrunt57
Copy link
Collaborator

A lot of of users are having a myriad of issues, none of which I've had/not been able to overcome with a re & re therefore, I give up trying to figure out other's issues. I need to get on with my life, make money, & pay the bill collectors who are calling several times a day, every day.

@Traders-Banquet
Copy link
Author

I installed a fresh copy of haos in a virtual machine. I stopped AdGuard and I stopped CrowdSec. Then I added the HACS, added the Alexa Media Player, restarted HA and added this integration. Same result. Too Many Request, as it was written it means that too many requests are done from my account what else does it stand for ? All possible filters I've stopped before.

@cb12tre
Copy link

cb12tre commented Oct 24, 2024

I think to give up is not a solution. I heard about others that installed HA new on a test system and installed the Alexa Media Player there a few days before without any problems. This indicates that the installation should work. I remarked on another implementation that if you delete the entities and then the implementation and the rest in the hacs store, that not all is really deleted. Some information still be left on haos and if you try to install it later again, some information are already there. I think this could be my problem with the alexa media player.

If it can help analyze the issue, I am using Alexa Media Player 4.13.5 on version 2024.7.4 without any problems. If I try to update to any subsequent version, 2024.8, 2024.9, or 2024.10, connection issues start (I connect to the amazon.it domain).

image

I also tried creating a new Home Assistant virtual machine, restoring the backup from the old one, completely removing Alexa Media Player from HACS, and reconfiguring it, but it still throws errors even with the latest version 2024.10.3.

The only solution I have found, if it can be called that, is to continue using Home Assistant 2024.7.4.

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Oct 24, 2024

I installed a fresh copy of haos in a virtual machine. I stopped AdGuard and I stopped CrowdSec. Then I added the HACS, added the Alexa Media Player, restarted HA and added this integration. Same result. Too Many Request, as it was written it means that too many requests are done from my account what else does it stand for ? All possible filters I've stopped before.

You can try my modified version of /usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py where I've modified the @backoff.on_exception error handler for the "get" request calls. It resolved most of the few instances I had for "Too Many Requests"
alexaapi.zip
It adds an initial 2s delay, increasing each delay x2 (so 2s, 4s, 8s, 16s, etc.) for up to 10 tries/2minutes vs the previous more frequent attempts (initial is 0.3s) at 5 retries/1 minute.

The other change I had to make to completely eliminate the "429" errors was to remove the automatic update_last_called which occurs at startup and on each poll. That's in custom_components/alexa_media/__init__.py (line 523):

            await process_notifications(login_obj, raw_notifications)

            """Disable automatic updates of last_called as this is 
               repeatedly causing random "429:Too many requests" errors.
               Users will have to manually run alexa_media.update_last_called
               
            # Try delay to avoid "429:Too Many Requests"
            # 5s wasn't enough; 15s worked on first scan but not peridic polling
            # 30s also failed to succeed 100% of the time
            await asyncio.sleep(30) 
            # Process last_called data to fire events
            await update_last_called(login_obj)             <<<< This is the call
            """
            
        except (AlexapyLoginError, JSONDecodeError):
            _LOGGER.debug(
                "%s: Alexa API disconnected; attempting to relogin : status %s",
                hide_email(email),
                login_obj.status,
            )
            if login_obj.status:
                hass.bus.async_fire(
                    "alexa_media_relogin_required",
                    event_data={"email": hide_email(email), "url": login_obj.url},
                )
            return

You can still execute it manually and as long as it doesn't occur right after a polling sequence it's fine.
Should you happen to run it shortly after the polling occurs, it'll likely cause a "429" error.

Based on my usage & testing, I'm under the impression the Amazon request limit seems to be dynamic based on their server load at any given moment. So when your Amazon host endpoint is busier, they seem to reduce the number of API calls permitted. The endpoint is a pool of IP addresses, which should be load balanced DNS resolution but could just be round-robin, and each IP address could be a rack of servers or an entire farm of servers somewhere in their "cloud".

C:\Users\Daniel>nslookup default.eu.gateway.devices.a2z.com
Server:  pfSense.my.domain
Address:  192.168.1.254

Non-authoritative answer:
Name:    bobdi-exter-hrupuktx1jq3-0e041c1653b9f8cf.elb.eu-west-1.amazonaws.com
Addresses:  64:ff9b::34d6:e359
          64:ff9b::3410:685d
          64:ff9b::12cb:39e0
          18.203.57.224
          52.214.227.89
          52.16.104.93
Aliases:  default.eu.gateway.devices.a2z.com

@Traders-Banquet
Copy link
Author

first, thanks for not giving up.
I went into the dockercontainer homeassistant, downloaded the zip file, unpacked it and then changed the original one with yours, I rebooted the whole system and downloaded the alexa_media_player. But if I tried to add the integration I got this error :
Der Konfigurationsfluss konnte nicht geladen werden: {"message":"Invalid handler specified"}
I think your environment is much different than mine.
You mentioned the file : custom_components/alexa_media/alexalogin.py
this one I don't have. I downloaded several Versions of the alexa_media_player but this file is in none of them.

@danielbrunt57
Copy link
Collaborator

You mentioned the file : custom_components/alexa_media/alexalogin.py
this one I don't have. I downloaded several Versions of the alexa_media_player but this file is in none of them.

My apologies! The correct file name is custom_components/alexa_media/__init__.py...

@danielbrunt57
Copy link
Collaborator

As for the Der Konfigurationsfluss konnte nicht geladen werden: {"message":"Invalid handler specified"}, try removing the two instances of AlexaConnectionError

from .errors import (
    AlexapyCancelledError,
    AlexapyConnectionError,  # Line 24
    AlexapyLoginCloseRequested,
    AlexapyLoginError,
    AlexapyTooManyRequestsError,
)

and here:

    @backoff.on_exception(
        _min_expo_wait(2.0),
        # backoff.expo,
        (AlexapyTooManyRequestsError, AlexapyCancelledError, AlexapyConnectionError, ClientConnectionError),  # Line 275
        max_time=120,
        max_tries=10,
        jitter=None,
        # factor=2,
        logger=__name__,
    )

@Traders-Banquet
Copy link
Author

Traders-Banquet commented Oct 25, 2024

I removed the AlexaConnectionError and the AlexapyCancelledError, cause this one was not known by the error.py.
Now I got a new one :
first this warning :

Logger: alexapy.helpers
Quelle: runner.py:189
Erstmals aufgetreten: 09:09:18 (2 Vorkommnisse)
Zuletzt protokolliert: 09:23:18

alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f93214e1f70>,), {}): Timeout error occurred accessing AlexaAPI: An exception of type CancelledError occurred. Arguments: ()
alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f9310d0efc0>,), {}): Timeout error occurred accessing AlexaAPI: An exception of type CancelledError occurred. Arguments: ()

and this error :

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.alexa_media
Quelle: helpers/update_coordinator.py:386
Integration: Alexa Media Player (Dokumentation, Probleme)
Erstmals aufgetreten: 09:09:18 (2 Vorkommnisse)
Zuletzt protokolliert: 09:23:18

Error fetching alexa_media data: Error communicating with API:

@danielbrunt57
Copy link
Collaborator

Not sure if your reply is a typo or not as you stated you removed AlexapyCancelledError. That should be in your current errors.py. Your revised code should be:

from .errors import (
    AlexapyCancelledError,
    AlexapyLoginCloseRequested,
    AlexapyLoginError,
    AlexapyTooManyRequestsError,
)

and

    @backoff.on_exception(
        _min_expo_wait(2.0),
        # backoff.expo,
        (AlexapyTooManyRequestsError, AlexapyCancelledError, ClientConnectionError), 
        max_time=120,
        max_tries=10,
        jitter=None,
        # factor=2,
        logger=__name__,
    )

Or, restore those and replace errors.py with:

"""Python Package for controlling Alexa devices (echo dot, etc) programmatically.

SPDX-License-Identifier: Apache-2.0

Package errors.

For more details about this api, please refer to the documentation at
https://gitlab.com/keatontaylor/alexapy
"""


class AlexapyError(Exception):
    """Define a base error."""


class AlexapyCancelledError(AlexapyError):
    """Define an error related to cancelled requests."""


class AlexapyConnectionError(AlexapyError):
    """Define an error related to invalid requests."""


class AlexapyLoginError(AlexapyError):
    """Define an error related to no longer being logged in."""


class AlexapyTooManyRequestsError(AlexapyError):
    """Define an error related to too many requests."""


class AlexapyLoginCloseRequested(AlexapyError):
    """Define an error related to requesting access to API after requested close."""


class AlexapyPyotpInvalidKey(AlexapyError):
    """Define an error related to invalid 2FA key."""

@danielbrunt57
Copy link
Collaborator

alexapy/AMP needs to be revised/updated to remove alexaapi.get_guard_details since Alexa Guard is officially dead now since earlier this year.

@Traders-Banquet
Copy link
Author

Well, I changed the alexaapi.py as described obove, the @backof part too and entered the missing error into the errors.py but the message remains the same like before. Then I removed the amp, stopped adguard and crowdsec. Then did the last core update. Redownloaded the amp and added this integration again. I remarked that the alexaapi was deletet ;.( and redownloaded amp, add the integration, reentered all the above changes ( lesson learned ) luckily I did a copy of the alexaapi.py and the errors.py before. Restarted homeassistant but the warning and the error are the result.

@Traders-Banquet
Copy link
Author

Traders-Banquet commented Oct 27, 2024

My last try now was to take the original alexaapi.py and inserted the _min_expo_wait function and changed the two @backof.on_exception to :

_min_expo_wait(2.0), instead backoff.expo,
and changed valus :
max_time=120,
max_tries=10,
but with the same result :

first the warning :


Logger: alexapy.helpers
Quelle: runner.py:189
Erstmals aufgetreten: 12:08:19 (1 Vorkommnisse)
Zuletzt protokolliert: 12:08:19

alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f1e3ecfd4f0>,), {}): Timeout error occurred accessing AlexaAPI: An exception of type CancelledError occurred. Arguments: ()

and the error :

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.alexa_media
Quelle: helpers/update_coordinator.py:386
Integration: Alexa Media Player (Dokumentation, Probleme)
Erstmals aufgetreten: 12:08:19 (1 Vorkommnisse)
Zuletzt protokolliert: 12:08:19

Error fetching alexa_media data: Error communicating with API:

adguard was inactive and crowdsec was stopped.

@Traders-Banquet
Copy link
Author

In case that it could help here is the downloaded log from homeassistant :

2024-10-27 12:07:46.092 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration homematicip_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 12:07:46.093 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration localtuya which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 12:07:46.093 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration better_thermostat which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 12:07:46.093 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 12:07:46.094 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 12:07:46.094 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration scheduler which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 12:07:46.094 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tuya_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 12:07:47.475 DEBUG (ImportExecutor_0) [alexapy.alexalogin] http.cookies patch: Morsel._reserved: {'partitioned': 'Partitioned'}; Morsel._flags: {'secure', 'httponly', 'partitioned'}
2024-10-27 12:07:47.670 DEBUG (MainThread) [custom_components.alexa_media] Nothing to import from configuration.yaml, loading from Integrations
2024-10-27 12:07:47.670 DEBUG (MainThread) [custom_components.alexa_media] 
-------------------------------------------------------------------
alexa_media
Version: 4.13.5
This is a custom component
If you have any issues with this you need to open an issue here:
https://github.com/alandtse/alexa_media_player/issues
-------------------------------------------------------------------

2024-10-27 12:07:47.670 DEBUG (MainThread) [custom_components.alexa_media] Loaded alexapy==1.29.3
2024-10-27 12:07:47.671 DEBUG (MainThread) [custom_components.alexa_media.helpers] j***********n@g****e: Returning uuid {'uuid': '7d8f4ed2ab54eb2daf331dd667774cce', 'index': 0}
2024-10-27 12:07:47.671 DEBUG (MainThread) [alexapy.alexalogin] Login created for some.name@gmx.de - amazon.de
2024-10-27 12:07:47.671 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/.storage/alexa_media.some.name@gmx.de.pickle
2024-10-27 12:07:47.671 DEBUG (MainThread) [alexapy.alexalogin] Trying to load cookie from file /config/.storage/alexa_media.some.name@gmx.de.pickle
2024-10-27 12:07:47.674 DEBUG (MainThread) [alexapy.alexalogin] Trying to load aiohttpCookieJar to session
2024-10-27 12:07:47.675 DEBUG (MainThread) [alexapy.alexalogin] Loaded 14 cookies
2024-10-27 12:07:47.675 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/alexa_media.some.name@gmx.de.pickle
2024-10-27 12:07:47.676 DEBUG (MainThread) [alexapy.alexalogin] Using cookies to log in
2024-10-27 12:07:47.676 DEBUG (MainThread) [alexapy.alexalogin] Attempting to register with amazon.de
2024-10-27 12:07:48.321 DEBUG (MainThread) [alexapy.alexalogin] auth response <ClientResponse(https://api.amazon.de/auth/register) [200 OK]>
<CIMultiDictProxy('Server': 'Server', 'Date': 'Sun, 27 Oct 2024 11:07:48 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '5721', 'Connection': 'keep-alive', 'x-amz-rid': '4CG0EYPAKEPR0RAJ6BYG', 'x-amzn-RequestId': 'c6f914bd-c1a0-4b8c-bf45-a6c0799e45eb', 'X-Amz-Date': 'Sun, 27 Oct 2024 11:07:48 GMT', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload')>
 with 
{"requested_extensions": ["device_info", "customer_info"], "cookies": {"website_cookies": [], "domain": ".amazon.de"}, "registration_data": {"domain": "Device", "app_version": "2.2.556530.0", "device_type": "A2IVLV5VM2W81", "device_name": "%FIRST_NAME%'s%DUPE_STRATEGY_1ST%Alexa Media Player", "os_version": "16.6", "device_serial": "7d8f4ed2ab54eb2daf331dd667774cce", "device_model": "iPhone", "app_name": "Alexa Media Player", "software_version": "1"}, "auth_data": {"access_token": "Atna|EwICIEqK-4f8LTgQI3Os80dKIuMrmnJS0dTGZM2gjoafar2ktDolOb_3PjsHZtKDhStLQdY_QDsE1oSr4RLGz4ZunvjeeGkJCkHZy_z_TyzyEZeCo2h49Q2YAut2IUTzyS3ohRcglM9x8qrQ6L9TDJioam8DgQ6OarUrwdmsPd2O1nfgtg1s4Au1-3g3MYv9l9GiqoiWf8pZ9CT201AQbU5yjNSS68SPFMw-MNe6doEdSTNN9Zv2YsB61FIFxJs2Iv-3f02PMXcR3IiANRR203LzhSdP-3Wnmi0N1O8lEzH9cHsP40LMm4ptycrOwGCH0nLZMDn3s9zgOKUleRP3cL84jtPHEIBBK8VgFZoLjvkVvnmKbCqBZaXZ3Eo_w6uxTzE5vKU"}, "user_context_map": {"frc": "Cd4QEgx0n1/tCDQLI5LHXXefIOtTwJivzmY2C/cGBDeH6ZLXFGnBUxyKcggZ+TnEXuJ5o5CvAexY68vjpTQTTN2KlwtEITrMcmfqFQq0t15cauCqQhJ4oN6s0Uto3p02GcWT3Xi/OKGW04WmqHE1ahZM89CcWtA8KgBdm1knRONw63CvmvIQRh0jalDFkR13a6uVgab5dGl1IpOp1qzHI+3/0d5WNuCtK8hezjfRR0f/ZsoSdgcBlJbq+I3A+RwfDMVkEBPUH63Jo6L2Q7hzQi3bbRVvyI7A2I1RXerSj2Wsm/b9TZjxaJUsvWDLE3mkvKNLUJu3szx7cwh/OH05aC38aBj2FQCLgAjYBaqKLZEi3rx4bdg7FAhJ18ca03ZLxeknhH/mi4b8y1YiTBhGE2hwQI9f/4fK6Q"}, "requested_token_type": ["bearer", "mac_dms", "website_cookies"]}
2024-10-27 12:07:48.322 DEBUG (MainThread) [alexapy.alexalogin] Successfully registered Jörg's Alexa Media Player device with Amazon
2024-10-27 12:07:48.322 DEBUG (MainThread) [alexapy.alexalogin] New access token(353) received which expires at 2024-10-27 13:07:48.322172 in 0:59:59.999990
2024-10-27 12:07:48.788 DEBUG (MainThread) [alexapy.alexalogin] capabilities response <ClientResponse(https://api.amazonalexa.com/v1/devices/@self/capabilities) [204 No Content]>
<CIMultiDictProxy('Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Sun, 27 Oct 2024 11:07:48 GMT', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload', 'x-amz-rid': 'VZRV8CX8ZQQ9W659YQZX', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 c1c42e732809880dbf4b6deb496490ae.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P2', 'X-Amz-Cf-Id': 'WDo_kCS8ff32fj5ziQLEmt8T-e6SyBh9QNUSr01-92XB9fXzZrjukA==')>
 with 
{"legacyFlags": {"SUPPORTS_COMMS": true, "SUPPORTS_ARBITRATION": true, "SCREEN_WIDTH": 1170, "SUPPORTS_SCRUBBING": true, "SPEECH_SYNTH_SUPPORTS_TTS_URLS": false, "SUPPORTS_HOME_AUTOMATION": true, "SUPPORTS_DROPIN_OUTBOUND": true, "FRIENDLY_NAME_TEMPLATE": "VOX", "SUPPORTS_SIP_OUTBOUND_CALLING": true, "VOICE_PROFILE_SWITCHING_DISABLED": true, "SUPPORTS_LYRICS_IN_CARD": false, "SUPPORTS_DATAMART_NAMESPACE": "Vox", "SUPPORTS_VIDEO_CALLING": true, "SUPPORTS_PFM_CHANGED": true, "SUPPORTS_TARGET_PLATFORM": "TABLET", "SUPPORTS_SECURE_LOCKSCREEN": false, "AUDIO_PLAYER_SUPPORTS_TTS_URLS": false, "SUPPORTS_KEYS_IN_HEADER": false, "SUPPORTS_MIXING_BEHAVIOR_FOR_AUDIO_PLAYER": false, "AXON_SUPPORT": true, "SUPPORTS_TTS_SPEECHMARKS": true}, "envelopeVersion": "20160207", "capabilities": [{"version": "0.1", "interface": "CardRenderer", "type": "AlexaInterface"}, {"interface": "Navigation", "type": "AlexaInterface", "version": "1.1"}, {"type": "AlexaInterface", "version": "2.0", "interface": "Alexa.Comms.PhoneCallController"}, {"type": "AlexaInterface", "version": "1.1", "interface": "ExternalMediaPlayer"}, {"type": "AlexaInterface", "interface": "Alerts", "configurations": {"maximumAlerts": {"timers": 2, "overall": 99, "alarms": 2}}, "version": "1.3"}, {"version": "1.0", "interface": "Alexa.Display.Window", "type": "AlexaInterface", "configurations": {"templates": [{"type": "STANDARD", "id": "app_window_template", "configuration": {"sizes": [{"id": "fullscreen", "type": "DISCRETE", "value": {"value": {"height": 1440, "width": 3200}, "unit": "PIXEL"}}], "interactionModes": ["mobile_mode", "auto_mode"]}}]}}, {"type": "AlexaInterface", "interface": "AccessoryKit", "version": "0.1"}, {"type": "AlexaInterface", "interface": "Alexa.AudioSignal.ActiveNoiseControl", "version": "1.0", "configurations": {"ambientSoundProcessingModes": [{"name": "ACTIVE_NOISE_CONTROL"}, {"name": "PASSTHROUGH"}]}}, {"interface": "PlaybackController", "type": "AlexaInterface", "version": "1.0"}, {"version": "1.0", "interface": "Speaker", "type": "AlexaInterface"}, {"version": "1.0", "interface": "SpeechSynthesizer", "type": "AlexaInterface"}, {"version": "1.0", "interface": "AudioActivityTracker", "type": "AlexaInterface"}, {"type": "AlexaInterface", "interface": "Alexa.Camera.LiveViewController", "version": "1.0"}, {"type": "AlexaInterface", "version": "1.0", "interface": "Alexa.Input.Text"}, {"type": "AlexaInterface", "interface": "Alexa.PlaybackStateReporter", "version": "1.0"}, {"version": "1.1", "interface": "Geolocation", "type": "AlexaInterface"}, {"interface": "Alexa.Health.Fitness", "version": "1.0", "type": "AlexaInterface"}, {"interface": "Settings", "type": "AlexaInterface", "version": "1.0"}, {"configurations": {"interactionModes": [{"dialog": "SUPPORTED", "interactionDistance": {"value": 18, "unit": "INCHES"}, "video": "SUPPORTED", "keyboard": "SUPPORTED", "id": "mobile_mode", "uiMode": "MOBILE", "touch": "SUPPORTED"}, {"video": "UNSUPPORTED", "dialog": "SUPPORTED", "interactionDistance": {"value": 36, "unit": "INCHES"}, "uiMode": "AUTO", "touch": "SUPPORTED", "id": "auto_mode", "keyboard": "UNSUPPORTED"}]}, "type": "AlexaInterface", "interface": "Alexa.InteractionMode", "version": "1.0"}, {"type": "AlexaInterface", "configurations": {"catalogs": [{"type": "IOS_APP_STORE", "identifierTypes": ["URI_HTTP_SCHEME", "URI_CUSTOM_SCHEME"]}]}, "version": "0.2", "interface": "Alexa.Launcher"}, {"interface": "System", "version": "1.0", "type": "AlexaInterface"}, {"interface": "Alexa.IOComponents", "type": "AlexaInterface", "version": "1.4"}, {"type": "AlexaInterface", "interface": "Alexa.FavoritesController", "version": "1.0"}, {"version": "1.0", "type": "AlexaInterface", "interface": "Alexa.Mobile.Push"}, {"type": "AlexaInterface", "interface": "InteractionModel", "version": "1.1"}, {"interface": "Alexa.PlaylistController", "type": "AlexaInterface", "version": "1.0"}, {"interface": "SpeechRecognizer", "type": "AlexaInterface", "version": "2.1"}, {"interface": "AudioPlayer", "type": "AlexaInterface", "version": "1.3"}, {"type": "AlexaInterface", "version": "3.1", "interface": "Alexa.RTCSessionController"}, {"interface": "VisualActivityTracker", "version": "1.1", "type": "AlexaInterface"}, {"interface": "Alexa.PlaybackController", "version": "1.0", "type": "AlexaInterface"}, {"type": "AlexaInterface", "interface": "Alexa.SeekController", "version": "1.0"}, {"interface": "Alexa.Comms.MessagingController", "type": "AlexaInterface", "version": "1.0"}]}
{"User-Agent": "AmazonWebView/Amazon Alexa/2.2.556530.0/iOS/16.6/iPhone", "Accept-Language": "en-US", "Accept-Charset": "utf-8", "Connection": "keep-alive", "Content-type": "application/json; charset=UTF-8", "authorization": "Bearer Atna|EwICINm3JNjkjI-ufQnLK8-FV6AJgVIq--SIng36ynpwDnNCgo9VAsGv_hfqlqkCMfGaQlkn91G2_r7sRzjxQuH9X5E_F1OCStXGtxRL5OAm4l1XuTAmZnsOKbb9cB5k0Z9koeHxkDrYi64myErFZ1sXS-wKKZBF3dnguBVT87z_mMH0mnOlE4dE2XDW_hfmDYhtoVK8YpYy6w-T8M4ExFms-IUjcFQvtKvuvC5lJjCiEnD6w95SXmRG1B06aOwClTW5lvzzv56XKdfILdaAliyoZzyLx3m2oXv5FT210l6-F8OIjeStbYTfMyYYUkeFmMLwlxCbPZDRKiBOBOUIiZ9ImrC5"}
2024-10-27 12:07:49.041 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: session-id=262-3341547-5562024; Domain=.amazon.de; expires=22 Oct 2044 11:07:49 GMT; Path=/; Secure
2024-10-27 12:07:49.041 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: ubid-acbde=259-8483136-9945601; Domain=.amazon.de; expires=22 Oct 2044 11:07:49 GMT; Path=/; Secure
2024-10-27 12:07:49.041 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: x-acbde="0SatiIhifihre9lccmpe0ZW8m9P7v@Aw"; Domain=.amazon.de; expires=22 Oct 2044 11:07:49 GMT; Path=/; Secure
2024-10-27 12:07:49.042 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: at-acbde=Atza|IwEBIBWJBNrflZ0qvut6U85Th2FlBvoUJkfxOpPEBakiVO-AIOUiNO6HRAzSWB0JQEcGPegx80BsfuS1Spp3VDGAd3dYbZrNA1x5iVDEIALYZTH5f2lZNhFRONqx8lgI3NzsyMFdC12_JaQcoomeUdPv-M2e2U2ZLyoXI46-8d9VhtgsGKGnxqVocciwP2u5lw0OGnLViNe9Sys6gp2msd-1OxPr4AhcQGCHxOUz5F81tZEqTN1eazyuY1imEjcapGkmzfpzyszH6BQfiBIW1guLfI_rmYoCHNXfMTZC5lx42tRYXlnydwerhXgNqWoF70hsO9e9UWqm_YS6f8XtvaccIMQ5BiYc40thfAkB6jKnKpFYwk3AHOPEUKSt4Ukll15HZW_JG0I-06jq2BI_lsCHxUOU; Domain=.amazon.de; expires=28 Oct 2024 11:07:49 GMT; HttpOnly; Path=/; Secure
2024-10-27 12:07:49.042 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: sess-at-acbde="loXDRY3h2QfgnCPSKuKchnpi3S3gufNlr2dzi7TSeek="; Domain=.amazon.de; expires=28 Oct 2024 11:07:49 GMT; HttpOnly; Path=/; Secure
2024-10-27 12:07:49.042 INFO (MainThread) [alexapy.alexalogin] Exchanged refresh token for 5 .amazon.de cookies: ['session-id', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde']
2024-10-27 12:07:49.042 DEBUG (MainThread) [alexapy.alexalogin] CSRF already exists; no need to discover
2024-10-27 12:07:49.042 DEBUG (MainThread) [alexapy.alexalogin] Session cookies for 'https://alexa.amazon.com/api/bootstrap': ['JSESSIONID', 'session-id', 'session-id-time', 'lc-main', 'ubid-main', 'session-token', 'x-main', 'at-main', 'sess-at-main', 'csrf']
2024-10-27 12:07:49.502 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.com/api/bootstrap returned 200:OK with response <CIMultiDictProxy('Content-Type': 'application/json', 'Content-Length': '175', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Sun, 27 Oct 2024 11:07:49 GMT', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'x-amz-rid': 'Q06K9KCVXT07RV5B5XN5', 'x-amzn-RequestId': 'Q06K9KCVXT07RV5B5XN5', 'x-amzn-alt-domain': 'https://alexa.amazon.de/logout', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 2b483ab832506bc86647b6ceba38dc9e.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P1', 'X-Amz-Cf-Id': 'nlhw0F9KtH5ewEhYh7mqisSIZFYbHuhhh7zkCpsWPlWzBWj5MvDVHw==')>
2024-10-27 12:07:49.502 DEBUG (MainThread) [alexapy.alexalogin] Session cookies for 'https://alexa.amazon.de/api/bootstrap': ['JSESSIONID', 'session-id', 'session-id-time', 'lc-main', 'ubid-main', 'session-token', 'x-main', 'at-main', 'sess-at-main', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde', 'csrf']
2024-10-27 12:07:49.696 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.de/api/bootstrap returned 200:OK with response <CIMultiDictProxy('Content-Type': 'application/json', 'Content-Length': '175', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Sun, 27 Oct 2024 11:07:49 GMT', 'Strict-Transport-Security': 'max-age=0; includeSubDomains;', 'x-amz-rid': '7RQ7VY96RKFEWSBKTSNS', 'x-amzn-RequestId': '7RQ7VY96RKFEWSBKTSNS', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 3e1c75dd4bc1e056caa1604e0e55ea30.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P4', 'X-Amz-Cf-Id': 'PNGNszpggSkfOaaQ6u7-UVE5Esq33CPFnnkTIisPD6oiSlqCGJzcRw==')>
2024-10-27 12:07:49.696 DEBUG (MainThread) [alexapy.alexalogin] Logged in as some.name@gmx.de to amazon.de with id: A1MM33BQBRI847
2024-10-27 12:07:49.833 DEBUG (MainThread) [alexapy.alexalogin] Domain amazon.de matches reported account domain: amazon.de
2024-10-27 12:07:49.849 DEBUG (MainThread) [alexapy.alexalogin] Login confirmed for some.name@gmx.de - amazon.de; saving cookie to /config/.storage/alexa_media.some.name@gmx.de.pickle
2024-10-27 12:07:49.850 DEBUG (MainThread) [custom_components.alexa_media] Testing login status: {'login_successful': True}
2024-10-27 12:07:49.850 DEBUG (MainThread) [custom_components.alexa_media] Setting up Alexa devices for j***********n@g****e
2024-10-27 12:07:49.850 DEBUG (MainThread) [custom_components.alexa_media] include: 
2024-10-27 12:07:49.850 DEBUG (MainThread) [custom_components.alexa_media] exclude: 
2024-10-27 12:07:49.850 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: HTTP2 created: <alexapy.alexahttp2.HTTP2EchoClient object at 0x7f1e36cbb3b0>
2024-10-27 12:07:49.851 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: HTTP2push successfully connected
2024-10-27 12:07:49.851 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: Creating coordinator
2024-10-27 12:07:49.851 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: Refreshing coordinator
2024-10-27 12:07:49.851 DEBUG (MainThread) [alexapy.alexahttp2] Starting message parsing loop.
2024-10-27 12:07:49.851 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|EwICINm3JNjkjI-ufQnLK8-FV6AJgVIq--SIng36ynpwDnNCgo9VAsGv_hfqlqkCMfGaQlkn91G2_r7sRzjxQuH9X5E_F1OCStXGtxRL5OAm4l1XuTAmZnsOKbb9cB5k0Z9koeHxkDrYi64myErFZ1sXS-wKKZBF3dnguBVT87z_mMH0mnOlE4dE2XDW_hfmDYhtoVK8YpYy6w-T8M4ExFms-IUjcFQvtKvuvC5lJjCiEnD6w95SXmRG1B06aOwClTW5lvzzv56XKdfILdaAliyoZzyLx3m2oXv5FT210l6-F8OIjeStbYTfMyYYUkeFmMLwlxCbPZDRKiBOBOUIiZ9ImrC5'}
2024-10-27 12:07:49.851 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-27 12:07:49.921 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-27 12:07:49.921 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 0.7s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-27 12:07:49.972 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/bootstrap returned 200:OK:application/json
2024-10-27 12:07:49.999 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/dnd/device-status-list returned 200:OK:application/json
2024-10-27 12:07:50.015 DEBUG (MainThread) [alexapy.alexahttp2] Received raw message: --------abcde123

2024-10-27 12:07:50.046 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-27 12:07:50.065 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/devices-v2/device returned 200:OK:application/json
2024-10-27 12:07:50.339 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/bluetooth?cached=false returned 200:OK:application/json
2024-10-27 12:07:50.527 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/device-preferences returned 200:OK:application/json
2024-10-27 12:07:50.697 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-27 12:07:50.697 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 0.3s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-27 12:07:51.050 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-27 12:07:51.050 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 0.1s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-27 12:07:51.281 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-27 12:07:51.281 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 3.8s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-27 12:07:53.365 WARNING (SyncWorker_0) [custom_components.tuya_local.device] RGBCW lightbulb protocol error 905: Network Error: Device Unreachable
2024-10-27 12:07:55.160 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-27 12:07:55.160 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 6.4s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-27 12:08:01.657 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-27 12:08:01.657 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 57.5s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-27 12:08:19.852 WARNING (MainThread) [alexapy.helpers] alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f1e3ecfd4f0>,), {}): Timeout error occurred accessing AlexaAPI: An exception of type CancelledError occurred. Arguments:
()
2024-10-27 12:08:19.852 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: get_network_details response: None
2024-10-27 12:08:19.852 ERROR (MainThread) [custom_components.alexa_media] Error fetching alexa_media data: Error communicating with API: 
2024-10-27 12:08:19.852 DEBUG (MainThread) [custom_components.alexa_media] Finished fetching alexa_media data in 30.001 seconds (success: False)
2024-10-27 12:08:20.172 DEBUG (MainThread) [custom_components.alexa_media] Completing remaining startup tasks.
2024-10-27 12:08:45.188 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:08:48.554 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for ha-voice-assist @ 10.10.3.203: Timeout while connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='10.10.3.203', port=6053))] (TimeoutAPIError)
2024-10-27 12:09:05.204 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:09:25.218 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:09:45.233 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:10:05.247 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:10:25.264 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:10:45.281 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:11:05.298 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:11:25.316 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:11:45.334 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:12:05.351 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:12:25.368 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:12:45.381 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:12:49.048 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-27 12:12:49.076 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-27 12:13:05.400 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:13:25.418 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:13:45.437 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:14:05.452 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:14:25.470 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:14:45.484 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:15:05.503 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:15:25.522 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:15:45.532 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:16:05.550 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:16:25.569 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:16:45.587 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:17:05.606 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:17:25.623 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:17:45.642 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:17:48.078 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-27 12:17:48.106 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-27 12:18:05.660 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:18:25.676 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:18:45.694 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:19:05.707 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:19:25.722 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:19:45.742 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:20:05.756 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:20:25.775 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:20:45.791 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:21:05.810 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:21:25.829 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:21:45.848 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:22:05.866 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:22:25.885 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:22:45.903 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:22:47.107 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-27 12:22:47.134 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-27 12:23:05.922 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:23:25.941 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:23:45.959 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:24:05.978 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:24:25.993 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:24:46.016 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:25:06.032 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:25:26.050 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:25:46.070 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:26:06.088 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:26:26.103 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:26:46.121 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:27:06.136 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:27:26.149 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:27:46.135 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-27 12:27:46.163 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-27 12:27:46.167 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:28:06.186 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:28:26.203 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:28:46.221 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:29:06.236 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:29:26.252 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:29:46.266 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:30:06.283 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:30:26.300 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:30:46.318 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:31:06.336 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:31:26.355 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:31:46.374 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:32:06.392 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:32:26.411 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:32:45.164 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-27 12:32:45.191 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-27 12:32:46.430 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:33:06.448 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:33:26.468 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:33:46.486 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:34:06.501 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:34:26.520 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:34:46.538 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:35:06.556 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:35:26.572 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:35:46.588 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:36:06.607 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:36:26.622 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:36:46.641 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:37:06.658 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:37:26.672 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:37:44.192 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-27 12:37:44.219 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-27 12:37:46.691 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:38:06.710 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:38:26.728 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:38:46.747 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:39:06.762 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:39:26.780 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:39:46.798 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:40:06.817 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:40:26.833 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:40:46.851 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:41:06.869 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:41:26.888 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:41:46.906 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:42:06.921 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:42:26.939 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:42:43.221 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-27 12:42:43.250 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-27 12:42:46.958 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:43:06.971 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:43:26.986 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:43:47.004 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:44:07.022 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:44:27.041 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:44:47.059 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:45:07.077 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:45:27.092 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-27 12:45:47.110 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Oct 28, 2024 via email

@Traders-Banquet
Copy link
Author

That was my fault, I did not reenter the jitter line again. But after we completed the errors.py I downloaded your zip file again and put your alexaapi.py into the /usr/local/lib/......./alexaapy and restarted homeassistant and got the same results but can see that he is waiting for every login first 4s then 8s ... and so on . The timestamps in the log did show this too.
But with the same results.

This is the end of the LogEntries :

2024-10-28 10:53:37.884 DEBUG (MainThread) [alexapy.alexalogin] Logged in as jxxxxxxxxxxxn@gxxxe to amazon.de with id: A1MM33BQBRI847
2024-10-28 10:53:38.008 DEBUG (MainThread) [alexapy.alexalogin] Domain amazon.de matches reported account domain: amazon.de
2024-10-28 10:53:38.009 DEBUG (MainThread) [alexapy.alexahttp2] HTTP2 Connection Closed.
2024-10-28 10:53:38.767 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-28 10:53:38.767 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 1
2024-10-28 10:53:38.767 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 4.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-28 10:53:39.759 WARNING (SyncWorker_0) [custom_components.tuya_local.device] RGBCW lightbulb protocol error 905: Network Error: Device Unreachable
2024-10-28 10:53:42.820 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-28 10:53:42.820 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 2
2024-10-28 10:53:42.820 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 8.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-28 10:53:50.867 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-28 10:53:50.867 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 3
2024-10-28 10:53:50.867 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 16.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-28 10:54:06.343 WARNING (MainThread) [alexapy.helpers] alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f3e52f68680>,), {}): Timeout error occurred accessing AlexaAPI: An exception of type CancelledError occurred. Arguments:
()
2024-10-28 10:54:06.343 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: get_network_details response: None
2024-10-28 10:54:06.343 ERROR (MainThread) [custom_components.alexa_media] Error fetching alexa_media data: Error communicating with API:
2024-10-28 10:54:06.343 DEBUG (MainThread) [custom_components.alexa_media] Finished fetching alexa_media data in 30.001 seconds (success: False)
2024-10-28 10:54:06.544 DEBUG (MainThread) [custom_components.alexa_media] Completing remaining startup tasks.

@Traders-Banquet
Copy link
Author

maybe it helps you I installed a fresh copy af haos again.
Added HACS, added Alexa_Media_Player
Logged into the host and downloaded your alexaapi.zip put your alexaapi.py, edited the errors.py to insert the AlexaapiCancelledError, restarted Homeassistant with the same result.
Here is the debug log :

-------------------------------------------------------------------
alexa_media
Version: 4.13.5
This is a custom component
If you have any issues with this you need to open an issue here:
https://github.com/alandtse/alexa_media_player/issues
-------------------------------------------------------------------

2024-10-28 12:58:21.456 DEBUG (MainThread) [custom_components.alexa_media] Loaded alexapy==1.29.3
2024-10-28 12:58:21.456 DEBUG (MainThread) [custom_components.alexa_media.helpers] j***********n@g****e: Returning uuid {'uuid': '40212ea042eaede6bfee1e4d1bcc250b', 'index': 0}
2024-10-28 12:58:21.456 DEBUG (MainThread) [alexapy.alexalogin] Login created for some.email@anywhere.com - amazon.de
2024-10-28 12:58:21.456 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/.storage/alexa_media.some.email@anywhere.com.pickle
2024-10-28 12:58:21.456 DEBUG (MainThread) [alexapy.alexalogin] Trying to load cookie from file /config/.storage/alexa_media.some.email@anywhere.com.pickle
2024-10-28 12:58:21.460 DEBUG (MainThread) [alexapy.alexalogin] Trying to load aiohttpCookieJar to session
2024-10-28 12:58:21.460 DEBUG (MainThread) [alexapy.alexalogin] Loaded 14 cookies
2024-10-28 12:58:21.461 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/alexa_media.some.email@anywhere.com.pickle
2024-10-28 12:58:21.461 DEBUG (MainThread) [alexapy.alexalogin] Using cookies to log in
2024-10-28 12:58:21.461 DEBUG (MainThread) [alexapy.alexalogin] Attempting to register with amazon.de
2024-10-28 12:58:22.026 DEBUG (MainThread) [alexapy.alexalogin] auth response <ClientResponse(https://api.amazon.de/auth/register) [200 OK]>
<CIMultiDictProxy('Server': 'Server', 'Date': 'Mon, 28 Oct 2024 11:58:22 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '5747', 'Connection': 'keep-alive', 'x-amz-rid': '1J56QW1JXF6D119J6ZSH', 'x-amzn-RequestId': '13740006-4d44-49ac-895f-b940afe68a3d', 'X-Amz-Date': 'Mon, 28 Oct 2024 11:58:22 GMT', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload')>
 with 
{"requested_extensions": ["device_info", "customer_info"], "cookies": {"website_cookies": [], "domain": ".amazon.de"}, "registration_data": {"domain": "Device", "app_version": "2.2.556530.0", "device_type": "A2IVLV5VM2W81", "device_name": "%FIRST_NAME%'s%DUPE_STRATEGY_1ST%Alexa Media Player", "os_version": "16.6", "device_serial": "40212ea042eaede6bfee1e4d1bcc250b", "device_model": "iPhone", "app_name": "Alexa Media Player", "software_version": "1"}, "auth_data": {"access_token": "Atna|EwICIKI-9X8P_nOaXCVHsEE403U-KeN6aJ04JlFXufzRfh-k1XvJG_QsnDy5ZS41tc3SaWKC3dPq7yTE-hDJ4z3tORB4NWzAixC74f0ByU0aQPBcwqlC_gf367UlRGC9xLRV9A-aS2EEtvW7bOgOF4xuXhxtq3tIxtuw5WbVwRDB8d8DTKoK3UlIRV8q0KpoeU746tsnaIaq-hrO-hCrUC-xRuPQnhL-wgpisrRl2TSm0kmI_xJ9E37zJrIhqfaLcTzqllWwAFY5UrmR69ainZoaqKCfAIq3LYvRBAF7TYeIaCkawkCilWaG_3PDpLaumjkN4bUkTuWjGQ_4KPQcrFweqC35zAtrS6UHliV0RqBFaJOugY_2Dp_yPjVTGar5igI958I"}, "user_context_map": {"frc": "8IBevuaCQ8ril79t0X5KqA+V03cmZRyyJyBwhh9O60x3lmGcrGNxf5Sn4jNwDecFYEBBPv3/b1eAge3gKwDzIIHW/AiAt4irSwADe3L3Lg2dPNhbfeshFjrTBU748OtCVW7uiOoiru1feU/FZN5R5SKic3ge9HCFrqQZIAfnbk4dRkzFKJeh7pGdKBK9iONNgE77FIPCVOumpYZqSwy2mP7VgUPaDcEek7d/8sJlhufsD+IHANBz2bS6eURg20V1UIRzk76hlyD+VRv2gFZpT8xKSPyNnYq9Msic3nTa/qG0v3KsnA3SQK746vZHZqLzKKWTYGa+z/3PdGmoXJjkHn8QsZS+p6syfhb+3b4VcGkrPjRgd99TVuWDz4BOPrEQLgTAvrpJwPp31+GTUdgoH7psTALmjim/nA"}, "requested_token_type": ["bearer", "mac_dms", "website_cookies"]}
2024-10-28 12:58:22.026 DEBUG (MainThread) [alexapy.alexalogin] Successfully registered Jörg's 3rd Alexa Media Player device with Amazon
2024-10-28 12:58:22.027 DEBUG (MainThread) [alexapy.alexalogin] New access token(375) received which expires at 2024-10-28 13:58:22.027007 in 0:59:59.999989
2024-10-28 12:58:22.298 DEBUG (MainThread) [alexapy.alexalogin] capabilities response <ClientResponse(https://api.amazonalexa.com/v1/devices/@self/capabilities) [204 No Content]>
<CIMultiDictProxy('Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Mon, 28 Oct 2024 11:58:22 GMT', 'x-amz-rid': 'DGCP4VFZC0GE5JH1EMVV', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 347732911156afff87ff95b6d55b9278.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P2', 'X-Amz-Cf-Id': 'ob3wReY3ix4iT2XEiBFgN5gN1tAZ4mcpX1XBikfUHVWvE1YZyCaAtQ==')>
 with 
{"legacyFlags": {"SUPPORTS_COMMS": true, "SUPPORTS_ARBITRATION": true, "SCREEN_WIDTH": 1170, "SUPPORTS_SCRUBBING": true, "SPEECH_SYNTH_SUPPORTS_TTS_URLS": false, "SUPPORTS_HOME_AUTOMATION": true, "SUPPORTS_DROPIN_OUTBOUND": true, "FRIENDLY_NAME_TEMPLATE": "VOX", "SUPPORTS_SIP_OUTBOUND_CALLING": true, "VOICE_PROFILE_SWITCHING_DISABLED": true, "SUPPORTS_LYRICS_IN_CARD": false, "SUPPORTS_DATAMART_NAMESPACE": "Vox", "SUPPORTS_VIDEO_CALLING": true, "SUPPORTS_PFM_CHANGED": true, "SUPPORTS_TARGET_PLATFORM": "TABLET", "SUPPORTS_SECURE_LOCKSCREEN": false, "AUDIO_PLAYER_SUPPORTS_TTS_URLS": false, "SUPPORTS_KEYS_IN_HEADER": false, "SUPPORTS_MIXING_BEHAVIOR_FOR_AUDIO_PLAYER": false, "AXON_SUPPORT": true, "SUPPORTS_TTS_SPEECHMARKS": true}, "envelopeVersion": "20160207", "capabilities": [{"version": "0.1", "interface": "CardRenderer", "type": "AlexaInterface"}, {"interface": "Navigation", "type": "AlexaInterface", "version": "1.1"}, {"type": "AlexaInterface", "version": "2.0", "interface": "Alexa.Comms.PhoneCallController"}, {"type": "AlexaInterface", "version": "1.1", "interface": "ExternalMediaPlayer"}, {"type": "AlexaInterface", "interface": "Alerts", "configurations": {"maximumAlerts": {"timers": 2, "overall": 99, "alarms": 2}}, "version": "1.3"}, {"version": "1.0", "interface": "Alexa.Display.Window", "type": "AlexaInterface", "configurations": {"templates": [{"type": "STANDARD", "id": "app_window_template", "configuration": {"sizes": [{"id": "fullscreen", "type": "DISCRETE", "value": {"value": {"height": 1440, "width": 3200}, "unit": "PIXEL"}}], "interactionModes": ["mobile_mode", "auto_mode"]}}]}}, {"type": "AlexaInterface", "interface": "AccessoryKit", "version": "0.1"}, {"type": "AlexaInterface", "interface": "Alexa.AudioSignal.ActiveNoiseControl", "version": "1.0", "configurations": {"ambientSoundProcessingModes": [{"name": "ACTIVE_NOISE_CONTROL"}, {"name": "PASSTHROUGH"}]}}, {"interface": "PlaybackController", "type": "AlexaInterface", "version": "1.0"}, {"version": "1.0", "interface": "Speaker", "type": "AlexaInterface"}, {"version": "1.0", "interface": "SpeechSynthesizer", "type": "AlexaInterface"}, {"version": "1.0", "interface": "AudioActivityTracker", "type": "AlexaInterface"}, {"type": "AlexaInterface", "interface": "Alexa.Camera.LiveViewController", "version": "1.0"}, {"type": "AlexaInterface", "version": "1.0", "interface": "Alexa.Input.Text"}, {"type": "AlexaInterface", "interface": "Alexa.PlaybackStateReporter", "version": "1.0"}, {"version": "1.1", "interface": "Geolocation", "type": "AlexaInterface"}, {"interface": "Alexa.Health.Fitness", "version": "1.0", "type": "AlexaInterface"}, {"interface": "Settings", "type": "AlexaInterface", "version": "1.0"}, {"configurations": {"interactionModes": [{"dialog": "SUPPORTED", "interactionDistance": {"value": 18, "unit": "INCHES"}, "video": "SUPPORTED", "keyboard": "SUPPORTED", "id": "mobile_mode", "uiMode": "MOBILE", "touch": "SUPPORTED"}, {"video": "UNSUPPORTED", "dialog": "SUPPORTED", "interactionDistance": {"value": 36, "unit": "INCHES"}, "uiMode": "AUTO", "touch": "SUPPORTED", "id": "auto_mode", "keyboard": "UNSUPPORTED"}]}, "type": "AlexaInterface", "interface": "Alexa.InteractionMode", "version": "1.0"}, {"type": "AlexaInterface", "configurations": {"catalogs": [{"type": "IOS_APP_STORE", "identifierTypes": ["URI_HTTP_SCHEME", "URI_CUSTOM_SCHEME"]}]}, "version": "0.2", "interface": "Alexa.Launcher"}, {"interface": "System", "version": "1.0", "type": "AlexaInterface"}, {"interface": "Alexa.IOComponents", "type": "AlexaInterface", "version": "1.4"}, {"type": "AlexaInterface", "interface": "Alexa.FavoritesController", "version": "1.0"}, {"version": "1.0", "type": "AlexaInterface", "interface": "Alexa.Mobile.Push"}, {"type": "AlexaInterface", "interface": "InteractionModel", "version": "1.1"}, {"interface": "Alexa.PlaylistController", "type": "AlexaInterface", "version": "1.0"}, {"interface": "SpeechRecognizer", "type": "AlexaInterface", "version": "2.1"}, {"interface": "AudioPlayer", "type": "AlexaInterface", "version": "1.3"}, {"type": "AlexaInterface", "version": "3.1", "interface": "Alexa.RTCSessionController"}, {"interface": "VisualActivityTracker", "version": "1.1", "type": "AlexaInterface"}, {"interface": "Alexa.PlaybackController", "version": "1.0", "type": "AlexaInterface"}, {"type": "AlexaInterface", "interface": "Alexa.SeekController", "version": "1.0"}, {"interface": "Alexa.Comms.MessagingController", "type": "AlexaInterface", "version": "1.0"}]}
{"User-Agent": "AmazonWebView/Amazon Alexa/2.2.556530.0/iOS/16.6/iPhone", "Accept-Language": "en-US", "Accept-Charset": "utf-8", "Connection": "keep-alive", "Content-type": "application/json; charset=UTF-8", "authorization": "Bearer Atna|EwICIKjKxyGhO97WiAYFGIUXF7OwFBBe8y2KtUDmY1brCwrkrSOGJG6D7q1m0kUlfrSp9NBQqLXoxISLf_92cegAgvU0QwQMcHWrc1CzsciTX4--z8h4xBa9CS0Q1P3dyCZc1GIPyZ5DPmGDJbA7G1QpcMktQZkTeGWGOpLbI26lSSqpNZuJg7nYx0zZx_maV9dterd7kybIbhDquWewK-UfJ4rji-lFwEAK25l1KTXyEA-QdTv3RUcTaISKSxqsyF8Ewo3smlKHNXAs3VGLwSW_6sX9o6LW2yqrRqwl4iboBCDUkZYS-te9VDqDVBhUFPvu5LHzG9UKpZ0xsLeGfThmX4jSvuDyjNxBlWZJ2wXCKWbtVA"}
2024-10-28 12:58:22.475 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: session-id=257-8769482-4488536; Domain=.amazon.de; expires=23 Oct 2044 11:58:22 GMT; Path=/; Secure
2024-10-28 12:58:22.475 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: ubid-acbde=262-9319977-6873302; Domain=.amazon.de; expires=23 Oct 2044 11:58:22 GMT; Path=/; Secure
2024-10-28 12:58:22.475 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: x-acbde="oCn@jtjXfiiNOFqHHdMR9?5cIOAoyqBA"; Domain=.amazon.de; expires=23 Oct 2044 11:58:22 GMT; Path=/; Secure
2024-10-28 12:58:22.475 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: at-acbde=Atza|IwEBIO0ROiXlLW370Rp2VpsS9UUDCcHUvQwH7_7Zk1JZLsOViVkJIATfI6X3B1MQsZr8pPakBRNdqn36PeT1uSDQ6M6BmUrULIE9zBj-aGMme34ze0vWA026nH4LdxjGLZfZtQt1lGjU1EHckjAi8F24m9haIm9Psifwo1j8i4K9O1DvUiJ7qHo45zRqGTLV060Q0fFuUfinRkfagd3zfuX2ZKYBZh6q__0B9pyddDeSvQHisNEN6qCS6ri-3jWEwN_ZsLCTd2Xbo-Dow4485iv99il5Wo4d_LY_o25p8zTGHPYnF-m8XRA4LNVVz_VM7tXroG2uedBBl1IhtdL_tHORdcC3n6B1Z36f_8y5UN42gmz2U2sKHvMZJYIqzd70Z6PDjzkWqeHSAaQcwflySh4KOffI; Domain=.amazon.de; expires=29 Oct 2024 11:58:22 GMT; HttpOnly; Path=/; Secure
2024-10-28 12:58:22.475 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: sess-at-acbde="go55v4/NfC0oguRJyMtmQEajarAEvkMYLensPKUDgt8="; Domain=.amazon.de; expires=29 Oct 2024 11:58:22 GMT; HttpOnly; Path=/; Secure
2024-10-28 12:58:22.475 INFO (MainThread) [alexapy.alexalogin] Exchanged refresh token for 5 .amazon.de cookies: ['session-id', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde']
2024-10-28 12:58:22.475 DEBUG (MainThread) [alexapy.alexalogin] CSRF already exists; no need to discover
2024-10-28 12:58:22.475 DEBUG (MainThread) [alexapy.alexalogin] Session cookies for 'https://alexa.amazon.com/api/bootstrap': ['JSESSIONID', 'session-id', 'session-id-time', 'lc-main', 'ubid-main', 'session-token', 'x-main', 'at-main', 'sess-at-main', 'csrf']
2024-10-28 12:58:22.759 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.com/api/bootstrap returned 200:OK with response <CIMultiDictProxy('Content-Type': 'application/json', 'Content-Length': '175', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Mon, 28 Oct 2024 11:58:22 GMT', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'x-amz-rid': 'AZYXPNCG1ZBHX8MSND2E', 'x-amzn-RequestId': 'AZYXPNCG1ZBHX8MSND2E', 'x-amzn-alt-domain': 'https://alexa.amazon.de/logout', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 57b1c45cee24c7bbeb8b5420d5868740.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P1', 'X-Amz-Cf-Id': 'T2HGk30Pp8zZBy77m4IripTm-QLhu8t_gZXeFe42sllh5-duBF2MbA==')>
2024-10-28 12:58:22.760 DEBUG (MainThread) [alexapy.alexalogin] Session cookies for 'https://alexa.amazon.de/api/bootstrap': ['JSESSIONID', 'session-id', 'session-id-time', 'lc-main', 'ubid-main', 'session-token', 'x-main', 'at-main', 'sess-at-main', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde', 'csrf']
2024-10-28 12:58:22.945 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.de/api/bootstrap returned 200:OK with response <CIMultiDictProxy('Content-Type': 'application/json', 'Content-Length': '175', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Mon, 28 Oct 2024 11:58:22 GMT', 'x-amz-rid': '1GPE8KHE4ZGSMHY1S40H', 'x-amzn-ActionTrace': 'amzn1.tr.71889385-3e87-11e6-99f3-0a51a1b50200.629.$9C4pq.fkYI!u', 'x-amzn-RequestId': '1GPE8KHE4ZGSMHY1S40H', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'Strict-Transport-Security': 'max-age=0; includeSubDomains;', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 9ed190c9d6b2f812d19cbb317856ed88.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'FRA60-P6', 'X-Amz-Cf-Id': 'ShLeMsIsqXwmC0MM-1gRSPtL6vn4f3H6sout9jyMk7RpkznIIE36gg==')>
2024-10-28 12:58:22.945 DEBUG (MainThread) [alexapy.alexalogin] Logged in as some.email@anywhere.com to amazon.de with id: A1MM33BQBRI847
2024-10-28 12:58:23.109 DEBUG (MainThread) [alexapy.alexalogin] Domain amazon.de matches reported account domain: amazon.de
2024-10-28 12:58:23.110 DEBUG (MainThread) [alexapy.alexalogin] Login confirmed for some.email@anywhere.com - amazon.de; saving cookie to /config/.storage/alexa_media.some.email@anywhere.com.pickle
2024-10-28 12:58:23.112 DEBUG (MainThread) [custom_components.alexa_media] Testing login status: {'login_successful': True}
2024-10-28 12:58:23.112 DEBUG (MainThread) [custom_components.alexa_media] Setting up Alexa devices for j***********n@g****e
2024-10-28 12:58:23.112 DEBUG (MainThread) [custom_components.alexa_media] include: 
2024-10-28 12:58:23.112 DEBUG (MainThread) [custom_components.alexa_media] exclude: 
2024-10-28 12:58:23.112 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: HTTP2 created: <alexapy.alexahttp2.HTTP2EchoClient object at 0x7f801e86c9b0>
2024-10-28 12:58:23.112 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: HTTP2push successfully connected
2024-10-28 12:58:23.112 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: Creating coordinator
2024-10-28 12:58:23.112 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: Refreshing coordinator
2024-10-28 12:58:23.112 DEBUG (MainThread) [alexapy.alexahttp2] Starting message parsing loop.
2024-10-28 12:58:23.112 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|EwICIKjKxyGhO97WiAYFGIUXF7OwFBBe8y2KtUDmY1brCwrkrSOGJG6D7q1m0kUlfrSp9NBQqLXoxISLf_92cegAgvU0QwQMcHWrc1CzsciTX4--z8h4xBa9CS0Q1P3dyCZc1GIPyZ5DPmGDJbA7G1QpcMktQZkTeGWGOpLbI26lSSqpNZuJg7nYx0zZx_maV9dterd7kybIbhDquWewK-UfJ4rji-lFwEAK25l1KTXyEA-QdTv3RUcTaISKSxqsyF8Ewo3smlKHNXAs3VGLwSW_6sX9o6LW2yqrRqwl4iboBCDUkZYS-te9VDqDVBhUFPvu5LHzG9UKpZ0xsLeGfThmX4jSvuDyjNxBlWZJ2wXCKWbtVA'}
2024-10-28 12:58:23.113 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-28 12:58:23.190 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-28 12:58:23.190 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 1
2024-10-28 12:58:23.190 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 2.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-28 12:58:23.219 DEBUG (MainThread) [alexapy.alexahttp2] Received raw message: --------abcde123

2024-10-28 12:58:23.225 DEBUG (MainThread) [alexapy.alexahttp2] HTTP2 Connection Closed.
2024-10-28 12:58:23.226 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: Close requested; will not reconnect http2
2024-10-28 12:58:23.230 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/bootstrap returned 200:OK:application/json
2024-10-28 12:58:23.230 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 2
2024-10-28 12:58:23.244 DEBUG (MainThread) [alexapy.alexahttp2] Received response: 204:
2024-10-28 12:58:23.280 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/dnd/device-status-list returned 200:OK:application/json
2024-10-28 12:58:23.280 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 3
2024-10-28 12:58:23.355 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/devices-v2/device returned 200:OK:application/json
2024-10-28 12:58:23.355 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 4
2024-10-28 12:58:23.637 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/bluetooth?cached=false returned 200:OK:application/json
2024-10-28 12:58:23.637 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 5
2024-10-28 12:58:23.754 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/device-preferences returned 200:OK:application/json
2024-10-28 12:58:23.755 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 6
2024-10-28 12:58:25.247 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-28 12:58:25.248 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 7
2024-10-28 12:58:25.248 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 4.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-28 12:58:29.301 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-28 12:58:29.301 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 8
2024-10-28 12:58:29.301 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 8.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-28 12:58:37.360 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-28 12:58:37.360 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 9
2024-10-28 12:58:37.360 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 16.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-28 12:58:53.113 WARNING (MainThread) [alexapy.helpers] alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f801e811280>,), {}): Timeout error occurred accessing AlexaAPI: An exception of type CancelledError occurred. Arguments:
()
2024-10-28 12:58:53.113 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: get_network_details response: None
2024-10-28 12:58:53.113 ERROR (MainThread) [custom_components.alexa_media] Error fetching alexa_media data: Error communicating with API: 
2024-10-28 12:58:53.113 DEBUG (MainThread) [custom_components.alexa_media] Finished fetching alexa_media data in 30.001 seconds (success: False)

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Oct 28, 2024

WARNING (MainThread) [alexapy.helpers] alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f801e811280>,), {}): Timeout error occurred accessing AlexaAPI: An exception of type CancelledError occurred. Arguments:

It looks like Alexa Guard might need to be removed from AMP & alexapy. Amazon discontinued it earlier this year and and replaced it with a new Emergency Assist subscription. What I don't know at this point is whether the home/away modes in it are still "guard" devices in the backend and I did not sign up for the new subscription so I can't test anything. If the backend devices are different then I suspect the backend is slowly getting cleaned of "guard" devices. FYI, I'm not getting "429" errors on the phoenix call; it just finds no guard devices.

See: https://reolink.com/blog/alexa-guard/
and also: https://www.pcmag.com/news/amazon-discontinues-alexa-guard-will-require-subscription-for-its-best

@danielbrunt57
Copy link
Collaborator

Try this revised function:

    def _min_expo_wait(min_wait: float):
        """Exponential backoff with a minimum wait time."""

        def f(*args, **kwargs):
            gen = backoff.expo(*args, **kwargs)

            # Disabled discarding first one and added a random() delay if v is None
            # v  = next(gen) # waste first one always returning None in backoff.expo
            # _LOGGER.debug(f"_min_expo_wait - First: {v}")

            while True:
                v = next(gen)
                _LOGGER.debug(f"_min_expo_wait - next(gen): {v}")
                v = random.uniform(0.5, 1.5) if v is None else max(min_wait, v)
                _LOGGER.debug(f"_min_expo_wait - returning {v}")
                yield v

        return f

@danielbrunt57
Copy link
Collaborator

As for Alexa Guard, there are a few places it's defined.
AMP: __init__.py (6), alarm_control_panel.py (remove), alexa_entity.py (16)
alexapy: alexaapi.py (14) - This one is a little tricky since Guard & Network both use the same phoenix call with guard being the primary phoenix call and network discovery then calls that function.

@Traders-Banquet
Copy link
Author

I changed the function but this did not change anything. I think, the guard timeout error is a consequence of the too many requests error.

I've read the alexa guard and think this should not be a problem for poeple who don't use this feature and as you mentioned it will be only a message worth that this service is no longer available.
Maybe I should try to install a fresh version of homeassistant by another helper scipt. Maybe the problem has another reason that noone would expect.

Here are the last log lines, after I insertet the new function and startet her :

2024-10-29 19:40:28.855 DEBUG (MainThread) [alexapy.alexalogin] Logged in as some.email@gmx.de to amazon.de with id: WHATEVERIDITWAS
2024-10-29 19:40:28.987 DEBUG (MainThread) [alexapy.alexalogin] Domain amazon.de matches reported account domain: amazon.de
2024-10-29 19:40:28.988 DEBUG (MainThread) [alexapy.alexahttp2] HTTP2 Connection Closed.
2024-10-29 19:40:29.774 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-29 19:40:29.774 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 1
2024-10-29 19:40:29.774 DEBUG (MainThread) [alexapy.alexaapi] _min_expo_wait - next(gen): 2
2024-10-29 19:40:29.774 DEBUG (MainThread) [alexapy.alexaapi] _min_expo_wait - returning 2.0
2024-10-29 19:40:29.774 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 2.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-29 19:40:31.823 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-29 19:40:31.824 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 2
2024-10-29 19:40:31.824 DEBUG (MainThread) [alexapy.alexaapi] _min_expo_wait - next(gen): 4
2024-10-29 19:40:31.824 DEBUG (MainThread) [alexapy.alexaapi] _min_expo_wait - returning 4
2024-10-29 19:40:31.824 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 4.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-29 19:40:35.874 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-29 19:40:35.874 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 3
2024-10-29 19:40:35.874 DEBUG (MainThread) [alexapy.alexaapi] _min_expo_wait - next(gen): 8
2024-10-29 19:40:35.874 DEBUG (MainThread) [alexapy.alexaapi] _min_expo_wait - returning 8
2024-10-29 19:40:35.874 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 8.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-29 19:40:41.309 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for RGBCW lightbulb
2024-10-29 19:40:43.930 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-29 19:40:43.930 DEBUG (MainThread) [alexapy.alexaapi] number of api_calls: 4
2024-10-29 19:40:43.930 DEBUG (MainThread) [alexapy.alexaapi] _min_expo_wait - next(gen): 16
2024-10-29 19:40:43.930 DEBUG (MainThread) [alexapy.alexaapi] _min_expo_wait - returning 16
2024-10-29 19:40:43.930 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 16.0s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-29 19:40:57.465 WARNING (MainThread) [alexapy.helpers] alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f1adad1e930>,), {}): Timeout error occurred accessing AlexaAPI: An exception of type CancelledError occurred. Arguments:
()
2024-10-29 19:40:57.466 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: get_network_details response: None
2024-10-29 19:40:57.466 ERROR (MainThread) [custom_components.alexa_media] Error fetching alexa_media data: Error communicating with API:
2024-10-29 19:40:57.466 DEBUG (MainThread) [custom_components.alexa_media] Finished fetching alexa_media data in 30.002 seconds (success: False)

@danielbrunt57
Copy link
Collaborator

Have a look at trying @srescio's merge request for alexapy.
See issue #2453

@Traders-Banquet
Copy link
Author

Traders-Banquet commented Oct 30, 2024

I tried this version of the alexaapy too, but it won't help. For any reason, everytime the phoenix call started, I got the too many requests error. Maybe amazon dislike me. I have a FHEM installation, that works fine. For testing the Alexa_Media_Player integration, I set the VM with FHEM to pause, to avoid to have too many requests at the same time. I enabled the Wirequard Plugin and set the routing of the Plugin to route all the traffic trough the tunnel but with no effekt. I took out an old Backup of the homeassistant from July this Year in another VM and testet the alexa_media_player there .... same results. I have 9 echos, this should not be too much. I should try to create a new amazon account, maybe this helps but than I would have none of my echos in there. At this point it is a little bit frustrating.

@srescio
Copy link
Contributor

srescio commented Oct 30, 2024

@Traders-Banquet did you perform the core rebuild against the docker container?

@Traders-Banquet
Copy link
Author

Traders-Banquet commented Oct 30, 2024

Well I'm not shure but I did it again with this result :

-------------------------------------------------------------------
alexa_media
Version: 4.13.5
This is a custom component
If you have any issues with this you need to open an issue here:
https://github.com/alandtse/alexa_media_player/issues
-------------------------------------------------------------------

2024-10-30 14:02:01.120 DEBUG (MainThread) [custom_components.alexa_media] Loaded alexapy==1.27.10
2024-10-30 14:02:01.120 DEBUG (MainThread) [custom_components.alexa_media.helpers] j***********n@g****e: Returning uuid {'uuid': '7d8f4ed2ab54eb2daf331dd667774cce', 'index': 0}
2024-10-30 14:02:01.120 DEBUG (MainThread) [alexapy.alexalogin] Login created for some.email@anywhere.com - amazon.de
2024-10-30 14:02:01.121 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/.storage/alexa_media.some.email@anywhere.com.pickle
2024-10-30 14:02:01.121 DEBUG (MainThread) [alexapy.alexalogin] Trying to load cookie from file /config/.storage/alexa_media.some.email@anywhere.com.pickle
2024-10-30 14:02:01.125 DEBUG (MainThread) [alexapy.alexalogin] Trying to load aiohttpCookieJar to session
2024-10-30 14:02:01.125 DEBUG (MainThread) [alexapy.alexalogin] Loaded 14 cookies
2024-10-30 14:02:01.126 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/alexa_media.some.email@anywhere.com.pickle
2024-10-30 14:02:01.126 DEBUG (MainThread) [alexapy.alexalogin] Using cookies to log in
2024-10-30 14:02:01.127 DEBUG (MainThread) [alexapy.alexalogin] Attempting to register with amazon.de
2024-10-30 14:02:01.338 DEBUG (MainThread) [alexapy.alexalogin] auth response <ClientResponse(https://api.amazon.de/auth/register) [401 Unauthorized]>
<CIMultiDictProxy('Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:01 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '253', 'Connection': 'keep-alive', 'x-amz-rid': 'DNKR6DC7JCD8RN546TF0', 'x-amzn-RequestId': 'd1cddfee-b2d5-43ea-9664-7476f2327dbd', 'X-Amz-Date': 'Wed, 30 Oct 2024 13:02:01 GMT', 'WWW-Authenticate': 'Basic realm="api.amazon.de/auth/register"', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'x-amzn-Remapped-WWW-Authenticate': 'Basic realm="api.amazon.de/auth/register"', 'Pragma': 'no-cache', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload')>
 with 
{"requested_extensions": ["device_info", "customer_info"], "cookies": {"website_cookies": [], "domain": ".amazon.de"}, "registration_data": {"domain": "Device", "app_version": "2.2.556530.0", "device_type": "A2IVLV5VM2W81", "device_name": "%FIRST_NAME%'s%DUPE_STRATEGY_1ST%Alexa Media Player", "os_version": "16.6", "device_serial": "7d8f4ed2ab54eb2daf331dd667774cce", "device_model": "iPhone", "app_name": "Alexa Media Player", "software_version": "1"}, "auth_data": {"access_token": "Atna|EwICIGwTJxB94mMNQCfiQ_xNr1r0RdTO_XOEwwBmMOQtY2nu4pRS49aWwlEOsuK4ZMBt66qWxeZ0ujUEuVPu0plc9wfbJG3edkbJJCQiWDN-Ces-AWVoKaRk6JWbT-FBL8VzICEhmHWccXOzeBJA969uoRT6_Um7o-6GfxrWN-Pn04EqoqhsfSsLwWA0qkCfotIeaEfKEH69wAD2ws29oM7cKPtRC7E7bmZRvrvExZJ7-W0erl7X4vXbXz9Oa0o77sTjBUAbvuX5QSsMyTt9BQa8DP3G4E-jq7Hd1OELuUj3had5RFqTakpeMPRB_k5B8xW8e5efxkclh_VPws50wJqx2Os6bzMGUiG3aQy-DDBL7WrAq3Wb6IF6UOyZe2BYWZC4wYE"}, "user_context_map": {"frc": "NgmtHlmgWKs5R0rYV5wAfVQT+HAnqYzTlp0VvbWCnfqLkK4udQVHxyFMtWaGU7fuxsdFi31+mPMfAvlYGUyZup49Ds8dT0SrhP/zgFxRgrPNeqZ+uXeJ9yiXhEYozdjiQP6AeL17ZpHV3NEvZcGuRc+7QzQdmyj0312vjgq9a9LwcQ1KIFCZWX8sqbkJVcnkoFqBsAAlSdpYJt0rQv14so2OAW4ej4JVCv/RKceF8aQCeh1i7DylEBi2h9u8Swlr07ZFQBqWe8/eCz9XzZmOXA/DyKOjEb/P27wV0kwcJB5I7IW3jA/E9Oyia/+Y4PQe5CcKPH6+0s4OHaHmrcQ3hWsJ+N4ydcKHmV0y3oAVD8eGjJEbqZ8qY0h5mfSlgd87DaF/EkI/0G3elu23cBlZvP0sSO90LIXung"}, "requested_token_type": ["bearer", "mac_dms", "website_cookies"]}
2024-10-30 14:02:01.338 DEBUG (MainThread) [alexapy.alexalogin] Attempting to register with amazon.com
2024-10-30 14:02:01.721 DEBUG (MainThread) [alexapy.alexalogin] auth response <ClientResponse(https://api.amazon.com/auth/register) [401 Unauthorized]>
<CIMultiDictProxy('Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:01 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '254', 'Connection': 'keep-alive', 'x-amz-rid': 'JDHDHC2MGZH2KVJE6J7T', 'x-amzn-RequestId': '58086d0c-28ff-431c-8d97-3d1a6876642a', 'X-Amz-Date': 'Wed, 30 Oct 2024 13:02:01 GMT', 'WWW-Authenticate': 'Basic realm="api.amazon.com/auth/register"', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'x-amzn-Remapped-WWW-Authenticate': 'Basic realm="api.amazon.com/auth/register"', 'Pragma': 'no-cache', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload')>
 with 
{"requested_extensions": ["device_info", "customer_info"], "cookies": {"website_cookies": [], "domain": ".amazon.com"}, "registration_data": {"domain": "Device", "app_version": "2.2.556530.0", "device_type": "A2IVLV5VM2W81", "device_name": "%FIRST_NAME%'s%DUPE_STRATEGY_1ST%Alexa Media Player", "os_version": "16.6", "device_serial": "7d8f4ed2ab54eb2daf331dd667774cce", "device_model": "iPhone", "app_name": "Alexa Media Player", "software_version": "1"}, "auth_data": {"access_token": "Atna|EwICIGwTJxB94mMNQCfiQ_xNr1r0RdTO_XOEwwBmMOQtY2nu4pRS49aWwlEOsuK4ZMBt66qWxeZ0ujUEuVPu0plc9wfbJG3edkbJJCQiWDN-Ces-AWVoKaRk6JWbT-FBL8VzICEhmHWccXOzeBJA969uoRT6_Um7o-6GfxrWN-Pn04EqoqhsfSsLwWA0qkCfotIeaEfKEH69wAD2ws29oM7cKPtRC7E7bmZRvrvExZJ7-W0erl7X4vXbXz9Oa0o77sTjBUAbvuX5QSsMyTt9BQa8DP3G4E-jq7Hd1OELuUj3had5RFqTakpeMPRB_k5B8xW8e5efxkclh_VPws50wJqx2Os6bzMGUiG3aQy-DDBL7WrAq3Wb6IF6UOyZe2BYWZC4wYE"}, "user_context_map": {"frc": "NgmtHlmgWKs5R0rYV5wAfVQT+HAnqYzTlp0VvbWCnfqLkK4udQVHxyFMtWaGU7fuxsdFi31+mPMfAvlYGUyZup49Ds8dT0SrhP/zgFxRgrPNeqZ+uXeJ9yiXhEYozdjiQP6AeL17ZpHV3NEvZcGuRc+7QzQdmyj0312vjgq9a9LwcQ1KIFCZWX8sqbkJVcnkoFqBsAAlSdpYJt0rQv14so2OAW4ej4JVCv/RKceF8aQCeh1i7DylEBi2h9u8Swlr07ZFQBqWe8/eCz9XzZmOXA/DyKOjEb/P27wV0kwcJB5I7IW3jA/E9Oyia/+Y4PQe5CcKPH6+0s4OHaHmrcQ3hWsJ+N4ydcKHmV0y3oAVD8eGjJEbqZ8qY0h5mfSlgd87DaF/EkI/0G3elu23cBlZvP0sSO90LIXung"}, "requested_token_type": ["bearer", "mac_dms", "website_cookies"]}
2024-10-30 14:02:01.721 DEBUG (MainThread) [alexapy.alexalogin] Unable to register with ['amazon.de', 'amazon.com']
2024-10-30 14:02:01.896 DEBUG (MainThread) [alexapy.alexalogin] capabilities response <ClientResponse(https://api.amazonalexa.com/v1/devices/@self/capabilities) [403 Forbidden]>
<CIMultiDictProxy('Content-Length': '0', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:01 GMT', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload', 'x-amz-rid': 'Q8X3SFTWFJEN2JZ5GV27', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 c9b630de734c38e36e97554a32ac1a68.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P4', 'X-Amz-Cf-Id': 'Raa3Hm_fmxc4GomN8VmZNvNO8LqV6fk4BzrYqSGzZKs8dzHOa8F7xQ==')>
 with 
{"legacyFlags": {"SUPPORTS_COMMS": true, "SUPPORTS_ARBITRATION": true, "SCREEN_WIDTH": 1170, "SUPPORTS_SCRUBBING": true, "SPEECH_SYNTH_SUPPORTS_TTS_URLS": false, "SUPPORTS_HOME_AUTOMATION": true, "SUPPORTS_DROPIN_OUTBOUND": true, "FRIENDLY_NAME_TEMPLATE": "VOX", "SUPPORTS_SIP_OUTBOUND_CALLING": true, "VOICE_PROFILE_SWITCHING_DISABLED": true, "SUPPORTS_LYRICS_IN_CARD": false, "SUPPORTS_DATAMART_NAMESPACE": "Vox", "SUPPORTS_VIDEO_CALLING": true, "SUPPORTS_PFM_CHANGED": true, "SUPPORTS_TARGET_PLATFORM": "TABLET", "SUPPORTS_SECURE_LOCKSCREEN": false, "AUDIO_PLAYER_SUPPORTS_TTS_URLS": false, "SUPPORTS_KEYS_IN_HEADER": false, "SUPPORTS_MIXING_BEHAVIOR_FOR_AUDIO_PLAYER": false, "AXON_SUPPORT": true, "SUPPORTS_TTS_SPEECHMARKS": true}, "envelopeVersion": "20160207", "capabilities": [{"version": "0.1", "interface": "CardRenderer", "type": "AlexaInterface"}, {"interface": "Navigation", "type": "AlexaInterface", "version": "1.1"}, {"type": "AlexaInterface", "version": "2.0", "interface": "Alexa.Comms.PhoneCallController"}, {"type": "AlexaInterface", "version": "1.1", "interface": "ExternalMediaPlayer"}, {"type": "AlexaInterface", "interface": "Alerts", "configurations": {"maximumAlerts": {"timers": 2, "overall": 99, "alarms": 2}}, "version": "1.3"}, {"version": "1.0", "interface": "Alexa.Display.Window", "type": "AlexaInterface", "configurations": {"templates": [{"type": "STANDARD", "id": "app_window_template", "configuration": {"sizes": [{"id": "fullscreen", "type": "DISCRETE", "value": {"value": {"height": 1440, "width": 3200}, "unit": "PIXEL"}}], "interactionModes": ["mobile_mode", "auto_mode"]}}]}}, {"type": "AlexaInterface", "interface": "AccessoryKit", "version": "0.1"}, {"type": "AlexaInterface", "interface": "Alexa.AudioSignal.ActiveNoiseControl", "version": "1.0", "configurations": {"ambientSoundProcessingModes": [{"name": "ACTIVE_NOISE_CONTROL"}, {"name": "PASSTHROUGH"}]}}, {"interface": "PlaybackController", "type": "AlexaInterface", "version": "1.0"}, {"version": "1.0", "interface": "Speaker", "type": "AlexaInterface"}, {"version": "1.0", "interface": "SpeechSynthesizer", "type": "AlexaInterface"}, {"version": "1.0", "interface": "AudioActivityTracker", "type": "AlexaInterface"}, {"type": "AlexaInterface", "interface": "Alexa.Camera.LiveViewController", "version": "1.0"}, {"type": "AlexaInterface", "version": "1.0", "interface": "Alexa.Input.Text"}, {"type": "AlexaInterface", "interface": "Alexa.PlaybackStateReporter", "version": "1.0"}, {"version": "1.1", "interface": "Geolocation", "type": "AlexaInterface"}, {"interface": "Alexa.Health.Fitness", "version": "1.0", "type": "AlexaInterface"}, {"interface": "Settings", "type": "AlexaInterface", "version": "1.0"}, {"configurations": {"interactionModes": [{"dialog": "SUPPORTED", "interactionDistance": {"value": 18, "unit": "INCHES"}, "video": "SUPPORTED", "keyboard": "SUPPORTED", "id": "mobile_mode", "uiMode": "MOBILE", "touch": "SUPPORTED"}, {"video": "UNSUPPORTED", "dialog": "SUPPORTED", "interactionDistance": {"value": 36, "unit": "INCHES"}, "uiMode": "AUTO", "touch": "SUPPORTED", "id": "auto_mode", "keyboard": "UNSUPPORTED"}]}, "type": "AlexaInterface", "interface": "Alexa.InteractionMode", "version": "1.0"}, {"type": "AlexaInterface", "configurations": {"catalogs": [{"type": "IOS_APP_STORE", "identifierTypes": ["URI_HTTP_SCHEME", "URI_CUSTOM_SCHEME"]}]}, "version": "0.2", "interface": "Alexa.Launcher"}, {"interface": "System", "version": "1.0", "type": "AlexaInterface"}, {"interface": "Alexa.IOComponents", "type": "AlexaInterface", "version": "1.4"}, {"type": "AlexaInterface", "interface": "Alexa.FavoritesController", "version": "1.0"}, {"version": "1.0", "type": "AlexaInterface", "interface": "Alexa.Mobile.Push"}, {"type": "AlexaInterface", "interface": "InteractionModel", "version": "1.1"}, {"interface": "Alexa.PlaylistController", "type": "AlexaInterface", "version": "1.0"}, {"interface": "SpeechRecognizer", "type": "AlexaInterface", "version": "2.1"}, {"interface": "AudioPlayer", "type": "AlexaInterface", "version": "1.3"}, {"type": "AlexaInterface", "version": "3.1", "interface": "Alexa.RTCSessionController"}, {"interface": "VisualActivityTracker", "version": "1.1", "type": "AlexaInterface"}, {"interface": "Alexa.PlaybackController", "version": "1.0", "type": "AlexaInterface"}, {"type": "AlexaInterface", "interface": "Alexa.SeekController", "version": "1.0"}, {"interface": "Alexa.Comms.MessagingController", "type": "AlexaInterface", "version": "1.0"}]}
{"User-Agent": "AmazonWebView/Amazon Alexa/2.2.556530.0/iOS/16.6/iPhone", "Accept-Language": "en-US", "Accept-Charset": "utf-8", "Connection": "keep-alive", "Content-type": "application/json; charset=UTF-8", "authorization": "Bearer Atna|EwICIGwTJxB94mMNQCfiQ_xNr1r0RdTO_XOEwwBmMOQtY2nu4pRS49aWwlEOsuK4ZMBt66qWxeZ0ujUEuVPu0plc9wfbJG3edkbJJCQiWDN-Ces-AWVoKaRk6JWbT-FBL8VzICEhmHWccXOzeBJA969uoRT6_Um7o-6GfxrWN-Pn04EqoqhsfSsLwWA0qkCfotIeaEfKEH69wAD2ws29oM7cKPtRC7E7bmZRvrvExZJ7-W0erl7X4vXbXz9Oa0o77sTjBUAbvuX5QSsMyTt9BQa8DP3G4E-jq7Hd1OELuUj3had5RFqTakpeMPRB_k5B8xW8e5efxkclh_VPws50wJqx2Os6bzMGUiG3aQy-DDBL7WrAq3Wb6IF6UOyZe2BYWZC4wYE"}
2024-10-30 14:02:01.897 DEBUG (MainThread) [alexapy.alexalogin] Failed to register capabilities
2024-10-30 14:02:02.104 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: session-id=261-3228378-6736322; Domain=.amazon.de; expires=25 Oct 2044 13:02:02 GMT; Path=/; Secure
2024-10-30 14:02:02.104 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: ubid-acbde=262-1718474-0352457; Domain=.amazon.de; expires=25 Oct 2044 13:02:02 GMT; Path=/; Secure
2024-10-30 14:02:02.104 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: x-acbde=D4iESD9M7VIm9P0kKUMjK9mqmgon579R; Domain=.amazon.de; expires=25 Oct 2044 13:02:02 GMT; Path=/; Secure
2024-10-30 14:02:02.104 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: at-acbde=Atza|IwEBIGxoE_bHn8sZJxtvz3Akdl4OI60JD2CfMhMqS_uK5oPL9_QiypUnLnH-TfDDl7I9AjMe04TScY1-MwozyVfP3Z_H_oIucLIjDjn9prNnDzrVRYT96k5xZslWtc0C6SM0dGtZ-Wra4zd5rCW-uRx4JfklwkgaAuk40VhMYYOSEMNcMLjmXA7AQdo-_-mfSCgjt0UnTeedOI1sT0KtKBe7Vqi-KOLIizN8Jy6yJtcjn7ROB9I7UG15T4q6xscyzf9qsr8nx147Tr8dHqMc0oCV7DWHON0p2Sl-HzOdEPRC-Ap8WFJ0GxE67veEkCAbqQd0q40qFqXdiLFmyWCGS5-i9UdSU3prhjUO3cnzVIQI72Zx29rI6AQjEoVHtjyJdFC_HAERUqu_Gdi4z3CRwVVUZ8u7; Domain=.amazon.de; expires=31 Oct 2024 13:02:02 GMT; HttpOnly; Path=/; Secure
2024-10-30 14:02:02.105 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: sess-at-acbde="ot3msLVOJ7iNgkE9wuoFyWuf0Sm7SPXNEWJBOJClMSI="; Domain=.amazon.de; expires=31 Oct 2024 13:02:02 GMT; HttpOnly; Path=/; Secure
2024-10-30 14:02:02.105 INFO (MainThread) [alexapy.alexalogin] Exchanged refresh token for 5 .amazon.de cookies: ['session-id', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde']
2024-10-30 14:02:02.105 DEBUG (MainThread) [alexapy.alexalogin] CSRF already exists; no need to discover
2024-10-30 14:02:02.105 DEBUG (MainThread) [alexapy.alexalogin] Session cookies for 'https://alexa.amazon.com/api/bootstrap': ['JSESSIONID', 'session-id', 'session-id-time', 'lc-main', 'ubid-main', 'session-token', 'x-main', 'at-main', 'sess-at-main', 'csrf']
2024-10-30 14:02:02.414 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.com/api/bootstrap returned 200:OK with response <CIMultiDictProxy('Content-Type': 'application/json', 'Content-Length': '175', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:02 GMT', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'x-amz-rid': 'RYZ6Y3032KNFNYRMC6X8', 'x-amzn-ActionTrace': 'amzn1.tr.71889385-3e87-11e6-99f3-0a51a1b50200.451.MxMH1F.SrZ=@P', 'x-amzn-RequestId': 'RYZ6Y3032KNFNYRMC6X8', 'x-amzn-alt-domain': 'https://alexa.amazon.de/logout', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 b628053fca1386b0c2ba37163842b26e.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P1', 'X-Amz-Cf-Id': 'OTr629u9wdY3bVTuBQS44oE008Ud8hvyUutyXqEBYn6Ly7oyqeVfsA==')>
2024-10-30 14:02:02.415 DEBUG (MainThread) [alexapy.alexalogin] Session cookies for 'https://alexa.amazon.de/api/bootstrap': ['JSESSIONID', 'session-id', 'session-id-time', 'lc-main', 'ubid-main', 'session-token', 'x-main', 'at-main', 'sess-at-main', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde', 'csrf']
2024-10-30 14:02:02.573 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.de/api/bootstrap returned 200:OK with response <CIMultiDictProxy('Content-Type': 'application/json', 'Content-Length': '175', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:02 GMT', 'Strict-Transport-Security': 'max-age=0; includeSubDomains;', 'x-amz-rid': 'G7ETPFSM2WVKR4R9NFNN', 'x-amzn-ActionTrace': 'amzn1.tr.96e4e334-3e87-11e6-842a-0a51a1ab0200.537.kLoNTR.pDIkiK', 'x-amzn-RequestId': 'G7ETPFSM2WVKR4R9NFNN', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 7f4a5e86662d54d3fe35c4c143a928ce.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P4', 'X-Amz-Cf-Id': 'afsLZ9NJeDk5niwrUJNIAK1M1e96YEgH3IrWQnz7HM0fTExlUd1xoQ==')>
2024-10-30 14:02:02.573 DEBUG (MainThread) [alexapy.alexalogin] Logged in as some.email@anywhere.com to amazon.de with id: A1MM33BQBRI847
2024-10-30 14:02:02.735 DEBUG (MainThread) [alexapy.alexalogin] Domain amazon.de matches reported account domain: amazon.de
2024-10-30 14:02:02.735 DEBUG (MainThread) [alexapy.alexalogin] Login confirmed for some.email@anywhere.com - amazon.de; saving cookie to /config/.storage/alexa_media.some.email@anywhere.com.pickle
2024-10-30 14:02:02.736 DEBUG (MainThread) [custom_components.alexa_media] Testing login status: {'login_successful': True}
2024-10-30 14:02:02.736 DEBUG (MainThread) [custom_components.alexa_media] Setting up Alexa devices for j***********n@g****e
2024-10-30 14:02:02.736 DEBUG (MainThread) [custom_components.alexa_media] include: 
2024-10-30 14:02:02.736 DEBUG (MainThread) [custom_components.alexa_media] exclude: 
2024-10-30 14:02:02.737 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: HTTP2 created: <alexapy.alexahttp2.HTTP2EchoClient object at 0x7f59fe560320>
2024-10-30 14:02:02.737 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: HTTP2push successfully connected
2024-10-30 14:02:02.737 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: Creating coordinator
2024-10-30 14:02:02.737 DEBUG (MainThread) [custom_components.alexa_media] j***********n@g****e: Refreshing coordinator
2024-10-30 14:02:02.737 DEBUG (MainThread) [alexapy.alexahttp2] Starting message parsing loop.
2024-10-30 14:02:02.737 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|EwICIGwTJxB94mMNQCfiQ_xNr1r0RdTO_XOEwwBmMOQtY2nu4pRS49aWwlEOsuK4ZMBt66qWxeZ0ujUEuVPu0plc9wfbJG3edkbJJCQiWDN-Ces-AWVoKaRk6JWbT-FBL8VzICEhmHWccXOzeBJA969uoRT6_Um7o-6GfxrWN-Pn04EqoqhsfSsLwWA0qkCfotIeaEfKEH69wAD2ws29oM7cKPtRC7E7bmZRvrvExZJ7-W0erl7X4vXbXz9Oa0o77sTjBUAbvuX5QSsMyTt9BQa8DP3G4E-jq7Hd1OELuUj3had5RFqTakpeMPRB_k5B8xW8e5efxkclh_VPws50wJqx2Os6bzMGUiG3aQy-DDBL7WrAq3Wb6IF6UOyZe2BYWZC4wYE'}
2024-10-30 14:02:02.737 DEBUG (MainThread) [alexapy.alexahttp2] Preparing ping to https://alexa.eu.gateway.devices.a2z.com/ping
2024-10-30 14:02:02.738 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: Detected access token expiration; refreshing
2024-10-30 14:02:02.788 DEBUG (MainThread) [alexapy.alexalogin] refresh response <ClientResponse(https://api.amazon.de/auth/token) [200 OK]>
<CIMultiDictProxy('Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:02 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '1023', 'Connection': 'keep-alive', 'x-amz-rid': '5TF6T4H7S8T1Y3AVFV7J', 'x-amzn-RequestId': '17502d93-5ea2-4d36-b732-289f58090355', 'X-Amz-Date': 'Wed, 30 Oct 2024 13:02:02 GMT', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload')>
 with 
{"app_name": "Alexa Media Player", "app_version": "2.2.556530.0", "di.sdk.version": "6.12.4", "source_token": "Atnr|EwICIEvC-vYAa9lbnlCihj1HYSKhAzBachMRMFyc-yV3KMSpk0ZMKbmVm-wY-wwW-M3k47SZWNPidVSnNbxWn5q1Y-mYbXjyTokSLJP8dCJcZCM9T6i2eqhSJbUKTUaY_r17EDDQB9QWspdeXXMisOYBfHBW5G22CuNNgL3iRI7LnyfTQSQrGkkVGoZw3h6jqzA3EGLGgMMafc2PXn_UwdX5RAHN92MPnhsbqltjjP_Rpk7U3Bmskt2ZDlN88XTXyHEfhbvfNtdQNmSz6V7Ht-Mq2Cvqz5afbjgUg-hjvgGAsRcsWHi4Ch8JsCtya9X1J2KJDRBLi9mbQFJH3W_wbQHGgjSJP-o72XJUI5D8Yp9IAlagbtw1EfeGPTASi3GLZS6JUa1KVZEZfhVrY3WVH6ZcuGrK", "package_name": "com.amazon.echo", "di.hw.version": "iPhone", "platform": "iOS", "requested_token_type": "access_token", "source_token_type": "refresh_token", "di.os.name": "iOS", "di.os.version": "16.6", "current_version": "6.12.4", "previous_version": "6.12.4"}
2024-10-30 14:02:02.788 DEBUG (MainThread) [alexapy.alexalogin] Successfully refreshed access_token(417) which expires at 2024-10-30 15:02:02.788780 in 0:59:59.999990
2024-10-30 14:02:02.854 DEBUG (MainThread) [alexapy.alexahttp2] Received raw message: Unable to authenticate the request. Please provide a valid authorization token.
2024-10-30 14:02:02.854 DEBUG (MainThread) [alexapy.alexahttp2] HTTP2 login error: Unable to authenticate the request. Please provide a valid authorization token.
2024-10-30 14:02:02.854 DEBUG (MainThread) [alexapy.alexalogin] Attempting to register with amazon.de
2024-10-30 14:02:02.929 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: session-id=261-3228378-6736322; Domain=.amazon.de; expires=25 Oct 2044 13:02:02 GMT; Path=/; Secure
2024-10-30 14:02:02.929 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: ubid-acbde=262-1718474-0352457; Domain=.amazon.de; expires=25 Oct 2044 13:02:02 GMT; Path=/; Secure
2024-10-30 14:02:02.929 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: x-acbde="Ot7ThXvOHFTWMgNqi5iMZH5bMK@yfwo4"; Domain=.amazon.de; expires=25 Oct 2044 13:02:02 GMT; Path=/; Secure
2024-10-30 14:02:02.929 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: at-acbde=Atza|IwEBIFr05tjG08AWY-ShOZtf7Vyfv7KLzsIMJvND_zuSmkd2ofrwYQWKKpu2PKsg9xsk1z8BFoEPjmpnAWXaqXZ_qEiZSED1tBgxDzq1Act10LlN30uk3bM2y-ohlk7pfiBELorbk55O-76vUPPCZ78irvV4DWKZYOp1GUpfHyX1v7GTPHahb_sDj1XCIh8a_rm2l1hO2zBXH1n_M8reC37Luy3qHLWt_XdQvfOZphJzl8Y9KfseocsZpGSoDGJxzt-YmKVTkVlAhVS36RBwskIZHl3tgAcmsdrKZyT6lrrRrSYR9U6w9n_hfbpKw9qcEMON5tNzp4T0P_FOJZ21S8BORkydto4AjIb9N-rfYmk9TKhGArIgGl-1Mz54lMi1bwseJkQWCEaPNIvxh5vjgcPWEVws; Domain=.amazon.de; expires=31 Oct 2024 13:02:02 GMT; HttpOnly; Path=/; Secure
2024-10-30 14:02:02.929 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: sess-at-acbde="VEJwbdFVhEVGGIkmi2e61ScKBre5erNnyGAx7GSspxM="; Domain=.amazon.de; expires=31 Oct 2024 13:02:02 GMT; HttpOnly; Path=/; Secure
2024-10-30 14:02:02.929 INFO (MainThread) [alexapy.alexalogin] Exchanged refresh token for 5 .amazon.de cookies: ['session-id', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde']
2024-10-30 14:02:02.930 DEBUG (MainThread) [alexapy.alexalogin] CSRF already exists; no need to discover
2024-10-30 14:02:02.930 DEBUG (MainThread) [alexapy.alexalogin] Login confirmed for some.email@anywhere.com - amazon.de; saving cookie to /config/.storage/alexa_media.some.email@anywhere.com.pickle
2024-10-30 14:02:02.999 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-30 14:02:03.000 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 0.2s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-30 14:02:03.042 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/bootstrap returned 200:OK:application/json
2024-10-30 14:02:03.080 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/devices-v2/device returned 200:OK:application/json
2024-10-30 14:02:03.107 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/dnd/device-status-list returned 200:OK:application/json
2024-10-30 14:02:03.231 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-30 14:02:03.231 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 1.5s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-30 14:02:03.415 DEBUG (MainThread) [alexapy.alexalogin] auth response <ClientResponse(https://api.amazon.de/auth/register) [200 OK]>
<CIMultiDictProxy('Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:03 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '5741', 'Connection': 'keep-alive', 'x-amz-rid': 'GY9AXHM2E9DZNZSG0F02', 'x-amzn-RequestId': '2266c9d1-604e-418b-b45f-61f137d8137a', 'X-Amz-Date': 'Wed, 30 Oct 2024 13:02:03 GMT', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload')>
 with 
{"requested_extensions": ["device_info", "customer_info"], "cookies": {"website_cookies": [], "domain": ".amazon.de"}, "registration_data": {"domain": "Device", "app_version": "2.2.556530.0", "device_type": "A2IVLV5VM2W81", "device_name": "%FIRST_NAME%'s%DUPE_STRATEGY_1ST%Alexa Media Player", "os_version": "16.6", "device_serial": "7d8f4ed2ab54eb2daf331dd667774cce", "device_model": "iPhone", "app_name": "Alexa Media Player", "software_version": "1"}, "auth_data": {"access_token": "Atna|EwICIPdLuH-PhpB5ofc98y-lQ_PKqvIMxSZcCZ66-9voYUcRab9Z4W5niaSdVBej_1Vr9zBfr2rRfasINjjxzM1zMfgOadsKrfdRj7T0NJsxNV0XNo4ZT6sxBugWYT624oVy0pMvsSY89c_MYp3icJN_uqWxAP-XtFiehlI0liy0i0JADRSTP_JO5MAWuw4oR0GSi5uuGgog9OMZYl7GQjYPwFoKAJ5pyl2HY1lpnF12Z9L9yVA27vBuoSHWtARhvUMgZoqyt4GGE6cmSYgWAooC8oQMd-AgNHhB-FO6n7oXPUDsukQuMeb0MKSGdtdG1AtZXBDCMEZvQ3wiubaKSuNXYnaaArsMXBfJqFoN_uyEDFi2LkO_Nb2ZJl9eeQYwSULZe4rVFVzodrIpuJ5rL_gBIzZu"}, "user_context_map": {"frc": "b6qgwyhP9QdX84Jnz3rCeRe/puNA2JzXjxcDysqbdh/hNKlvjkC1GJrpY/Rdv5wj5piYr82min6zENqEKP6I++uRm6a57Pf8z+wNINLirnUcKq1TIz3YBE9Bc51oPH40zGSH+NxIdmc2b56qvz0vY55WBQVuWdcCxl73NS9OErdNFge4J4naKwHIrVYeib8YUSsyMJtRRcwxs8rFFyc5/BDZoLouCMC60B4G6Hvsvt237xkV8mI7dbRHJj6lrEvNRP7K1KE0Sm8lEnPwAvhbyh9QjSgfjGsrwM6MNwDO32/75YJ3b1j0FPMIbGDuFVuCyC3LnBmh2ik82tEpYfw+OoiihZ11Eqv/6XBJ3blqFIafFvXJfezKlK63LziRvl1jwpyOrRf67j/Ij03Rc9PHKzGRN9JU67AcsQ"}, "requested_token_type": ["bearer", "mac_dms", "website_cookies"]}
2024-10-30 14:02:03.415 DEBUG (MainThread) [alexapy.alexalogin] Successfully registered Jörg's Alexa Media Player device with Amazon
2024-10-30 14:02:03.415 DEBUG (MainThread) [alexapy.alexalogin] New access token(353) received which expires at 2024-10-30 15:02:03.415645 in 0:59:59.999991
2024-10-30 14:02:03.423 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/bluetooth?cached=false returned 200:OK:application/json
2024-10-30 14:02:03.505 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/device-preferences returned 200:OK:application/json
2024-10-30 14:02:03.807 DEBUG (MainThread) [alexapy.alexalogin] capabilities response <ClientResponse(https://api.amazonalexa.com/v1/devices/@self/capabilities) [204 No Content]>
<CIMultiDictProxy('Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:03 GMT', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload', 'x-amz-rid': '1WBXKK82E85JNF6SDC5S', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 c9b630de734c38e36e97554a32ac1a68.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P4', 'X-Amz-Cf-Id': 'cTjbhG0KEyIhDKY9kf3TRJUt4eR-QULklIyOIzQVcICif11HYVzJ4w==')>
 with 
{"legacyFlags": {"SUPPORTS_COMMS": true, "SUPPORTS_ARBITRATION": true, "SCREEN_WIDTH": 1170, "SUPPORTS_SCRUBBING": true, "SPEECH_SYNTH_SUPPORTS_TTS_URLS": false, "SUPPORTS_HOME_AUTOMATION": true, "SUPPORTS_DROPIN_OUTBOUND": true, "FRIENDLY_NAME_TEMPLATE": "VOX", "SUPPORTS_SIP_OUTBOUND_CALLING": true, "VOICE_PROFILE_SWITCHING_DISABLED": true, "SUPPORTS_LYRICS_IN_CARD": false, "SUPPORTS_DATAMART_NAMESPACE": "Vox", "SUPPORTS_VIDEO_CALLING": true, "SUPPORTS_PFM_CHANGED": true, "SUPPORTS_TARGET_PLATFORM": "TABLET", "SUPPORTS_SECURE_LOCKSCREEN": false, "AUDIO_PLAYER_SUPPORTS_TTS_URLS": false, "SUPPORTS_KEYS_IN_HEADER": false, "SUPPORTS_MIXING_BEHAVIOR_FOR_AUDIO_PLAYER": false, "AXON_SUPPORT": true, "SUPPORTS_TTS_SPEECHMARKS": true}, "envelopeVersion": "20160207", "capabilities": [{"version": "0.1", "interface": "CardRenderer", "type": "AlexaInterface"}, {"interface": "Navigation", "type": "AlexaInterface", "version": "1.1"}, {"type": "AlexaInterface", "version": "2.0", "interface": "Alexa.Comms.PhoneCallController"}, {"type": "AlexaInterface", "version": "1.1", "interface": "ExternalMediaPlayer"}, {"type": "AlexaInterface", "interface": "Alerts", "configurations": {"maximumAlerts": {"timers": 2, "overall": 99, "alarms": 2}}, "version": "1.3"}, {"version": "1.0", "interface": "Alexa.Display.Window", "type": "AlexaInterface", "configurations": {"templates": [{"type": "STANDARD", "id": "app_window_template", "configuration": {"sizes": [{"id": "fullscreen", "type": "DISCRETE", "value": {"value": {"height": 1440, "width": 3200}, "unit": "PIXEL"}}], "interactionModes": ["mobile_mode", "auto_mode"]}}]}}, {"type": "AlexaInterface", "interface": "AccessoryKit", "version": "0.1"}, {"type": "AlexaInterface", "interface": "Alexa.AudioSignal.ActiveNoiseControl", "version": "1.0", "configurations": {"ambientSoundProcessingModes": [{"name": "ACTIVE_NOISE_CONTROL"}, {"name": "PASSTHROUGH"}]}}, {"interface": "PlaybackController", "type": "AlexaInterface", "version": "1.0"}, {"version": "1.0", "interface": "Speaker", "type": "AlexaInterface"}, {"version": "1.0", "interface": "SpeechSynthesizer", "type": "AlexaInterface"}, {"version": "1.0", "interface": "AudioActivityTracker", "type": "AlexaInterface"}, {"type": "AlexaInterface", "interface": "Alexa.Camera.LiveViewController", "version": "1.0"}, {"type": "AlexaInterface", "version": "1.0", "interface": "Alexa.Input.Text"}, {"type": "AlexaInterface", "interface": "Alexa.PlaybackStateReporter", "version": "1.0"}, {"version": "1.1", "interface": "Geolocation", "type": "AlexaInterface"}, {"interface": "Alexa.Health.Fitness", "version": "1.0", "type": "AlexaInterface"}, {"interface": "Settings", "type": "AlexaInterface", "version": "1.0"}, {"configurations": {"interactionModes": [{"dialog": "SUPPORTED", "interactionDistance": {"value": 18, "unit": "INCHES"}, "video": "SUPPORTED", "keyboard": "SUPPORTED", "id": "mobile_mode", "uiMode": "MOBILE", "touch": "SUPPORTED"}, {"video": "UNSUPPORTED", "dialog": "SUPPORTED", "interactionDistance": {"value": 36, "unit": "INCHES"}, "uiMode": "AUTO", "touch": "SUPPORTED", "id": "auto_mode", "keyboard": "UNSUPPORTED"}]}, "type": "AlexaInterface", "interface": "Alexa.InteractionMode", "version": "1.0"}, {"type": "AlexaInterface", "configurations": {"catalogs": [{"type": "IOS_APP_STORE", "identifierTypes": ["URI_HTTP_SCHEME", "URI_CUSTOM_SCHEME"]}]}, "version": "0.2", "interface": "Alexa.Launcher"}, {"interface": "System", "version": "1.0", "type": "AlexaInterface"}, {"interface": "Alexa.IOComponents", "type": "AlexaInterface", "version": "1.4"}, {"type": "AlexaInterface", "interface": "Alexa.FavoritesController", "version": "1.0"}, {"version": "1.0", "type": "AlexaInterface", "interface": "Alexa.Mobile.Push"}, {"type": "AlexaInterface", "interface": "InteractionModel", "version": "1.1"}, {"interface": "Alexa.PlaylistController", "type": "AlexaInterface", "version": "1.0"}, {"interface": "SpeechRecognizer", "type": "AlexaInterface", "version": "2.1"}, {"interface": "AudioPlayer", "type": "AlexaInterface", "version": "1.3"}, {"type": "AlexaInterface", "version": "3.1", "interface": "Alexa.RTCSessionController"}, {"interface": "VisualActivityTracker", "version": "1.1", "type": "AlexaInterface"}, {"interface": "Alexa.PlaybackController", "version": "1.0", "type": "AlexaInterface"}, {"type": "AlexaInterface", "interface": "Alexa.SeekController", "version": "1.0"}, {"interface": "Alexa.Comms.MessagingController", "type": "AlexaInterface", "version": "1.0"}]}
{"User-Agent": "AmazonWebView/Amazon Alexa/2.2.556530.0/iOS/16.6/iPhone", "Accept-Language": "en-US", "Accept-Charset": "utf-8", "Connection": "keep-alive", "Content-type": "application/json; charset=UTF-8", "authorization": "Bearer Atna|EwICIKWTKd-UdBVMjbEjerOIfanDUXtYdaP2_emoJ_2qWwqPtfpCp2YfYMAxvjVaz9plvvavV-rmAiODGGyEledctAe55J4xDAE8dpIjGn1vIEmCCGgqj34xpRmEhc-omcT6OVzyiciKBpK9uvBCUQbcP8UtMSiossl2SC3081SNxh-S4j_XeRPGjkjtw0iePF_5D0KITTvt39G1dzU9F4_jbxmc3WrMtbnGNbEQ1BwSYb5yromYACUe9zimz_dLmV_9VyjO1zBexHhyxwLUGY-FVbgTJqgTGPyLK3w9z7VgSt979CWfbQYhb3xNEnie2_1AWgmUwysTSLFhSu9LFQ_kckhU"}
2024-10-30 14:02:03.958 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: session-id=261-3228378-6736322; Domain=.amazon.de; expires=25 Oct 2044 13:02:03 GMT; Path=/; Secure
2024-10-30 14:02:03.958 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: ubid-acbde=262-1718474-0352457; Domain=.amazon.de; expires=25 Oct 2044 13:02:03 GMT; Path=/; Secure
2024-10-30 14:02:03.958 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: x-acbde="8WhRsd0z?01jipnh?Zm1w3x8RRnwSIQ9"; Domain=.amazon.de; expires=25 Oct 2044 13:02:03 GMT; Path=/; Secure
2024-10-30 14:02:03.958 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: at-acbde=Atza|IwEBIA-xvf1zRYbgcdaWajDogOzHnp-oHMlDRuU_sXsSmTsJnfdaquirpmu8BLTkYXD1QJ6hb4IE9JribVQ6fpSXCbfK2fDGPFOnP-dTsEU0KzIKqlkrt7QPypRe2lepO8JFSgVIFn2B_GrOaJxgf92Z5xY_1l7NkGUxwF-Jnl2YK1ZJLFliOHAY0ebgu-tfF0an3yw3cuNNgFXXWWN5_3DoKv25Xl5ln45LuOhYKSzVP0EbEixxnvY8AobTYAhNrc1ZJv6LVrdsEPk_C2rBdNP2TesuOpXpVnPovUrSn5j-2FqDGVPg0s9FJHP2cmf9CDCSWIwOR3DAS0f_NBb0NhuKcfqw9iUmbCwYGEZcBAFH3IrE1_zdSYxR1JBtr8EhdNcTMfshCAuiF38twM8YF0rIsucN; Domain=.amazon.de; expires=31 Oct 2024 13:02:03 GMT; HttpOnly; Path=/; Secure
2024-10-30 14:02:03.958 DEBUG (MainThread) [alexapy.alexalogin] updating jar with cookie Set-Cookie: sess-at-acbde="4bfJNl1JPHnP1YovX2yf+fH2P89Y3pQ5je/bTahvWBs="; Domain=.amazon.de; expires=31 Oct 2024 13:02:03 GMT; HttpOnly; Path=/; Secure
2024-10-30 14:02:03.958 INFO (MainThread) [alexapy.alexalogin] Exchanged refresh token for 5 .amazon.de cookies: ['session-id', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde']
2024-10-30 14:02:03.959 DEBUG (MainThread) [alexapy.alexalogin] CSRF already exists; no need to discover
2024-10-30 14:02:03.959 DEBUG (MainThread) [alexapy.alexalogin] Session cookies for 'https://alexa.amazon.com/api/bootstrap': ['JSESSIONID', 'session-id', 'session-id-time', 'lc-main', 'ubid-main', 'session-token', 'x-main', 'at-main', 'sess-at-main', 'csrf']
2024-10-30 14:02:04.217 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.com/api/bootstrap returned 200:OK with response <CIMultiDictProxy('Content-Type': 'application/json', 'Content-Length': '175', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:04 GMT', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'x-amz-rid': 'A61QAP5HNA27ZQYDPAGK', 'x-amzn-RequestId': 'A61QAP5HNA27ZQYDPAGK', 'x-amzn-alt-domain': 'https://alexa.amazon.de/logout', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 b628053fca1386b0c2ba37163842b26e.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P1', 'X-Amz-Cf-Id': 'DKYq28sCb3l19VOqHnlDAvxHX-mbeROxW1L47bT6ocwFIffSiXCbqQ==')>
2024-10-30 14:02:04.217 DEBUG (MainThread) [alexapy.alexalogin] Session cookies for 'https://alexa.amazon.de/api/bootstrap': ['JSESSIONID', 'session-id', 'session-id-time', 'lc-main', 'ubid-main', 'session-token', 'x-main', 'at-main', 'sess-at-main', 'ubid-acbde', 'x-acbde', 'at-acbde', 'sess-at-acbde', 'csrf']
2024-10-30 14:02:04.311 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://alexa.amazon.de/api/bootstrap returned 200:OK with response <CIMultiDictProxy('Content-Type': 'application/json', 'Content-Length': '175', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Wed, 30 Oct 2024 13:02:04 GMT', 'Strict-Transport-Security': 'max-age=0; includeSubDomains;', 'x-amz-rid': '14DG4YXPA1CV9DANFTHG', 'x-amzn-RequestId': '14DG4YXPA1CV9DANFTHG', 'Vary': 'Content-Type,Accept-Encoding,User-Agent', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 7f4a5e86662d54d3fe35c4c143a928ce.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DUS51-P4', 'X-Amz-Cf-Id': 'fBbwbz2Rsj84RDK7PxI-lWCLGUU86EVUVBFqgdNiiXXnCEUfydIrlQ==')>
2024-10-30 14:02:04.312 DEBUG (MainThread) [alexapy.alexalogin] Logged in as some.email@anywhere.com to amazon.de with id: A1MM33BQBRI847
2024-10-30 14:02:04.427 DEBUG (MainThread) [alexapy.alexalogin] Domain amazon.de matches reported account domain: amazon.de
2024-10-30 14:02:04.428 DEBUG (MainThread) [alexapy.alexalogin] Login confirmed for some.email@anywhere.com - amazon.de; saving cookie to /config/.storage/alexa_media.some.email@anywhere.com.pickle
2024-10-30 14:02:04.429 DEBUG (MainThread) [alexapy.alexahttp2] HTTP2 Connection Closed.
2024-10-30 14:02:04.811 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-30 14:02:04.811 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 3.2s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-30 14:02:08.113 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-30 14:02:08.113 INFO (MainThread) [alexapy.alexaapi] Backing off _static_request(...) for 2.7s (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-30 14:02:10.879 DEBUG (MainThread) [alexapy.alexaapi] j***********n@g****e: static GET: https://alexa.amazon.de/api/phoenix returned 429:Too Many Requests:application/json
2024-10-30 14:02:10.879 ERROR (MainThread) [alexapy.alexaapi] Giving up _static_request(...) after 5 tries (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)
2024-10-30 14:02:10.879 WARNING (MainThread) [alexapy.helpers] alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f59fee9e060>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyTooManyRequestsError occurred. Arguments:
('Too Many Requests',)
2024-10-30 14:02:10.879 WARNING (MainThread) [alexapy.helpers] alexaapi.get_network_details((<alexapy.alexalogin.AlexaLogin object at 0x7f59fee9e060>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyTooManyRequestsError occurred. Arguments:
('Too Many Requests',)
2024-10-30 14:02:10.880 ERROR (MainThread) [custom_components.alexa_media] Error fetching alexa_media data: Error communicating with API: Too Many Requests
2024-10-30 14:02:10.880 DEBUG (MainThread) [custom_components.alexa_media] Finished fetching alexa_media data in 8.143 seconds (success: False)

@srescio
Copy link
Contributor

srescio commented Oct 30, 2024

@Traders-Banquet sorry but what did you do again exactly? 😅

If you restarted your home assistant from UI that will not wipe previous alexapy cached in the container, please check these steps, you need to run the core rebuild command in the supervisor terminal

@Traders-Banquet
Copy link
Author

Traders-Banquet commented Oct 30, 2024

First I edited the manifest.json
vi /config/custom_components/alexa_media/manifest.json and swapped alexaapi==1.29.3 with alexapy.git@5e500d107a0f6f01343c0d52243a66150885f769
then I did the pip install alexapy.git@5e500d107a0f6f01343c0d52243a66150885f769
logout and did the ha core rebuild
which he successfully did. And the result is in the debug log above.

Last I relogin into the supervisor terminal and go to /usr/local/lib...../alexaapy and check this too ...

@srescio
Copy link
Contributor

srescio commented Oct 30, 2024

The version in the manifest must contain the full URL to the branch, check this example

Also, the pip install is not needed if you do the core rebuild because doing that the docker container is destroyed and all temp resources, eg the previously downloader deps are lost, so manifest resources are downloaded anew with no risk of version conflict

@srescio
Copy link
Contributor

srescio commented Oct 30, 2024

i just noticed that in your log are present 401 errors before hitting the too many requests, so I suspect my fix could resolve this issue as well 🤞🏻

@Traders-Banquet
Copy link
Author

Traders-Banquet commented Oct 30, 2024

This is the manifest.json that I changed :

{
  "domain": "alexa_media",
  "name": "Alexa Media Player",
  "codeowners": ["@alandtse", "@keatontaylor"],
  "config_flow": true,
  "dependencies": ["persistent_notification", "http"],
  "documentation": "https://github.com/alandtse/alexa_media_player/wiki",
  "iot_class": "cloud_polling",
  "issue_tracker": "https://github.com/alandtse/alexa_media_player/issues",
  "loggers": ["alexapy", "authcaptureproxy"],
  "requirements": ["alexapy@git+https://gitlab.com/srescio/alexapy.git@5e500d107a0f6f01343c0d52243a66150885f769", "packaging>=20.3", "wrapt>=1.14.0"],
  "version": "4.13.6"
}

@Traders-Banquet
Copy link
Author

Traders-Banquet commented Oct 31, 2024

Hmm I inserted my manifest.json to show that I inserted the whole path but the Problem still exist with my last Logfile as the result. @srescio I think my manifest.json is as you would expect, am I right ? Then the problem did not solve my Problems :

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.alexa_media
Quelle: helpers/update_coordinator.py:386
Integration: Alexa Media Player (Dokumentation, Probleme)
Erstmals aufgetreten: 00:43:41 (2 Vorkommnisse)
Zuletzt protokolliert: 08:21:48

Error fetching alexa_media data: Error communicating with API: Too Many Requests

and :

Logger: alexapy.helpers
Quelle: runner.py:189
Erstmals aufgetreten: 00:43:41 (4 Vorkommnisse)
Zuletzt protokolliert: 08:21:48

alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f66a7f22a20>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyTooManyRequestsError occurred. Arguments: ('Too Many Requests',)
alexaapi.get_network_details((<alexapy.alexalogin.AlexaLogin object at 0x7f66a7f22a20>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyTooManyRequestsError occurred. Arguments: ('Too Many Requests',)
alexaapi.get_guard_details((<alexapy.alexalogin.AlexaLogin object at 0x7f66aded8bc0>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyTooManyRequestsError occurred. Arguments: ('Too Many Requests',)
alexaapi.get_network_details((<alexapy.alexalogin.AlexaLogin object at 0x7f66aded8bc0>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyTooManyRequestsError occurred. Arguments: ('Too Many Requests',)

and :

Logger: alexapy.alexaapi
Quelle: runner.py:189
Erstmals aufgetreten: 00:43:41 (2 Vorkommnisse)
Zuletzt protokolliert: 08:21:48

Giving up _static_request(...) after 5 tries (alexapy.errors.AlexapyTooManyRequestsError: Too Many Requests)

@... and I never said that it works

@srescio
Copy link
Contributor

srescio commented Oct 31, 2024

Try the released AMP version, i flagged the issue as related because among logs there were also 401 errors so i imagined the retry mechanism with back off cap at 5 may be triggered because calls where not login refreshed

I d suggest giving a cooldown of 12 or 24h (not sure what timing alexa servers use) before reconnecting it even with the new version,

If after that issue still persist do reopen this issue, which will then require further investigation

@srescio
Copy link
Contributor

srescio commented Oct 31, 2024

Yes the manifest is correct though there is no way to confirm from that alone nor the logs that it is picking that version vs the previous as in my branch i did not change the version number as that is managed by CI at release time so we re not supposed to hard code it in the source...we probably need to add some kind of utility in AMP to make it log out something like the alexapy lockfile hash so that we can check this in a reliable way

@Traders-Banquet
Copy link
Author

Is your fix part of the new release ?

@srescio
Copy link
Contributor

srescio commented Oct 31, 2024

Yeah there is the pr link mention above, which links to the alexapy edits

@Traders-Banquet
Copy link
Author

OK, I deactivated the alexa_media_player integration and will wait for one day. Maybe it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants