Getting Started with Home Assistant & Raspberry Pi: Install Add-ons, Control Lights

Getting Started with Home Assistant on Raspberry Pi

Did you ever wish that Google Assistant, Alexa, or Siri could let you have a smart home instead of some smart devices? What if you wake up to fresh coffee, get news played on TV, temperature-regulation done automatically at the time you set the alarm? How about automatically changing the room lighting, turning on some backlight on a monitor or panel, and making it relaxed when you play a movie?

 

Instead of trying to open different applications and making changes separately, you can do all this and even more with the Home Assistant platform easily. Yes, you read that correctly! Here is a small tutorial on how you can install and setup Home Assistant on Raspberry Pi.

 

Home Assistant: What is it?

Home Assistant is an open-source operating system for the Smart Home. It operates like IFTTT or Samsung Smart Things but is different in the sense that it's online, open-source, and a completely local alternative to things like HomeBridge and SmartThings. This means that it gives you control of home automation without the cloud. This results in smoother service, reliability, and better protection. Home Assistant also helps you in building complicated Scripts and Automations that blow other Smart Home platforms out of the water. It allows products from hundreds of manufactures and protocols to integrate seamlessly with DIY projects and homemade solutions.

 

Components Required

Hardware

  • Raspberry Pi
  • Micro SD Card
  • SD Card Reader

 

Software

  • Home Assistant Image
  • Balena Etcher

 

Installing Home Assistant on Raspberry Pi

Step 1: For installing Home Assistant on Raspberry Pi, first, download the appropriate Disk Image for Hass.io for your Raspberry Pi from the Home Assistant page. We will be using the Raspberry Pi 4B for this project.

 

Step 2: Then download balenaEtcher for flashing image file on Raspberry Pi. Etcher is a free and open-source utility that helps in burning image files such as .iso, .img files, and zipped folders to create live SD cards and USB flash drives.

balenaEtcher

 

Step 3: Once the installation is done, open the Etcher app. Etcher installs the operating system in three steps, the first step is to select the image. To select an image file, click on Select Image in Etcher and select the hassos image file. Then select the right SD card and click Flash.

balenaEtcher - Flash OS Images

The most reliable networking setup for your Raspberry Pi is to connect it using an Ethernet cable; however, if you want to configure Wi-Fi, you can try this.

 

Navigate to your SD card i.e. hassos boot and create a new folder called ‘CONFIG’. Now, inside the CONFIG folder, create a new folder called ‘network.’ Within the network folder, create a file named ‘my-network’ without a file extension and paste the lines given. Don’t forget to change the Wi-Fi name and password.

[connection]
id=my-network
uuid=72111c67-4a5d-4d5c-925e-f8ee26efb3c3
type=802-11-wireless
[802-11-wireless]
mode=infrastructure
ssid=MY_SSID
# Uncomment below if your SSID is not broadcasted
#hidden=true
[802-11-wireless-security]
auth-alg=open
key-mgmt=wpa-psk
psk=MY_WLAN_SECRET_KEY
[ipv4]
method=auto
[ipv6]
addr-gen-mode=stable-privacy
method=auto

 

Step 4: Now unmount the SD card, remove it from your card reader and insert it into Raspberry Pi. Connect your power supply to the Raspberry Pi. After a few minutes, you should be able to access Home Assistant from any device on the same local network. To access the home Assistant page, navigate to the browser, and type http://your-pi-ip-address:8123. It can take up to 20 minutes to install all the Home Assistant dependencies.

Install Home Assistant

 

Once the installation process is done, Raspberry Pi will auto reboot. After this, you will be asked to create a Home Assistant account. Enter a Name, User name, Password, and click on “Create Account”.

Setting up Home Assistant on the Raspberry Pi

 

Now on the next screen, you can enter the name for your project, set your location and unit system.

Home Assistant Dashboard

Finally, click on Finish. Now, you’re brought to the Home Assistant Dashboard. This screen will show all of your devices.

 

Installing Add-On’s

