Categories
Home Assistant Project Smart Home

Setting Up Home Assistant on the Raspberry Pi 4B

Installation of Home Assistant on a new Raspberry Pi 4.

New Raspberry Pi

A couple months back the Raspberry Pi foundation released their new iteration of the Raspberry Pi: The Raspberry Pi 4B. Along with the more powerful processor on board, they made a few huge changes that I am very excited about. The first big change was the USB and Ethernet now have their own dedicated controller, which allows Gigabit Ethernet as well as USB3 support. As well, for the first time, you can now buy 3 different models of the 4B, ones with either 1 GB, 2 GB or 4 GB of RAM. A few other smaller changes were done, such as having two micro-HDMI display outputs, each capable of 4K resolution and utilizing a USB type-C connector for the power delivery.

A couple weeks back, the 4 GB Pi that I ordered finally arrived. The kit I ordered (link) came with everything I needed to get started with the board: The Pi itself, a 2A power supply, a 32 GB SD card with N00bS installed, a Case, a couple of heatsinks and a micro-HDMI to HDMI cable. I installed the SD card into the Pi, then put the Pi into the case and connected the power supply, mico-HDMI and a keyboard an mouse to the Pi. Once the Pi finished booting up, I was prompted with an OS selection screen. I choose to use Raspbian as my OS, as its the simplest to use and supports all of the software I want to use.

What is Home Assistant?

The main use for my new Raspberry Pi is to run the open source software called Home Assistant. Home Assistant (link) is an open source software, written in python, that brings home automation to the user instead of in the cloud. The software has many integrations with commercially available smart home devices and ecosystems, such as Samsung Smart Thing and Philip Hue. The software supports many additional plugins and further expand its capabilities.

First Bootup of Home Assistant
Fresh Home Assistant Install

Installing Home Assistant

Home Assistant has many different methods of being installed depending on the system it’s being run from. The two most popular methods are either barebones or Hass.io. The Barebones method will only install the python program, which means an OS capable of running it must already be setup. The other method, Hass.io, is the all-in-one package that include the OS and all tools needed to run Home Assistant, and is the prefered method to run Home Assistant. Hass.io can be installed as the OS that the Pi runs, or it can be ran inside a Docker Container. The Docker Container method is the method I will be using since I would like to run more than just Home Assistant on my new Raspberry Pi.

Since the Raspberry Pi 4 came out fairly recently, there does not seem to be an official docker image of Hass.io, but the Raspberry Pi 3B+ image seems to works good enough. If you are installing this on another device, you can try and follow the instruction found here. First we need to prepare the Raspberry Pi 4 to run docker and then install the Hass.io image and run it. I won’t go over how to set up a Raspberry Pi to connect over Wi-Fi or how to set up SSH, there are plenty of tutorials online on how to do that already. Once the Pi has gone through its initial setup, we can open up a terminal, either locally or through SSH ( Which I use MobaXterm to connect). First ensure the system is up to date with the following commands:

sudo apt-get update
sudo apt-get upgrade

Then we can install docker itself onto the Pi:

sudo curl -sL get.docker.com | sed 's/9)/10)/' | sh

Once Docker has finished being installed, we want to install any dependencies that docker may require:

sudo apt-get install apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat software-properties-common

Note: During any of the above commands, you may be required to acknowledge the install by typing “YES” or similar.

It might be a good time to restart the Pi at this point so everything can take effect.

sudo reboot

Once the Pi comes back up, we can finally install the Hass.io docker image. As stated above, there is no official image for the Raspberry Pi 4, so we will have to modify a file to tell the system to use the Raspberry Pi 3 image instead. Make sure you are in the home folder for your user and run the following command:

sudo curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" >> hassio_install.sh

That should download a bash script, hassio_install.sh, and put it into your home directory. Open that file using either nano or if SSHing in, a text editor on the local machine. Around line 91 you should see “armv7l”. Replace:

"armv7l")
        if [ -z $MACHINE ]; then
            echo "[ERROR] Please set machine for $ARCH"
            exit 1
        fi
        HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant"
        HASSIO_DOCKER="$DOCKER_REPO/armv7-hassio-supervisor"
    ;;

With the following:

"armv7l")
        HOMEASSISTANT_DOCKER="$DOCKER_REPO/raspberrypi3-homeassistant"
        HASSIO_DOCKER="$DOCKER_REPO/armhf-hassio-supervisor"
    ;;

This should tell the script to use the Raspberry Pi 3 image instead. Finally we want to run the script to install the docker image and setup system to auto-run at startup:

sudo bash hassio_install.sh

This might take a few minutes, but should give you feedback as it progresses.

Running Home Assistant for the First Time

