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

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/

For example, 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  You need to 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

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.

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

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

home-assistant-mqtt-integration
home-assistant-integration-success
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.

Download MQTT Broker now for FREE to get started with your Home automation set up. The new version of MQTT Broker, MQTTRoute 3.2 is available now with High availability support, $SYS topic & more.