Home Assistant has several add-ons that you can install to get home assistant even better. We are going to install File Editor and SSH add-ons. You can also install other add-ons that you find useful.

 

Installing File editor

The File editor add-on allows you to browse and modify the files on your Pi. We will be using this add-on to modify the configuration.yaml files.

 

To install this add-on, click on Supervisor, and the go-to Add-on Store and install the File editor add-on.

Installing File editor

 

After the add-on has been installed, click start and enable the "Show in Sidebar" option.

File editor Add-On

 

Installing the Terminal & SSH add-on

Also, install the Terminal & SSH add-on. This add-on allows you to connect to your Raspberry Pi that is running Home Assistant over SSH. To install this add-on, go to the Supervisor tab, click on the upright corner icon, and search for Terminal & SSH. Click on the Install button and then Start the add-on.

Installing the Terminal & SSH Add-On

 

Controlling LED using Home Assistant

Now, we’re going to control an LED connected to Raspberry Pi GPIO through a home assistant to get familiar with adding components and building automation. We’re going to add switches to turn two LEDs on and off. Before we can connect LED, we need to configure the configuration.yaml file.

For that, go to https://home-assistant.io/components/ and search for ‘Raspberry Pi GPIO’.

Raspberry Pi GPIO

 

Now, on the Raspberry Pi GPIO page, copy the configuration code.

Raspberry Pi GPIO Configuration

 

Now, go to the File editor tab and click on the folder icon to browse the file system.

Set up Home Assistant with Raspberry Pi

 

Navigate to the configuration file located at /config/configuration.yaml and paste the code that you copied from the GPIO page.

Home Assistant Advanced Configuration

 

Once that's done, we can save changes by pressing the save icon.

Home Assistant Advanced Configuration

 

Every time after making a change to any of the files, first check that the configuration is valid, and then restart Home Assistant. To check the configuration, go to the tab Configuration, and select General, and click "CHECK CONFIG". If the syntax is correct, it will display a message "Configuration Valid". If not, it will show you a debug message showing where the error occurred that needs to be fixed. Once the configuration is valid, press "RESTART" under Server Management, and wait a minute for the changes to be applied.

Home Assistant Raspberry Pi 4

 

After restarting, go to your Home Assistant User Interface and you should see two new buttons labeled Fan Office and Light Desk.

Home Assistance with Raspberry Pi

 

Now, connect two LEDs to GPIO 11 and GPIO 12 of Raspberry Pi and click on those buttons to turn the LEDs on and off.

Raspberry Pi Home Automation

This is how you can install and setup Home Assistant on Raspberry Pi. Hope you’ve found this tutorial useful.

Video

90 Comments

Thank you for all of your work on this web site. Kate enjoys doing research and it is simple to grasp why. Most of us know all regarding the powerful tactic you present sensible tips and tricks via this blog and as well as cause response from visitors on the subject matter plus our favorite girl has been studying a whole lot. Take advantage of the rest of the new year. Your doing a splendid job.

Needed to post you the bit of note to say thank you again for the precious thoughts you have featured on this page. It's so surprisingly open-handed with you to grant without restraint what exactly a number of people would have marketed as an ebook to generate some bucks for their own end, precisely now that you could possibly have tried it in the event you desired. Those advice also served to become easy way to be sure that most people have similar dreams the same as my very own to understand good deal more when it comes to this problem. I am certain there are millions of more enjoyable occasions up front for people who read through your website.

I definitely wanted to send a note so as to express gratitude to you for the superb ways you are placing on this website. My extended internet investigation has now been compensated with high-quality concept to exchange with my relatives. I would state that that many of us readers actually are extremely endowed to live in a useful place with very many outstanding professionals with insightful guidelines. I feel extremely blessed to have used your entire website and look forward to many more fun minutes reading here. Thanks once again for everything.