Now that we have installed Hass.io in a docker container, everything should be setup and running at this point. In a web browser, go to “hassio.local:8123”. If everything is going well, you should either see a screen saying to wait or a login screen. If the browser does not find the site, you might need to find the IP address of the Pi and use that instead ( 192.168.1.XX:8123). Once the Login screen appears, you will need to create an admin account. Follow the instructions and make sure to use a strong password. As you go through the first time setup, it may prompt you to set up found devices. You can either do that at that point, or at a later point once you are more familiar with the system. If everything went well, you should be greeted with the home screen of home assistant.

Home Assistant Greeting Screen

What’s Next?

This was just the initial set up of Home Assistant. In the coming weeks I plan on adding more functionality and adding some of my existing smart home devices so I can control them.

388 replies on “Setting Up Home Assistant on the Raspberry Pi 4B”

This design is incredible! You most certainly know how to keep a reader entertained.
Between your wit and your videos, I was almost moved to start my own blog (well,
almost…HaHa!) Great job. I really loved what you had to say, and more than that, how you presented it.

Too cool!

Unquestionably believe that which you said. Your favorite justification appeared to
be on the web the easiest thing to be aware of. I say to you, I certainly get annoyed while
people consider worries that they plainly don’t know about.
You managed to hit the nail upon the top and defined out the whole thing
without having side-effects , people could take a signal.
Will likely be back to get more. Thanks

Thanks for your marvelous posting! I really enjoyed reading it, you may be a great author.

I will make sure to bookmark your blog and will
come back very soon. I want to encourage one to continue your great work,
have a nice weekend!

Hello, i read your blog occasionally and i own a similar one and i was just curious if you get a lot of
spam comments? If so how do you stop it, any plugin or anything you can advise?
I get so much lately it’s driving me mad so any help is very much appreciated.

I know this if off topic but I’m looking into starting my own blog and was curious what all
is required to get setup? I’m assuming having a blog like yours
would cost a pretty penny? I’m not very web savvy so I’m
not 100% certain. Any recommendations or advice would be greatly appreciated.

Appreciate it

Thanks for any other magnificent article. The place else could anyone get that type of information in such an ideal way of
writing? I have a presentation subsequent week, and I am at the look
for such info.

Its such as you learn my mind! You appear to grasp so much approximately this, like you wrote the e-book
in it or something. I think that you simply could do with some % to pressure the message
house a bit, however other than that, this is wonderful blog.
An excellent read. I will certainly be back.

I’m curious to find out what blog system you’re working with? I’m experiencing some small security problems with my latest site and I’d like to find something more secure. Do you have any suggestions?

Oh my goodness! Incredible article dude! Many thanks,
However I am experiencing problems with your RSS.
I don’t understand why I can’t join it. Is there anybody getting
identical RSS problems? Anyone that knows the answer will you kindly respond?
Thanks!!

Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
You obviously know what youre talking about, why waste your intelligence
on just posting videos to your weblog when you could be giving us something
informative to read?

I feel this is among the so much important information for me.

And i am glad reading your article. However wanna commentary on some common things, The website taste is great, the articles is really great
: D. Good task, cheers

Hello, i read your blog from time to time and i own a similar one and i was just wondering
if you get a lot of spam feedback? If so how
do you protect against it, any plugin or anything you can suggest?
I get so much lately it’s driving me crazy so any help
is very much appreciated.

Hi there, just became alert to your blog through Google,
and found that it’s truly informative. I am going to watch out
for brussels. I will appreciate if you continue this in future.
Many people will be benefited from your writing. Cheers!

Hello outstanding website! Does running a blog such as this take a large amount of work?
I have no expertise in programming but I had been hoping
to start my own blog in the near future. Anyhow, should you
have any suggestions or techniques for new blog owners please share.
I understand this is off topic but I just wanted to ask.

Cheers!

This is the right blog for anyone who wishes to find out about
this topic. You know a whole lot its almost hard to argue with
you (not that I actually would want to…HaHa). You certainly put a fresh spin on a subject that’s been written about for
many years. Wonderful stuff, just excellent!

Today, I went to the beach front with my kids.
I found a sea shell and gave it to my 4 year old daughter and
said “You can hear the ocean if you put this to your ear.” She
placed the shell to her ear and screamed. There
was a hermit crab inside and it pinched her ear. She never wants to
go back! LoL I know this is completely off topic
but I had to tell someone!

Its such as you learn my thoughts! You seem to grasp a
lot approximately this, such as you wrote the e-book in it or something.
I believe that you can do with some p.c. to power the message home a
bit, but instead of that, that is magnificent blog.
A fantastic read. I will certainly be back.

Aw, this was an incredibly nice post. Taking a few minutes and actual effort to generate
a top notch article… but what can I say… I hesitate a lot
and don’t manage to get nearly anything done. 34pIoq5 cheap flights

