joeyhage / homebridge-alexa-smarthome

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

Cannot log into Alexa account for first time setup #74

Open su37kk opened 7 months ago

su37kk commented 7 months ago

I am trying to setup this plugin but I do not ever get the Amazon login screen as shown in the setup instructions. I only ever get the webpage with the QR code that attempts to install the Alexa app. When I click on the "Go To Alexa App" button on that page, the Alexa app is brought to fore ground but then nothing happens. I tried to turn off JS and clear cookies as instructed in common-issues, but then localhost:7002 landing page says I need to turn on JS to it to work. So to summarize, I can neither login to Alexa using the credential dialog box in the browser nor login/get the cookie using the Alexa app.

Logs: [11/27/2023, 9:57:23 AM] [homebridge-alexa-smarthome] Failed to initialize connection to Alexa. - You can try to get the cookie manually by opening http://localhost:7002/ with your browser. [11/27/2023, 9:57:23 AM] [homebridge-alexa-smarthome] Alexa-Remote: Authentication check Error, try re-init [11/27/2023, 9:57:23 AM] [homebridge-alexa-smarthome] Alexa-Remote: No cookie given, generate one [11/27/2023, 9:57:23 AM] [homebridge-alexa-smarthome] Alexa-Remote: Error from retrieving cookies [11/27/2023, 9:57:23 AM] [homebridge-alexa-smarthome] Alexa-Remote: Authentication check Error and renew unsuccessful. STOP [11/27/2023, 9:57:23 AM] [homebridge-alexa-smarthome] After initialization - HttpError(Error getting smart home devices. Reason: Cookie invalid, Renew unsuccessful) [11/27/2023, 10:01:23 AM] [homebridge-alexa-smarthome] Updating device states [11/27/2023, 10:01:23 AM] [homebridge-alexa-smarthome] Alexa-Remote: Authentication check Error, try re-init [11/27/2023, 10:01:23 AM] [homebridge-alexa-smarthome] Alexa-Remote: No cookie given, generate one [11/27/2023, 10:01:23 AM] [homebridge-alexa-smarthome] Alexa-Remote: Error from retrieving cookies [11/27/2023, 10:01:23 AM] [homebridge-alexa-smarthome] Alexa-Remote: Authentication check Error and renew unsuccessful. STOP

Plugin Config: { "devices": [], "auth": { "refreshInterval": 4, "proxy": { "clientHost": "localhost", "port": 7002 } }, "language": "en-US", "performance": { "cacheTTL": 300, "backgroundRefresh": true }, "debug": true, "_bridge": { "username": "0E:81:E1:5D:A2:A5", "port": 41780 }, "platform": "HomebridgeAlexaSmartHome" }

Screenshots:

Environment:

joeyhage commented 7 months ago

It sounds like your Alexa app is not registered to the Amazon Alexa account you are trying to use with Homebridge. The QR code only comes up if you have never logged in to the Alexa app with your Alexa account.

su37kk commented 7 months ago

Hi @joeyhage thanks for responding but its still not clear to me what the issue is. 1. I am logged into the Alexa app with my Amazon account (the same CID that I use across all Amazon services) 2. "The QR code only comes up if you have never logged in to the Alexa app with your Alexa account." not sure what you mean here. I should be able to hit localhost:7002 from my computer browser and get to the Alexa login page like the instructions state right? That is not happening, it always shows the QR code(even when I am logged into the Amazon account ). This might help https://www.reddit.com/r/amazonecho/comments/16speat/the_alexa_web_interface_seems_to_be_gone_now/

joeyhage commented 7 months ago

Instead of localhost, can you please try using the private IP address of the device you are on? For example, 192.168.1.10.

you would need to change the proxy.clientHost homebridge setting for this plugin and then access it using the IP address.

source: https://github.com/Apollon77/ioBroker.alexa2/tree/master#i-get-a-page-shown-with-a-qr-code-telling-me-to-scan-it

