Need help configuring Alexa

Hi,

though I don’t own an Echo yet, I thought I’d play a little with the HA integration of Alexa.
Unfortunately, I’m currently stuck setting it up as I only get a HTTP 401 Unauthorized error when calling “/api/alexa?api_password=sEcR3t”.

Just to be sure: the api_password parameter is the HA web interface password, i.e. this one:

http:
  api_password: 12345

right?

I enabled the alexa component like shown in the docs:

alexa:
  intents:
    LocateIntent:
      action:
        service: notify.notify
        data_template:
          message: The location of {{ User }} has been queried via Alexa.
      speech:
        type: plaintext
        text: '{{ User }} is Home'
      card:
        type: simple
        title: Sample title
        content: Some more content

I then set up a demo skill on the AWS dashboard.
When trying to test it, I see the 401 unauthorized error in the webserver logs.
What am I missing?

TIA,
Sebastian

PS: My HA installation is behind an apache reverse proxy, in case this matters…

Oh, ignore that - I just got it workig.
The problem was a requirement within the proxy configuration.

Sebastian

1 Like

Would be great if you could share your apache reverse proxy config here. IIRC someone had a similar problem and I was not able to help as I use nginx instead of apache.

~Cheers

I had a Require user xyz directive in the config that was not satisfied when the api was called.
To solve this, I added another user for those api calls to the config and the url in the skill config.
I doubt that my specific proxy access restrictions would be of help to anyone else but me.

My reverse proxy config (minus the access restrictions) looks like this now:

<VirtualHost xxx.xxx.xxx.xxx:443>
        ServerName 		hass.example.com
        DocumentRoot	/var/www/html
 
        SSLEngine On
        SSLCertificateFile			[...]
        SSLCertificateKeyFile		[...]
        SSLCertificateChainFile		[...]
        SSLCACertificateFile		[...]

        ProxyPass				/api/websocket  ws://127.0.0.1:8123/api/websocket retry=0
        ProxyPassReverse		/api/websocket  ws://127.0.0.1:8123/api/websocket
        ProxyPass				/				http://127.0.0.1:8123/ retry=0
        ProxyPassReverse		/				http://127.0.0.1:8123/
        ProxyPreserveHost		On
        RewriteEngine			On
</VirtualHost>

Sebastian

1 Like