joeyhage / homebridge-alexa-smarthome

Connect Alexa devices to HomeKit
MIT License
82 stars 20 forks source link

Initial Configuration Issue - Alexa Login URL 404 Error #40

Closed blinkhappy closed 1 year ago

blinkhappy commented 1 year ago

Describe Your Problem:

I have not been able to make it through the Initial configuration of this Homebridge Plugin. After successfully installing the Plugin in Homebridge, I entered my Proxy Client Host and selected a Proxy port as well as amazon domain. I then entered the URL found in my Homebridge log. This took me to an Amazon page with the text “404 Sorry, we couldn’t find that page. Don’t have the app installed? Download the Alexa App (link). Go to the Alexa App (link)”

This is clearly not the Amazon login page that I was intended to land on. Is there anything you can think of that I’m doing wrong?

In step

I’m trying to configure this Alexa Homebridge Plugin.

Logs:

17/09/2023, 13:36:52] [HomebridgeAlexasmartHome] Failed to initialize connection to Alexa. You can try to get the cookie manually by opening http://Homebridge. local: 8887/ with your brow ser. [17/09/2023, 13:36:521 [HomebridgeAlexaSmartHomelAfter initialization - HttpError(Error getti ng smart home devices. Reason: Cookie invalid, Renew unsuccessful) [17/09/2023, 13:36:52] Homebridge v1.6.1 (HAP v0. 11.1) (Homebridge 649C) is running on port 51 876.

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

{ "devices": [], "auth": { "refreshInterval": 4, "proxy": { "clientHost": "Homebridge.local", "port": 8887 } }, "amazonDomain": "amazon.com", "language": "en-US", "performance": { "cacheTTL": 30, "backgroundRefresh": false }, "debug": false, "platform": "HomebridgeAlexaSmartHome" } ]

Screenshots: image

Environment:

joeyhage commented 1 year ago

Hi @blinkhappy, have you tried the instructions in the common issues section yet?

Stef1972 commented 1 year ago

same problem trying to autenticate at amazon.it I tryed to delete persist/.homebridge-alexa-smarthome but the file doesn't exist in the persistent directory

joeyhage commented 1 year ago

To confirm, you installed the Alexa app and logged in to the same account on the app, you have MFA enabled on your account, and then you restarted homebridge?

Stef1972 commented 1 year ago

Yes I did.

I logged in the home bridge.local:9000, I received the OTP, then I received a 'page not found' error. I did that on my mobile where the Alexa app is installed and logged with the same user I used for the plugin

joeyhage commented 1 year ago

Is it the same 404 as before or a new 404 page? Sometimes trying to load the page again (homebridge.local:9000 in your case) works

joeyhage commented 1 year ago

You might also have better luck using a desktop computer to access homebridge.local:9000. It’s just the login expects the Alexa app installed somewhere 😃

Stef1972 commented 1 year ago

I tried form my mac and it did the same. IMG_5018

Stef1972 commented 1 year ago

http://homebridge.local:9000/www.amazon.com/404

joeyhage commented 1 year ago

What country are you located in? Have you tried a different Amazon domain than Amazon.com?

Stef1972 commented 1 year ago

it seems I'm all able to access if I use amazon.com, but every time I restart home bridge I loose the configuration

Stef1972 commented 1 year ago

18/09/2023, 17:16:19] [homebridge-alexa-smarthome] Failed to initialize connection to Alexa. - Error while checking Authentication: Error: 401 Unauthorized [18/09/2023, 17:16:19] [homebridge-alexa-smarthome] After initialization - HttpError(Error getting smart home devices. Reason: 401 Unauthorized)

Stef1972 commented 1 year ago

at this point the homebridge.local:9000 page is not accessible. That means that if I restarted Hombrigre I need to restart it again, doing the authentication process to have the accessories discovered

joeyhage commented 1 year ago

You should only need to do it once if you have MFA enabled on your account and if you see the successful message.

joeyhage commented 1 year ago

As soon as it is successful, it saves the information to the persist file for the next time so make sure you don’t delete that file once it’s successful

Stef1972 commented 1 year ago

yes, but sadly the file in the persist directory dosn't exist and it neve has been created

joeyhage commented 1 year ago

Since it starts with a period, it sometimes doesn’t show up unless you ls -Al

Stef1972 commented 1 year ago

true. The file is there. So why I need to authenticate every time ? I can also add this information. If I choose amazon.it it ask me for the OTP and then it says error 404 If I choose amazon.com just after the user and password it says Cookie successfully retrieved without asking me the otp

joeyhage commented 1 year ago

It depends on the Alexa marketplace your account is registered with. You can check in the app settings:

IMG_4997

IMG_4998

Stef1972 commented 1 year ago

eu-api-alexa.amazon.it alexa.amazon.it

Stef1972 commented 1 year ago

other strange thing is: i have 3 echo dots. One of them is not on the list of the accessories in the account (i enabled the debug flag, and it shows the list of the accessories)

joeyhage commented 1 year ago

Ok so you should definitely use Amazon.it. I would say delete that file, change to Amazon.it, and restart homebridge. If you see a 404, then go to homebridge.local:9000 again and try again (don’t delete file or restart)

joeyhage commented 1 year ago

If it’s not showing, it maybe is associated with another account as primary, is disabled, might be in kids mode, a number of things can cause that. You could try removing it and adding it to your account again

joeyhage commented 1 year ago

@blinkhappy were you able to resolve the issue?

blinkhappy commented 1 year ago

Yes. Not sure what changed to make it work but thanks for getting back to me.

On Wed, Sep 20, 2023 at 10:23 PM Joey Hage @.***> wrote:

@blinkhappy https://github.com/blinkhappy were you able to resolve the issue?

— Reply to this email directly, view it on GitHub https://github.com/joeyhage/homebridge-alexa-smarthome/issues/40#issuecomment-1728708572, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2AJJZGJIM3CZZM5OC3OALX3OXJ3ANCNFSM6AAAAAA43467BU . You are receiving this because you were mentioned.Message ID: @.***>