Skip to content

How to Use HiveMQ Cloud MQTT Broker with Home Assistant

by Magi Erber
3 min read

Home Assistant is a popular home automation platform and open source project on GitHub. Home Assistant allows for the integration of MQTT enabled devices. To integrate these devices with the home automation platform you need to use an MQTT broker.

Home Assistant users have the option of using free public brokers, setting up their own MQTT broker or using a managed cloud broker. A managed MQTT cloud broker is definitely going to be the most private, secure, and easiest option to deploy. Now that HiveMQ Cloud allows users to connect up to 100 devices for free, we thought it would be a great idea to make it easy for Home Assistant enthusiasts to connect with HiveMQ Cloud.

Here are the instructions Home Assistant users need to follow to use HiveMQ Cloud for free.

Step 1: Create an account on HiveMQ Cloud.

Step 2: By signing up you start straight with the free plan that enables you to connect up to 100 devices (no credit card required).

Step 3: Create MQTT credentials in the Access Management tab of your Cluster Detail view. These can be used to connect Home Assistant and any MQTT device.

Access Management tab of your Cluster Detail view

Step 4: Download the trusted certificate from Let’s Encrypt to ensure secure communication between Home Assistant and your HiveMQ Cloud cluster. Store the certificate in a location that is reachable from your Home Assistant configuration file.

Step 5: Copy the broker info to your configuration.yaml. You can find the broker hostname in Cluster Details Overview.

Cluster Details

Use the credentials you just created as username and password and the path from the downloaded certificate.

mqtt:
      broker: HIVEMQ_BROKER_HOSTNAME
      port: 8883
      username: MQTT_USERNAME
      password: MQTT_PASSWORD
      certificate: PATH_TO_STORED_CERTIFICATE

Step 6: Your HiveMQ Cloud will appear as MQTT integration in Home Assistant.

MQTT integration in Home Assistant

We are currently offering HiveMQ Cloud Serverless plan, which is a free MQTT broker ideal for learning and experimenting with MQTT. If you are looking for a complete MQTT platform for testing and small-scale production, try HiveMQ Cloud Starter.

Get HiveMQ Starter

Check out the video below that provides the summary of this blog

Magi Erber

Magi Erber is Senior Product Manager at HiveMQ. She loves creating software that delights customers and helps them realizing innovative IoT solutions.

  • Contact Magi Erber via e-mail

Related content:

HiveMQ logo
Review HiveMQ on G2