Alexa Smart Home account linking

I keep going through all this info and still can’t get account linking to work. When I click “enable” in the Alexa Skill I’m brought to my Linksys router login page with a 404 error. I’m using DuckDNS with NGINX for the SSL. I have single port forwarding setup with external 443 forwarded to internal port 443 directed to my HA device IP address. This works fine logging into HA remotely via https. I’m sure it’s something simple I’m missing. I’ve tried changing internal port to 8123 thinking that may direct with no luck. On my NGINX “configuration” tab I have 444/tcp with 443 typed in and for the 80/tcp I have null typed in.

EDIT: Got things working after enabling forwarding of 8123 to 8123 and 80 to 80 forwarding to HA computer. While testing in the Lambda site worked and found devices, couldn’t get devices found after linking. Disabled skill and tried logging in again I’m getting “connection not private” error.

This got me further then I was, but it’s not working stable. Turning devices on and of works once, and then stops.
I followed the video from “Everything Smart Home” and then found this thread for the last bits.

Maybe my nginx isn’t up to spec? Can anyone guide me to the right settings?

Same issue for me in the EU zone (UK), when I tried linking my account it said “Error: invalid client id or redirect uri”. After enabling debug the logs showed “Authentication error” without much more information. I resolved it by just switching everything to the US servers and it worked like a charm.

I got it working just following this NOTE ( i’m using duckdns.org to access my HA):

Note: Account linking will not work if your home assistant installation is only reachable by port 8123 (e.g - https://myhainstall.com:8123) If you have home assistant configured this way, please use long lived tokens instead of account linking. Place your long lived token generated in your home assistant install in the double quotes TOKEN = “” .

In HA go to Profile, scroll to the bottome and under " Long-Lived Access Tokens" - create token and use it in lambda_function.py (and you do not need to do anything with account linking)

1 Like

Does anyone from Australia have this working? I’m getting the same Error: invalid client id or redirect uri although using https://alexa.amazon.co.jp/ as client id as per the instructions.

Well setting to the US one worked.

hey all, would love some help with this one. this has been workign for me for like a year until two days ago. Not sure what changed but I deleted everything and reinstalled and get the error regarding set up via oauth.

No clue what to do from here. Everything tests out with the Long LIved Access Token, but still cant link from the skill.

From my experience @bigverm23 it is a mismatch in the location, i.e. if the skill Client ID uses the US link the Amazon account your echo devices are registered under must be in the US too.

Thanks for the tip. Now it is working. I had the exact same issue as you.

I live in Norway - and I have the same problem as everyone else her. "Error: invalid client id or redirect uri” But when I changed the Client ID to the US server (https://pitangui.amazon.com/), then linking went fine, but it failed to discover any new devices.
I’m accessing my HA via an NGINX Reverse Proxy (everything is on the latest versions)
Has anyone got a solution to this problem?

Same problem here. I’m not using NPM.

I finally managed to solve my problem. Description here:

1 Like

I had the very same problem, I broke my head on it for 5 days, and I was doing the very same things, it started working only with port 443 and after I’ve deleted all in skill, and lambda, used english language in the skill properties and clean chrome and alexa cache in the smartphone.

I’ve been dealing with this for two days and i’m unable to make it work. The test code on Lambda works and returns my entities, but when i try to link the account it fails saying that it’s unable to link account, try again later.

I’m unable to forward port 443 to home assistant because my ISP blocks this port, so i need to use something else (i’m using 4443).

Also, i’m running hass behind a nginx proxy for SSL, because locally i access it using http only (as the iOS home assistant app has a lot of problems with invalid certificates, and the external domain url doesn’t work internally)

Everything works but account linking. Is there a way to make this work without account linking?

after a whole night up, i made the account linking process to work by using a Cloudflare Tunnel. But now, no device is being discovered by the skill, despite the fact that the Lambda test shows the devices.