My wife and i have been absolutely fortunate when Louis managed to finish up his analysis through the ideas he grabbed from your very own weblog. It's not at all simplistic to just find yourself giving for free tips and hints that many people may have been trying to sell. Therefore we understand we have got the blog owner to give thanks to for this. The illustrations you've made, the easy blog menu, the relationships you can give support to promote - it's many fabulous, and it's really leading our son and us feel that that article is satisfying, and that's incredibly mandatory. Thanks for the whole thing!

I would like to show thanks to the writer just for rescuing me from such a challenge. After looking throughout the the net and seeing opinions which are not beneficial, I believed my entire life was over. Living devoid of the approaches to the problems you have fixed all through your main review is a critical case, as well as the kind which may have adversely damaged my career if I had not discovered your website. Your primary training and kindness in taking care of all areas was precious. I don't know what I would have done if I had not come across such a stuff like this. I can at this moment relish my future. Thanks a lot very much for this professional and amazing guide. I won't think twice to endorse your web blog to any person who would need care on this topic.

I wanted to post you the very little note in order to say thanks a lot the moment again on the remarkable basics you have discussed above. It is so remarkably open-handed with you to provide extensively all a few individuals would've supplied for an e-book to generate some profit for their own end, most importantly considering the fact that you might have tried it in the event you considered necessary. The tactics likewise acted like the fantastic way to be aware that other people have the identical desire just like my personal own to find out a great deal more related to this issue. I'm certain there are several more pleasurable periods in the future for individuals who read carefully your website.

A lot of thanks for each of your labor on this site. Kim enjoys carrying out research and it is obvious why. A lot of people learn all concerning the powerful form you offer rewarding thoughts through your blog and foster participation from website visitors about this theme plus our own simple princess is without a doubt understanding a great deal. Have fun with the rest of the new year. Your doing a fantastic job.

I precisely wished to appreciate you once again. I do not know what I would've made to happen without the type of tips and hints documented by you concerning my situation. It was before an absolute hard crisis in my view, but looking at the expert way you handled that took me to weep with happiness. I am grateful for the help and then have high hopes you are aware of an amazing job you were doing instructing the others all through your blog. Most likely you have never come across all of us.

Thanks so much for giving everyone such a splendid chance to read critical reviews from this web site. It can be very useful plus packed with a lot of fun for me and my office friends to search your website at a minimum thrice in 7 days to see the fresh guidance you have got. And indeed, I am also certainly satisfied with the beautiful techniques served by you. Some 1 tips on this page are easily the very best I've ever had.

My spouse and i got very more than happy when Albert could do his analysis while using the ideas he acquired through your blog. It's not at all simplistic to just possibly be handing out information and facts that many people today could have been making money from. And we figure out we've got the website owner to appreciate for that. The illustrations you've made, the simple site menu, the friendships your site help engender - it's got all wonderful, and it's really making our son in addition to us imagine that that theme is enjoyable, and that is very indispensable. Thanks for everything!

My spouse and i felt very relieved that Peter could finish off his basic research from the ideas he received through the site. It is now and again perplexing to just possibly be freely giving facts the rest have been trying to sell. We really acknowledge we have got the writer to appreciate for that. Most of the explanations you made, the easy blog menu, the friendships you will aid to engender - it's got all fantastic, and it's really making our son in addition to the family reckon that that concept is brilliant, and that is especially pressing. Thank you for the whole thing!

My wife and i ended up being very delighted when Michael managed to round up his research through the precious recommendations he made when using the blog. It is now and again perplexing to simply always be making a gift of tips and tricks which often a number of people could have been trying to sell. We grasp we need the website owner to be grateful to for that. Most of the explanations you have made, the straightforward website menu, the friendships your site assist to foster - it's mostly extraordinary, and it's really aiding our son and the family do think this subject matter is awesome, which is certainly rather important. Thank you for everything!

I simply wanted to type a brief comment to thank you for all of the fabulous concepts you are posting on this website. My time intensive internet look up has now been paid with professional ideas to go over with my great friends. I would state that that we visitors actually are unequivocally blessed to be in a useful site with so many special professionals with beneficial tips and hints. I feel rather happy to have discovered the web pages and look forward to some more fabulous minutes reading here. Thanks once more for everything.

