joeyhage / homebridge-alexa-smarthome

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

Cookie Session / Connection Issue #51

Closed DMontgomery40 closed 6 months ago

DMontgomery40 commented 9 months ago

Issue:

I've been trying to get the Homebridge Alexa Smart Home plugin to work but have run into issues with cookie authentication. I've tried multiple ports, enabled 2FA on Alexa, and restarted everything multiple times.

Homebridge Logs:

``` [HomebridgeAlexaSmartHome] Failed to initialize connection to Alexa. - You can try to get the cookie manually by opening http://192.168.86.40/8581:7280/ with your browser. [HomebridgeAlexaSmartHome] After initialization - HttpError(Error getting smart home devices. Reason: Cookie invalid, Renew unsuccessful) ```

Plugin Config:

```json { "devices": [], "auth": { "refreshInterval": 4, "proxy": { "clientHost": "http://192.168.86.40/8581", "port": 7280 } }, "amazonDomain": "amazon.com", "language": "en-US", "performance": { "cacheTTL": 300, "backgroundRefresh": true }, "debug": true, "platform": "HomebridgeAlexaSmartHome" } ```

Screenshots: (None)

Environment:

joeyhage commented 9 months ago

Hi @DMontgomery40, your clientHost is invalid. It should be 192.168.86.40

DMontgomery40 commented 9 months ago

Hi @joeyhage,

First of all, thank you for your quick response. I've made some progress based on your suggestions, but unfortunately, I'm still facing issues with the initialization.

Configuration

Here's my current config for reference:

{
  "devices": [],
  "auth": {
    "refreshInterval": 4,
    "proxy": {
      "clientHost": "192.168.86.40",
      "port": 9000
    }
  },
  "amazonDomain": "amazon.com",
  "language": "en-US",
  "performance": {
    "cacheTTL": 15,
    "backgroundRefresh": true
  },
  "debug": true,
  "platform": "HomebridgeAlexaSmartHome"
}

Log Output

Below are the logs that I'm getting:

[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Initializing HomebridgeAlexaSmartHome platform...
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Login required because existing authentication not found
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Alexa-Remote: No cookie given, generate one
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Alexa-Remote: Error from retrieving cookies
[10/10/2023, 8:42:23 PM] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge D517) is running on port 51747.
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Failed to initialize connection to Alexa. - You can try to get the cookie manually by opening http://192.168.86.40:9000/ with your browser.
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Alexa-Remote: Authentication check Error, try re-init
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Alexa-Remote: No cookie given, generate one
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Alexa-Remote: Error from retrieving cookies
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] Alexa-Remote: Authentication check Error and renew unsuccessful. STOP
[10/10/2023, 8:42:23 PM] [HomebridgeAlexaSmartHome] After initialization - HttpError(Error getting smart home devices. Reason: Cookie invalid, Renew unsuccessful)

I would appreciate any guidance or suggestions you can offer to resolve this issue.

Best regards, David

zeev-mindali commented 8 months ago

have the same issue: [16/10/2023, 08:16:46] [homebridge-alexa-smarthome] Failed to initialize connection to Alexa. - You can try to get the cookie manually by opening http://192.168.68.55:9000/ with your browser. [16/10/2023, 08:16:46] [homebridge-alexa-smarthome] After initialization - HttpError(Error getting smart home devices. Reason: Cookie invalid, Renew unsuccessful)

it's look like there is no cookie

after succesful login, getting in the browser the url : http://192.168.68.55:9000/www.amazon.com/404

joeyhage commented 8 months ago

@zeev-mindali The common issues section in the README has a section on Alexa login issues. Can you please follow all of those steps and see if that resolves the issue?

dltacube commented 8 months ago

Is that why port selection is a slider? To make sure users don't accidentally pick their homebridge's port? If so, that's hiliarous!

joeyhage commented 6 months ago

Closing due to no response