Home About us Support Partners SIGN UP NOW
Text Copied
 Home    Blog    Integration with Home Assistant

MQTTRoute Integration with Home Assistant

home assistant integration

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.

MQTT broker integration with home assistant

Home Assistant : Installation

Installation can be done in four different methods

  • Home assistant operating system
  • Home assistant section
  • Home assistant supervised
  • Home assistant core

You can select any method based on your convenience.

Select your preferred operating system from the Home Assistant Installation page.

In Raspberry Pi :

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.

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


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.


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 the Home Assistant Onboarding getting started page.

Create your account with a home assistant.

Set up your configurations.

home-assistant1

Home Assistant : MQTT broker 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 MQTT broker with a home assistant.
  • Download the latest version of MQTT broker from our Broker download page.

  • Once done set up & install MQTT broker. You can check our Broker help documentation for step by step procedure of 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.
integration mqtt
  • 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 MQTT broker UI.
MQTT broker security details
  • Once done click submit. If your configurations are set correctly you will receive a success message.
success-integration
  • 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.
home assistant mqtt broker

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


Try our MQTT Broker for FREE and experience seamless connectivity.