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 MQTTRoute 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 MQTTRoute with the home assistant.

MQTTRoute integration with home assistant

Home Assistant : Installation

Installation can be done in four different methods

  • Home assistant operating system
  • Home assistant container
  • Home assistant supervised
  • Home assistant core

You can select any method based on your convenience.

Select your preferred operating system from the below mentioned list

https://www.home-assistant.io/installation/

In Raspberry Pi :

The first step is to install Hass.io to start running Home Assistant in Raspberry pi.

https://home-assistant.io/hassio/installation/

Navigate to the above link & choose the appropriate image. Here I have choosen Raspberry pi 3.

Go to https://etcher.io/ 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.

In Linux

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 containerd.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.

Install Hass.io & Home assistant

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.

Home assistant : Onboarding

This is to configure the home assistant.

For more details you can navigate to

https://www.home-assistant.io/getting-started/onboarding/

Create your account with a home assistant.

Set up your configurations.

home-assistant

Home Assistant : MQTTRoute Integration

Click the configuration tab present at the left side of the Home Assistant UI.

The integrations page in the configurations panel shows you all your configured integrations. When each integration is done setting up, it will ask you to put the new devices in areas. Areas allow you to organize all the devices in your home.

Now let us see how to integrate MQTTRoute with a home assistant.

Download the latest version of MQTTRoute from the below link.

https://www.bevywise.com/mqtt-broker/download.html

Once done set up & install MQTTRoute

https://www.bevywise.com/mqtt-broker/help.html#installation

You can check the link for step by step procedure for installation.

Once done, go to Bevywise/MQTTRoute/conf  and enable authentication in broker.conf file. 

[AUTHENTICATION]

AUTHENTICATION_ENABLED = YES

# YES || NO

 

Save your changes.

Now move to the home assistant UI. Navigate to the integrations tab.

Click “Add integration” button.

Select MQTT from the list.

You will view the screen asking for the broker details.

home-assistant-mqtt-integration

Enter broker IP or host name as 127.0.0.1

By default port will be set as 1883. In case if TLS is enabled in the broker.conf file, you need to change the port here.

Now enter username and password which is provided in the security tab of MQTTRoute UI.

MQTT Broker Security details

Once done click submit. If your configurations are set correctly you will receive a success message.

home-assistant-integration-success

You can view the home assistant device connected to the MQTT Broker in Devices tab & list of messages published. You can now connect your home devices in the devices tab of Home assistant UI.

mqtt-broker-dashboard
home-assistant-dashboard

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 MQTTRoute to control your home devices.

The MQTT Broker version 3.3 is now available with mobile app to track your devices right from your android. Get the app now on Play Store.