su37kk commented 7 months ago

Thanks Joey, that got me past the QR code issue. But now after I successfully login in, Im encountering a new issue.

[12/6/2023, 2:38:42 PM] [homebridge-alexa-smarthome] Alexa-Cookie: MODIFIED Response Body to rewrite URLs [12/6/2023, 2:38:54 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Handle token registration Start: {"loginCookie":"X-OPENMEDIAVAULT-LOGIN-%242y%2410%24i1PZ38w3tzzh5igtQoYi9OhgHCLAfSWpW9abxOq.Pwgws8HZtKUHi=A large populace held in check by a small but powerful force is quite a common situation in our universe. And w... [12/6/2023, 2:38:54 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Register App [12/6/2023, 2:38:55 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Response (200) [12/6/2023, 2:38:55 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Register App Response: {"response":{"success":{"extensions":{"device_info":{"device_name":"Abilash's 4th Homebridge","device_serial_number":"95dc9c6635a1e52fa75861fa154eb2dd","device_type":"A2IVLV5VM2W81"},"customer_info":{"account_pool":"Amazon","us... [12/6/2023, 2:38:55 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Update Cookie x-main = "Kc84838SpkiMMcTERJTRnGzgCk5@q5tJ" [12/6/2023, 2:38:55 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Update Cookie at-main = "Atza|IwEBIFfXwy0s2PmBCsAhmPTG07yUyxvw-mflH-CoPmwU7rkbKJPytNp2omZqgjMAViZgSp8OBbvH9Zv0zNynl-7zUWJ2OrrSNTqqDzotwgKTlJnUIEvhUL-ljihncdCjoRaRC3BklfgosWVGN6oyEB_ncRkdJ_E9aEJa5dRZCFek2RBuI5eVAmwTRS65d8kR-Ued2MGLI6HNFS-7k7R5HPgxYUaNvl7rq1ShMErB078TXGUTkj6R3RBJAT9dxcsGUwQ8_jI1wl7NIirX7_wwz7q_QfwLfbRqjYHWEmcTlQsZM7qdwVqbNXigvc77g3Bo2WVziAS4ZKT9TU6saBbSzY-GAGIF" [12/6/2023, 2:38:55 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Update Cookie sess-at-main = "3MXzlFjHYA2+2cyjuz62z5VBH6+aN4j+9gwk0jh5ox0=" [12/6/2023, 2:38:55 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Register capabilities [12/6/2023, 2:38:55 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Response (204) [12/6/2023, 2:38:55 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Get User data [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Response (401) [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] Alexa-Cookie: Get User data Response: ""... [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] Alexa-Remote: Error from retrieving cookies [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] Failed to initialize connection to Alexa. - Unexpected end of JSON input [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] Alexa-Remote: Authentication check Error, try re-init [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] Alexa-Remote: No cookie given, generate one [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] Alexa-Remote: Error from retrieving cookies [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] Alexa-Remote: Authentication check Error and renew unsuccessful. STOP [12/6/2023, 2:38:56 PM] [homebridge-alexa-smarthome] After initialization - HttpError(Error getting smart home devices. Reason: Cookie invalid, Renew unsuccessful)

su37kk commented 6 months ago

Hi @joeyhage any insight on this new failure?

willryan042 commented 6 months ago

Instead of localhost, can you please try using the private IP address of the device you are on? For example, 192.168.1.10.

you would need to change the proxy.clientHost homebridge setting for this plugin and then access it using the IP address.

Just wanted to chime in that I had the same issue as OP (getting the QR code screen) and this solution worked perfectly for me. Thanks for the tip.

Gbrothers1 commented 4 months ago

I just want to add that i was also getting the QR code screen and after changing a bunch of settings and really shooting in the dark, i found out that you cant have more than one targett clientHost, mine was set to: "localhost, 192.168.1.213" and after changing it to just "192.168.1.213", the login screen appeared correctly. Thanks all for the help!