My wife and i ended up being so more than happy when Chris could conclude his investigation via the precious recommendations he acquired while using the web pages. It is now and again perplexing to simply find yourself freely giving facts that many people today could have been making money from. So we do understand we have got you to thank because of that. The most important illustrations you made, the easy web site menu, the relationships you can give support to engender - it's got mostly wonderful, and it is helping our son in addition to the family reckon that the content is pleasurable, which is exceedingly fundamental. Many thanks for everything!

I have to express my admiration for your generosity in support of those who must have assistance with this important subject. Your special dedication to passing the message up and down became surprisingly practical and has always enabled people like me to realize their ambitions. Your personal warm and helpful advice means a lot to me and a whole lot more to my colleagues. Best wishes; from everyone of us.

I wanted to create you one little bit of observation in order to give thanks again on the pleasant solutions you have contributed on this page. It has been simply strangely open-handed with you to grant unreservedly all a number of us would've sold for an e book in making some bucks for their own end, and in particular seeing that you might have done it if you desired. The concepts as well acted as the great way to be sure that most people have similar fervor much like my very own to understand whole lot more when it comes to this condition. I'm sure there are some more enjoyable occasions in the future for people who scan your blog.

Thank you for your whole labor on this web page. Kim take interest in engaging in internet research and it's really simple to grasp why. All of us learn all about the dynamic medium you provide powerful things via the website and as well cause participation from others on that topic while our own simple princess is certainly learning so much. Take pleasure in the rest of the new year. You are always performing a really great job.

I'm writing to let you understand of the fantastic encounter my daughter had using your site. She came to understand so many details, including what it is like to have an amazing coaching spirit to get other people effortlessly know just exactly various advanced subject areas. You undoubtedly surpassed visitors' expectations. Thanks for delivering the great, healthy, edifying and also easy tips on your topic to Tanya.

I precisely wanted to thank you very much once again. I'm not certain the things that I might have made to happen without the entire advice provided by you about my problem. It truly was a very frightful matter in my view, nevertheless looking at this well-written mode you handled it forced me to jump with fulfillment. Extremely thankful for your assistance and expect you realize what a powerful job your are providing teaching some other people by way of your website. I am sure you've never come across all of us.

I simply needed to thank you very much once more. I'm not certain the things that I might have worked on without the entire solutions provided by you about my industry. It absolutely was a real daunting problem in my opinion, but finding out a specialized style you managed the issue made me to cry with delight. Extremely happy for the assistance and as well , pray you really know what an amazing job that you're getting into training people all through your webpage. I am certain you have never met any of us.

I must express appreciation to this writer just for bailing me out of such a problem. Because of looking out throughout the online world and getting views which were not powerful, I thought my life was gone. Existing without the presence of approaches to the problems you've solved as a result of your good article is a serious case, and ones that would have badly damaged my entire career if I hadn't encountered your blog post. Your personal ability and kindness in controlling every aspect was crucial. I don't know what I would have done if I hadn't come upon such a step like this. It's possible to at this time look ahead to my future. Thank you very much for your expert and effective help. I won't think twice to propose your blog to any person who should get guidelines on this matter.

I must get across my admiration for your kind-heartedness supporting individuals that actually need help on this particular content. Your special dedication to passing the solution all-around ended up being extremely insightful and have constantly permitted associates just like me to achieve their ambitions. Your personal warm and helpful guideline signifies this much a person like me and somewhat more to my office colleagues. Regards; from everyone of us.

My husband and i got peaceful Michael managed to finish up his investigation out of the ideas he gained using your web page. It is now and again perplexing to simply happen to be offering techniques the rest might have been selling. And now we remember we now have you to appreciate for that. Those illustrations you have made, the straightforward site navigation, the relationships you can assist to instill - it's most remarkable, and it's leading our son in addition to us feel that the subject matter is satisfying, and that's truly pressing. Thank you for the whole lot!

