The technological world is moving faster with its most popular innovations and home automation is one such innovation which everyone loved or liked to have. Home automation systems enable us to automate our smart home devices present at home. With MQTT broker integrated into the home automation platform you can easily develop your own home automation system. There are numerous open source automation platforms available in the market. And among them, Home Assistant have stood out as the most familiar choice. Here is a step by step tutorial on how to integrate MQTT broker with the home assistant.
Installation can be done in four different methods
You can select any method based on your convenience.
Select your preferred operating system from the Home Assistant Installation page.
The first step is to install Hass.io to start running Home Assistant in Raspberry pi. Navigate to Home assistant installation page and choose the appropriate image. Here I’ve choosen Raspberry pi 3.
Go to Etcher page and install Etcher on your computer.
Once installation is done, open Etcher and select the hassio image you have downloaded in the first step.
Choose the right SD card and click Flash. Before this, have your SD card formatted.
Insert the SD card on your pi & connect an Ethernet cable & power it up. To configure wi-fi, please check this post.
Now access Home Assistant user interface in browser using homeassistant:8123 or http://your-pi-ip-address:8123. Replace your-pi-ip-address with your Raspberry PI IP.
Let us see how to set up home assistant in linux with docker.
You have to update the linux first
sudo apt-get update
sudo apt-get upgrade
Now install docker using the below commands.
Before docker installation it is necessary to install some additional packages.
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
Now, to ensure validity of the download, add a GPG key or docker to our system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
To set up stable repository
echo \ “deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Now install docker engine
sudo apt-get install docker-ce docker-ce-cli sectiond.io
Now run hello world command to test the successful installation of docker
sudo docker run hello-world
On successful installation, you will receive the below message
Hello from Docker! This message shows that your installation appears to be working correctly.
Hass.io is an own operating of home assistant.
Before installation you need to add some additional packages
sudo apt-get install apparmor-utils avahi-daemon dbus jq network-manager socat
Now change the terminal to root
sudo su
And then add the below command to install Hassio & home assistant.
sudo curl -sL “https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh” | bash -s
The installation of Home assistant has completed. By default home assistant runs on port 8123. You can navigate to http://homeassistant.local:8123/
or use your IP to reach home assistant portal.Let us continue with the onboarding.
This is to configure the home assistant.
For more details you can navigate to the Home Assistant Onboarding getting started page.
Create your account with a home assistant.
Set up your configurations.
[AUTHENTICATION] AUTHENTICATION_ENABLED = YES # YES || NO
Hope this article provide you a detailed view on home assistant integration with MQTT Broker. Try setting up with the home automation platforms by yourself & integrating MQTT broker to control your home devices.
Try our MQTT Broker for FREE and experience seamless connectivity.