Alexa with Home Assistant Local for FREE Without Subscription

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

If you have a hue hub, search emulated hue. Much easier and no aws. You can find them for ~$20 on eBay if you don't have them.

👍︎︎ 3 👤︎︎ u/Nebakanezzer 📅︎︎ Nov 23 2020 🗫︎ replies

why do people not edit out the A word in videos where they know people would have one?

seems like common courtesy and pretty obvious at this point.

👎

👍︎︎ 6 👤︎︎ u/flargenhargen 📅︎︎ Nov 24 2020 🗫︎ replies

Really good video thanks!

👍︎︎ 2 👤︎︎ u/eoinyyyy 📅︎︎ Nov 23 2020 🗫︎ replies

Not really "local" control here. You installation will still require talking to Amazon cloud servers.

👍︎︎ 2 👤︎︎ u/richumd 📅︎︎ Nov 24 2020 🗫︎ replies
Captions
alexa let's make a video okay [Laughter] there seems to be a lot of confusion when it comes to alexa and google home within home assistant a lot of people seem to think that these two voice apps just aren't compatible with a local home assistant instance and that you have to use the cloud version of home assistant to get them working and that's just not true both of these will work perfectly fine with home system i would know i've got both of them integrated and have been using them for a while to be fair to the people that think they aren't compatible i will admit it's not exactly an easy process for either of these two voice assistants to add them to home assistant but that's just the nature of these cloud devices i guess but today we're going to be running through how to add alexa to your local home assistant instance with no cloud required if you want me to do the same process for the google home i'd be happy to do that just let me know in the comments down below but today we're covering alexa and i will forewarn you it's not exactly a straightforward process it's not just a click of a button to add alexa there is quite a few steps to go through but if you follow the video through you should be able to get it up and working in probably about 20 minutes i do want to mention that if you're not comfortable doing these steps then you can use the home assistant cloud option which costs five dollars per month and that money goes towards funding the home assistant project and the developers and i would highly encourage you to do that if you can afford to do so the process for setting up alexa and google home on there is a much straightforward process but for those of you feeling a little bit adventurous let's waste no more time and just jump straight into the guide all right always keep hydrated okay so to get started there's a few things we're going to need the first thing is to sign up for an aws account it's free and it just takes a couple of seconds you'll also need to sign up for an alexa developer account which you can find over on this link here you'll also need access to your home assistant instance and that is about it so once you've signed up for your aws account you'll land at the aws management console and then the first thing i'm going to do is to type into this box and search for i am and click on the i am drop down then we're going to head over to roles and we're going to create a new role this is going to be for an aws service and it's going to be for the lambada service so click on the lambda service and click on next in the permissions we want to search for lambda and we're going to start we're going to um take the lambda basic execution role and click on next we can skip this one by clicking next and we'll give this a name so i'm just going to call this home assistant lambda click on create rule to finish that and now you'll see we have our new role created next head over to the alexa developer console and we're going to create a new skill so create your skill and in the skill name i'm just going to name this home assistant and we're going to click on the smart home scale and click on provision your own and then back up at the top click on create skill so we're going to leave this page open and we're going to head back to the aws console click on um the aws account in the top left one important step you'll need to do is to set your region to one of the supported regions for alexa skills and that is ireland if you are in the eu us east north virginia if you are in the u.s or canada and u.s west oregon if you are in australia or japan i'm going to select the ireland one because i'm in the eu and then from there in the services we're going to search for lambda click on the lambda and then in the top right we're going to create a new function we'll take the create from scratch and give it a name of home assistant and then in the runtime select the python 3.7 and change the default execution role to the one that we just created earlier so we'll select use an existing role and then in the drop down you'll see that home assistant lambda role that we created earlier select that and then create function and then the lambda sort of builder is going to show up and then that is going to allow us to put in our code that is going to interact with home assistant click on the add trigger and then in the trigger type we're going to select the alexa smart home no no no no i don't know that so we select the smart home and then in the application id click back over to your developer console and then we're going to grab this unique skill id that's um up at the top here so click on the copy button and go back to the lambda and paste that into the application id click on add once you've added in the trigger then select the home assistant lambda function and scroll down to the code box we're going to get rid of all this default code i'm going to copy some code in from github and i'll have that linked in the description down below so you can find it head back to the code and then paste in that code from github then after pasting in that code we're going to head back up to the top and click on the deploy button and that gives us a message that the um code was successfully deployed we're then going to create a test event to link our alexa account to home assistant click on the select a test event and click on configure test events create a new event and we're going to call this a discover or discovery and then get rid of the default values we're going to paste in some code and again i'll have this linked in the description so you can find it copy that and then paste it into the code box and click on the create button from there we're going to need to add a couple of values into the home assistant configuration so head over to your home assistant instance and edit the config file inside your config file there is just two lines we need to add to the alexa configuration and that is the alexa line and then on the line underneath indented we're going to add smart home and then make sure to add the colon at the end go ahead and restart your home assistant instance after of course checking your config file next we're going to run the test that we just created from the lambda function in the last step so click on the test button and that is actually going to fail because we haven't we haven't added in our base url into the environment variables so if we click on details you can see that the error message says that we haven't set our base url and so we can do that by heading down to the environment variables and clicking on edit we're going to add a new environment variables add base url as the key and then in the value you need to enter the url for your externally available home assistant instance so you need to make sure to have something like duct dns or cloudflare or something that allows you to have home assistant available outside of your home so if we go ahead and enter the home assistant url for my one and make sure to enter the https at the start as well as the port at the end click on the save button and then we're going to head back up to the top and click on the test again this time it should succeed but as you can see it's giving us an invalid credentials and that's because we haven't created a long access token for aws so we'll go and generate a token in home assistant and we'll come back and we'll tell the lambda function what that token is so head back to your home assistant instance and then click on your profile and scroll down to the very bottom click on create token and then we're going to give this token a name of alexa click on ok and it's going to generate a very long random string copy this whole value and click on ok and head back to the alexa developer console sorry head back to your aws console click on the test drop down and click on configure test events in the type bearer token we're gonna we're gonna add a new line so put a comma at the end and then in quotes enter token and then open quotes again and paste in that value that we just copied click on save and this time if we run the test again you'll see it has actually succeeded and it's pulling through um some of the values from or all of the devices from home systems we've got my whole pirs um and if we scroll down there'll be a whole ton of other um so there's my fingerprint sensor etc etc it's got all of my devices now listed in the um test there so we can close that and then we are now done in this page the only thing we need to do is to copy the arn from the top so click on the copy and that's this unique value here so copy that head back to our alexa developer console in the default endpoint paste in that value that we just created and we can then click the save button and that is now saved and then we can head down to the account linking don't take any of these options up at the top but we do need to enter a couple of values at the bottom in the web authorization uri we're going to enter the url of your home assistant instance that is available external make sure of course to enter your port at the end so i'm using port 8123 and we also want to enter slash off slash authorize oh next on the token uri is going to be the exact same except the end value is going to be slightly different so make sure to enter the port again and then enter auth token for the client ids we're going to actually grab this value down from the bottom if you're using the australia or the japan um region like we discussed earlier you'll want to grab this one at the top if you're using the us region you want to grab this middle one and if you're using the eu region you want to grab the bottom one make sure to only grab up to the third forward slash so up to dot com forward slash copy that and then paste that into the id if you're using the us region you would grab this part and if you're using the um australia japan region you would grab up to this part paste that into the box up here and then in the secret we can enter anything we want it's not used and then in the drop down click on credentials in request body for the scope this isn't actually used at the moment but the home system developer says it would allow them to use it in the future so we just go ahead and enter smart underscore home in here and then that is everything we need to create in here up at the top click on save now we can head over to the alexa app in ios or android and then we can just finalize the setup and add all of our devices into alexa okay so inside the alexa app click on your skills and then head if we slide over at the top you'll find that we have one dev skill pending and you'll click on that and you'll see that home assistant is now waiting for us ready to be set up so click on that and click on enable to use and then it's going to pop up asking us to log in to home assistant and that's actually going to link our accounts to alexa and then what's going to happen when i click the next button is it's actually going to come up with an error and i'll tell you why that is so if we click on next oh it would help if i type the password right try again it's going to come up saying that it has failed to link our accounts so if we just wait for that so this might be a message that some of you have been experiencing and maybe haven't been able to get past so the way i was able to fix this if we click close on that and just back out and so the errors seem to stem from the use of port 8123 instead of the default port 443 for https so there are two ways you can get around this error the first one would be to obviously change your port from 8123 to port 443 some of you may already be using port 443 and in which case you probably had no issues with the previous step the second way i was able to fix this was to use a nat on my firewall to translate port 443 incoming to the firewall to port 8123 on the home assistant side you should be able to do this using your router but obviously i don't have access to every router to be able to show you how to do that i'll show you just how i did it in pf sense which is my firewall of choice so this rule at the top basically says anything that's coming in on my one or the public ip on port 443 translate that or send the traffic to my home assistant instance on this ip address and change the destination port to eight one two three once you've created your nat or changed your home assistant instance to use port 443 head back to your developer console and then take out the 8123 on the web authorization uri and the access token uri and then click on the save button and then this time when we head over to more and then skills and games click on your skills and then slide over to the dev skills you might need to come off the wi-fi temporarily just to get the account linking to work once you've done this you can reconnect your phone and that's just because um the network or the nat that we created earlier is only applying to external connections so once we've disconnected from the wi-fi click on enable to use and then that's going to then reload the home assistant page and we can enter our username and password click on next click on next and then this time it should come up with a message that the skill has been successfully linked to our alexa click on close and then it should pop up with all of this it should pop up with the discover devices option if we want to discover devices we can just do that now and you can see that she has now started giving us the blue circle to indicate that she is searching for devices and if we head over to the devices tab you'll see that we now have a list of everything in my house and so that is how to integrate home assistant with alexa you can see it is entirely possible to do it locally now of course you're free to create routines in the alexa app if you wish or you can just use it for normal voice control like you would with any other device and it should work with any device in home assistant but there we go guys hopefully you enjoyed this video and you can now integrate alexa into your home assistant instance and it was quite a fair bit of work to get integrated but i guess that's the nature of these cloud connected devices for you if you want me to cover the procedure for the google home make sure to let me know in the comments down below and while you're down there make sure to hit that like button and hit subscribe if you aren't already thank you all for watching and i will catch you in the next video
Info
Channel: Everything Smart Home
Views: 141,997
Rating: undefined out of 5
Keywords: alexa home assistant, home assistant, home automation, smart home, home assistant alexa, home assistant alexa guide, alexa guide, alexa nabu casa, home assistant alexa tutorial, home assistant local, hassio alexa, hassio local alexa
Id: Ww2LI59IQ0A
Channel Id: undefined
Length: 16min 6sec (966 seconds)
Published: Mon Nov 23 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.