I intended to post you this little observation in order to thank you very much the moment again about the incredible tricks you have featured in this article. It was surprisingly open-handed with people like you giving unreservedly just what a few individuals would have sold for an electronic book to help make some money for themselves, certainly considering that you could possibly have done it if you desired. The tricks likewise worked to become good way to fully grasp other people online have the identical dreams the same as my very own to realize more and more regarding this matter. Certainly there are many more pleasurable periods ahead for individuals that read your website.

I would like to express my love for your generosity supporting folks who really want assistance with your field. Your personal dedication to getting the solution all through became exceedingly effective and have surely helped guys and women just like me to reach their desired goals. Your own interesting publication can mean much a person like me and much more to my office workers. With thanks; from each one of us.

I must express thanks to this writer for bailing me out of such a problem. As a result of searching throughout the world wide web and meeting tips which were not helpful, I thought my entire life was over. Being alive minus the answers to the difficulties you've fixed through your good review is a critical case, and the ones which could have badly damaged my entire career if I had not discovered your web page. Your primary talents and kindness in touching the whole lot was vital. I'm not sure what I would've done if I hadn't come across such a solution like this. I can now look ahead to my future. Thanks so much for the reliable and result oriented guide. I won't hesitate to suggest your blog to anyone who requires assistance on this situation.

I would like to show my thanks to you just for bailing me out of this type of difficulty. Just after checking through the world wide web and finding views which were not powerful, I thought my entire life was gone. Being alive without the presence of answers to the problems you have solved by means of your good blog post is a serious case, and ones which could have adversely affected my entire career if I had not noticed your web page. Your actual mastery and kindness in controlling the whole lot was very useful. I am not sure what I would have done if I hadn't come upon such a solution like this. I am able to at this point look forward to my future. Thanks very much for this expert and effective help. I won't think twice to recommend your web blog to anybody who should get tips about this matter.

My wife and i got really glad that Michael could conclude his research with the precious recommendations he acquired using your web page. It is now and again perplexing to just choose to be making a gift of instructions which often some people have been making money from. And now we take into account we now have the website owner to thank for that. The illustrations you've made, the easy blog menu, the relationships you can make it easier to engender - it's got everything unbelievable, and it's facilitating our son in addition to us consider that the subject matter is fun, which is certainly exceedingly mandatory. Thanks for everything!

I wanted to draft you the very little observation to say thanks a lot again for these extraordinary concepts you've discussed on this page. It was really surprisingly generous with people like you to give openly precisely what some people would've offered as an e book to get some money for their own end, particularly considering that you might have done it in case you desired. These solutions as well served like a easy way to fully grasp other people online have a similar dream the same as my very own to find out a great deal more with reference to this matter. I know there are thousands of more enjoyable times in the future for folks who examine your blog.

Thanks a lot for providing individuals with remarkably memorable opportunity to check tips from this blog. It's always very pleasing plus full of a good time for me personally and my office mates to visit your website a minimum of three times a week to read through the latest stuff you will have. Of course, I'm just usually motivated considering the perfect tips served by you. Some 4 facts in this article are absolutely the simplest I have had.

I actually wanted to write a quick note so as to say thanks to you for some of the precious information you are sharing at this site. My extended internet investigation has at the end been recognized with excellent insight to share with my contacts. I would tell you that most of us visitors are truly fortunate to exist in a great website with so many outstanding professionals with useful secrets. I feel rather grateful to have used the web pages and look forward to many more fabulous minutes reading here. Thanks again for everything.

I enjoy you because of all your effort on this web site. My niece loves engaging in research and it is obvious why. We hear all about the lively tactic you offer reliable tips and tricks through the web blog and in addition invigorate response from the others on this article while our favorite daughter is undoubtedly being taught a lot. Take pleasure in the remaining portion of the year. You're the one doing a terrific job.

I used to be very happy to find this net-site.I wanted to thanks on your time for this wonderful read!! I undoubtedly enjoying each little little bit of it and I have you bookmarked to take a look at new stuff you blog post.

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.