Thank you for some other informative blog. Where else may just I get that kind of information written in such an ideal
method? I’ve a venture that I am just now working on, and I’ve been on the look
out for such information. cheap flights yynxznuh

I was recommended this blog through my cousin. I am now not positive whether this submit is written by means of him as nobody else know such targeted about my difficulty.
You are incredible! Thanks! 2CSYEon cheap flights

I believe everything published made a lot of sense.

However, think about this, suppose you were
to create a killer headline? I ain’t saying your information is not solid, however what if you added
a title that makes people desire more? I mean Setting Up Home Assistant on the Raspberry Pi 4B –
Aaron's Lab is a little boring. You should glance at Yahoo’s front page and note how they create post titles to get viewers to open the links.
You might try adding a video or a picture or two to get readers excited about what you’ve
written. Just my opinion, it would bring your blog a little
bit more interesting.

Today, I went to the beachfront with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.”
She placed the shell to her ear and screamed. There was a hermit crab inside
and it pinched her ear. She never wants to go back!
LoL I know this is completely off topic but I had to tell someone!

Just wish to say your article is as amazing.
The clarity in your put up is just excellent and i could assume
you’re an expert in this subject. Well together with your permission allow me to seize
your RSS feed to keep up to date with coming near near post.
Thank you one million and please continue the enjoyable work.

An interesting discussion is definitely worth comment.
I think that you need to write more on this topic, it might not be a taboo matter but typically
people don’t discuss these topics. To the next!
Many thanks!!

My developer is trying to convince me to move to .net from PHP.

I have always disliked the idea because of the costs. But
he’s tryiong none the less. I’ve been using Movable-type on a variety
of websites for about a year and am concerned about switching to another platform.
I have heard great things about blogengine.net. Is there a way
I can transfer all my wordpress posts into it? Any help would be really appreciated!

My spouse and I stumbled over here different website and thought I might as well check things out. I like what I see so i am just following you. Look forward to looking into your web page again.

Excellent post. I was checking constantly this blog and I am inspired!
Extremely useful information specifically the last phase 🙂 I deal with
such information much. I was seeking this certain information for a very lengthy
time. Thank you and best of luck.

Hey! This is kind of off topic but I need some guidance from an established blog.

Is it hard to set up your own blog? I’m not very techincal but
I can figure things out pretty fast. I’m thinking about making my own but I’m not sure where to start.
Do you have any ideas or suggestions? With thanks

Hey there just wanted to give you a quick heads up. The words in your article seem to be running off the screen in Firefox. I’m not sure if this is a formatting issue or something to do with browser compatibility but I thought I’d post to let you know. The style and design look great though! Hope you get the issue resolved soon. Thanks

I like this post, enjoyed this one thanks for putting up. “To the dull mind all nature is leaden. To the illumined mind the whole world sparkles with light.” by Ralph Waldo Emerson.

Thanks for sharing excellent informations. Your website is very cool. I’m impressed by the details that you have on this website. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for more articles. You, my friend, ROCK! I found simply the info I already searched all over the place and simply couldn’t come across. What a great site.

I’ve been browsing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all website owners and bloggers made good content as you did, the net will be much more useful than ever before.

This is why CPAP.com offers free 30 day returns on this machine. We certainly have no interest in making any false claims, or no desire to give the illusion that any of our products are rated higher than they actually are.

Today, I went to the beach with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is completely off topic but I had to tell someone!

Please let me know if you’re looking for a article writer for your site. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some articles for your blog in exchange for a link back to mine. Please shoot me an e-mail if interested. Thanks!

Excellent post. I was checking continuously this blog and I’m impressed! Extremely helpful information specifically the final phase 🙂 I deal with such information a lot. I was looking for this particular information for a very long time. Thank you and best of luck.

Undeniably believe that which you said. Your favorite justification appeared to be on the internet
the simplest thing to be aware of. I say to you, I definitely get irked
while people think about worries that they plainly don’t know about.

You managed to hit the nail upon the top and also defined out the
whole thing without having side effect , people could take a signal.
Will probably be back to get more. Thanks

My blog – best erectile dysfunction pills

Hi, i read your blog occasionally and i own a similar one and i was just curious if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you can suggest? I get so much lately it’s driving me crazy so any support is very much appreciated.

It’s a shame you don’t have a donate button! I’d most certainly donate to this brilliant blog! I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account. I look forward to new updates and will share this website with my Facebook group. Chat soon!

Heya this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding experience so I wanted to get guidance from someone with experience. Any help would be greatly appreciated!

It is appropriate time to make some plans for the future and it is time to be happy. I have read this post and if I could I desire to suggest you few interesting things or advice. Maybe you can write next articles referring to this article. I desire to read more things about it!

Leave a Reply

Your email address will not be published. Required fields are marked *