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

OAuth token timeout #12

Closed
andywaplinger opened this issue Apr 22, 2022 · 9 comments
Closed

OAuth token timeout #12

andywaplinger opened this issue Apr 22, 2022 · 9 comments

Comments

@andywaplinger
Copy link

Hi, I just tried to use this plugin and I'm getting this error in my log:
Screen Shot 2022-04-22 at 10 47 18

Any idea on what I can do to fix this? I've double checked my email/password and they're correct. Thanks!

@derek-miller
Copy link
Owner

The genie API is pretty flaky. Is it consistently doing this or is this the first time you are trying it?

@andywaplinger
Copy link
Author

I've restarted Homebridge multiple times, so it's doing this consistently.

@derek-miller
Copy link
Owner

Hmm I just tried to reproduce it and it works for me. Is it possible anything in your network might be blocking certain outbound requests?

@andywaplinger
Copy link
Author

Weird, I don't block outbound requests on any of my devices, so I doubt it's something like that.

Is the name supposed to be something specific from my Aladdin account? Or is that what I want it to say within Homebridge?

@derek-miller
Copy link
Owner

Can you give me some more info about your setup? See https://github.com/derek-miller/homebridge-genie-aladdin-connect/blob/master/.github/ISSUE_TEMPLATE/bug-report.md for context.

@andywaplinger
Copy link
Author

One thing to note is that I was using the other Aladdin Homebridge plugin homebridge-aladdin-connect-garage-door but I disabled it after I installed your plugin. I'm happy to delete it entirely as a next step if there are no other debugging options.

Describe The Bug: OAuth login timeout

To Reproduce: Installed plugin, filled in login fields, restarted Homebridge

Expected behavior: Log into Aladdin and display garage doors in Apple Home

