Haaska Echo Error

Hi All,

So I followed @brusc Echo/Haaska video and completed each step and managed to get the skill to show up in my Alexa app, but when I test the Lamda function I get the following error:

Discovery failed: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: //********.duckdns.org:8123/api/states (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f09c3232f10>: Failed to establish a new connection: [Errno -2] Name or service not known',))'

Any ideas as to why the connection is being refused? I can access the duckdns remotely and on my home network. I have also tried the local host url, but received the same error. Thank you!

It looks like it’s trying to communicate on port 80 instead of port 443; ALexa skills require an SSL connection.

Did you set up SSL on your HA server?

I did not. So if I set up Let’s Encrypt via the tutorial, will the Alexa skill automatically pick it up that it should be looking at port 443 or do I need to change something in my skill? Thank you!

You will have to set up SSL first, then set up the appropriate port forwarding on your router. When you go to https://yourdomain.duckdns.org, your router should forward that traffic to your internal IP address for HA at the proper port; for example:

Traffic to 443 (SSL) port -> 192.168.1.100:8123

Then go back and adjust your Alexa Skill and Lambda setup to the new URL (https://yourdomain.duckdns.org) and you should be good. My experience was that setting up Let’s Encrypt was harder than setting up the Alexa side, but you can always ask for help here!

Great! Sounds like the Let’s Encrypt was the missing piece of the puzzle. Hopefully it works, as pot forwarding is hit or miss on my router. When you set up your Let’ Encrypt, did you follow @brusc video on the subject or did you just follow the documentation? Thanks again for the help!

Both, Actually - I followed Ben’s video mostly but he is missing a few things; you’ll notice this as you go through each step in the form and there are a few things he forgot to mention. If you just do what he says, you’ll end up with errors. But they’ll be obvious and you’ll see that they will be filled out on his video but missing in your setup screens from Amazon. If you pause the video for each page and make it full screen, you can see what’s missing.

I wrote about most of this in this post, which may help you out a bit:

Awesome! Thank you so much! I’ll let you know how everything goes

Hello I have been working in an Error similar to this one and cant figure it out and hoping someone can help

Discovery failed: HTTPSConnectionPool(host=‘xxxxx.duckdns’, port=443): Max retries exceeded with url: /api/states (Caused by NewConnectionError(’<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f79ac458690>: Failed to establish a new connection: [Errno -2] Name or service not known’,)).

I also followed @brusc Echo/Haaska video and completed each step and gave permissions to 755
forwarded port 443 to myHA-ip port 8123 I can login with no problems
Thanks

Did you set up a dynamic dns provider? Can you get to your site from the outside by using https:// with your domain name and NO PORT. That’s important; if your forwarding is set up correctly, then you should be able to get to you HA login page with your hostname as https://yourcoolname.duckdns.org.

@rpitera yes I set up a duckdns.org account and I can connect to https with out the port, that is what is stumping me.

I’ll have to do a little research; I used Haaska very briefly and it was a long time ago.

For a letsencrypt/duckdns Home Assistant setup, you need to copy

/etc/ssl/certs/ca-certificates.crt

to the Haaska config dir and include it in the config.json file

“ha_cert”: “ca-certificates.crt”

@x140x1n do I have to add it to config.json then re-zip and re-upload it?

yes you do, keeping it local won’t have any impact on the Alexa skill.

@x140x1n ok updated the json config and haaska config as you said but not I cant log in at all I backed it up before so I may be ok.

ok I got it back running updated again now I get this error

{
“errorMessage”: “module initialization error”
}

module initialization error: Expecting , delimiter: line 5 column 5 (char 122)

the only other thing in the config.json file is this
“ha_allowed_entities”: [“group”, “input_boolean”, “light”, “media_player”, “scene”, “script”, “switch”]
do I need to remove it.

You could leave it out since you don’t have a difference with the default.
Could you show me the complete contents of the config file?

@x140x1n the only thing I added was the “ha_cert”: “ca-certificates.crt” the rest was in by defalt

{
“ha_url”: “https://my.duckdns:443/api”,
“ha_passwd”: “mypassword”,
“ha_cert”: “ca-certificates.crt”
“ha_allowed_entities”: [“group”, “input_boolean”, “light”, “media_player”, “scene”, “script”, “switch”]
}

Thanks

You forgot a comma after the ha_cert line.

it should be

“ha_cert”: “ca-certificates.crt”,

Ok back at it today I was able to get this,

Execution result: succeeded

this morning.
But in the log I got this

Discovery failed: HTTPSConnectionPool(host=‘xxxxx.duckdns’, port=443): Max retries exceeded with url: /api/states (Caused by NewConnectionError(’<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe841184690>: Failed to establish a new connection: [Errno -2] Name or service not known’,))

It is almost the same as before.