Logs (can provide more, but I don't see any errors or possible issues with other plugins in the logs):

[4/22/2022, 10:40:24 AM] [Garage Doors] [API] An error occurred getting oauth token; timeout of 5000ms exceeded
[4/22/2022, 10:40:24 AM] [Garage Doors] [API] An error occurred getting devices from account; timeout of 5000ms exceeded
[4/22/2022, 10:40:24 AM] [Garage Doors] Failed to load doors from account; skipping discovery

Plugin Config:

{
    "bridge": {
        "name": "Homebridge",
        "username": "[REDACTED]",
        "port": 51409,
        "pin": "[REDACTED]"
    },
    "description": "AW Home",
    "platforms": [
        {
            "name": "Config",
            "port": 8080,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "name": "Harmony Hub",
            "hubIP": "[REDACTED]",
            "DELAY_BEFORE_RETRY_AFTER_NETWORK_LOSS": 60000,
            "HUB_CONNECT_TIMEOUT": 10000,
            "HUB_SEND_TIMEOUT": 30000,
            "cleanCache": false,
            "TVAccessory": true,
            "sortInput": 3,
            "mainActivity": "Watch Apple TV",
            "activitiesToPublishAsInputForTVMode": [
                "Watch Apple TV",
                "Listen to Sonos",
                "Turn on Minilith",
                "Play Xbox",
                "Play PS3",
                "Listen to Media Room Sonos",
                "Turn on Apfel TV Sonos"
            ],
            "showTurnOffActivity": "false",
            "publishGeneralVolumeSlider": false,
            "publishGeneralVolumeSwitches": false,
            "devicesToPublishAsAccessoriesSwitch": [
                "LG TV|TV"
            ],
            "otherPlatforms": [
                {
                    "sortInput": 0
                }
            ],
            "platform": "HarmonyHubWebSocket"
        },
        {
            "units": "us",
            "interval": 5,
            "stations": [
                {
                    "service": "openweathermap",
                    "key": "[REDACTED]",
                    "locationGeo": [
                        [REDACTED],
                        [REDACTED]
                    ],
                    "locationCity": "[REDACTED]",
                    "language": "en",
                    "compatibility": "home",
                    "nameForecast": "Today",
                    "conditionCategory": "simple",
                    "now": true,
                    "extraHumidity": false,
                    "hidden": [
                        "Air Pressure",
                        "Dew Point",
                        "Humidity",
                        "Rain",
                        "Temperature Min",
                        "Temperature Apparent",
                        "UV Index",
                        "Wind Direction",
                        "Wind Speed"
                    ],
                    "tresholdCloudCover": 75,
                    "tresholdUvIndex": 5,
                    "tresholdWindSpeed": 15
                }
            ],
            "platform": "WeatherPlus"
        },
        {
            "platform": "RFButtons",
            "pin": 2,
            "debounceDelay": 200,
            "buttons": [
                {
                    "name": "Power Off",
                    "codes": [
                        [REDACTED]
                    ]
                },
                {
                    "name": "Guest Power On",
                    "codes": [
                        [REDACTED]
                    ]
                },
                {
                    "name": "Guest Power Off",
                    "codes": [
                        [REDACTED]
                    ]
                }
            ]
        },
        {
            "platform": "EufySecurity",
            "username": "[REDACTED]",
            "password": "[REDACTED]",
            "ignoreStations": [
                "[REDACTED]"
            ],
            "ignoreDevices": [
                "[REDACTED]",
                "[REDACTED]",
                "[REDACTED]"
            ],
            "enableCamera": true,
            "pollingIntervalMinutes": 30,
            "hkHome": 47,
            "hkAway": 47,
            "hkNight": 47,
            "hkOff": 47,
            "enableDetailedLogging": 0
        },
        {
            "name": "Sonos",
            "alarms": false,
            "brightness": true,
            "nameScheme": "%",
            "service": "light",
            "speakers": true,
            "platform": "ZP"
        },
        {
            "platform": "ZPS1"
        },
        {
            "name": "Garage Doors",
            "username": "[REDACTED]",
            "password": "[REDACTED]",
            "batteryLowLevel": 15,
            "userInfoCacheTtl": 3600,
            "doorStatusStationaryCacheTtl": 15,
            "doorStatusTransitioningCacheTtl": 10,
            "doorStatusPollInterval": 30000,
            "logApiResponses": true,
            "platform": "GenieAladdinConnect"
        }
    ],
    "accessories": [
        {
            "accessory": "Plex",
            "name": "Plex",
            "plex_token": "[REDACTED]",
            "host": "[REDACTED]",
            "filter": [
                {
                    "player": "Media Room"
                }
            ]
        },
        {
            "name": "Roomba",
            "model": "960",
            "blid": "[REDACTED]",
            "robotpwd": "[REDACTED]",
            "ipaddress": "[REDACTED]",
            "dockContactSensor": true,
            "runningContactSensor": true,
            "binContactSensor": true,
            "dockingContactSensor": true,
            "homeSwitch": true,
            "stopBehaviour": "pause",
            "accessory": "Roomba2"
        },
        {
            "name": "Homebridge Netatmo Rain Sensor",
            "deviceType": "Switch",
            "netatmoUsername": "[REDACTED]",
            "netatmoPassword": "[REDACTED]",
            "netatmoClientId": "[REDACTED]",
            "netatmoClientSecret": "[REDACTED]",
            "pollingInterval": 60,
            "slidingWindowSize": 30,
            "cooldownInterval": 0,
            "rainSensorSerial": "[REDACTED]",
            "accessory": "homebridge-plugin-netatmo-rain-sensor"
        },
        {
            "name": "Raining Now",
            "stateful": true,
            "reverse": false,
            "time": 60000,
            "resettable": true,
            "accessory": "DummySwitch"
        },
        {
            "name": "Mercedes",
            "username": "[REDACTED]",
            "password": "[REDACTED]",
            "status_update_delay": "25",
            "poll_state_delay": 30,
            "device_number": 1,
            "garage_number": 3,
            "log_polling": true,
            "accessory": "AladdinConnectGarageDoorOpener"
        },
        {
            "name": "M3",
            "username": "[REDACTED]",
            "password": "[REDACTED]",
            "status_update_delay": "25",
            "poll_state_delay": 30,
            "device_number": 1,
            "garage_number": 1,
            "log_polling": true,
            "accessory": "AladdinConnectGarageDoorOpener"
        }
    ],
    "disabledPlugins": [
        "homebridge-magichome-dynamic-platform",
        "homebridge-plex-v2",
        "homebridge-aladdin-connect-garage-door"
    ]
}

Screenshots: In first post

Environment:
Plugin Version: v2.1.4
Homebridge Version: v1.4.0
Node.js Version: v16.14.2
NPM Version: v6.14.15
Operating System: Raspbian GNU/Linux Buster (10)

@derek-miller
Copy link
Owner

Are there any logs surrounding the snippet you pasted above? Im looking for warnings about other plugins which might be slowing down homebridge and causing it to fail. Nodejs uses cooperative concurrency control for its promises so another plugin could block longer than the configured timeout in my plugin. You could test this by disabling the other plugins such that only the genie plugin is running.

@andywaplinger
Copy link
Author

Welp, I feel like an idiot. I just restarted my Pi and your plugin is now working no problem. So much for troubleshooting 101 😆

I really appreciate your help! And I'm super happy to be moving to your plugin from the other one. Thank you!

@derek-miller
Copy link
Owner

No worries! Glad you figured it out. Let me know if you hit any other issues.

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

2 participants