How to Use HiveMQ Cloud MQTT Broker with Home Assistant
Written by Magi Erber
Published: May 14, 2021
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.
Create an account on HiveMQ Cloud.
By signing up you start straight with the free plan that enables you to connect up to 100 devices (no credit card required).
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.
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.
Copy the broker info to your
configuration.yaml. You can find the broker hostname in Cluster Details Overview.
mqtt: broker: HIVEMQ_BROKER_HOSTNAME port: 8883 username: MQTT_USERNAME password: MQTT_PASSWORD certificate: PATH_TO_STORED_CERTIFICATE
Your HiveMQ Cloud will appear as MQTT integration in Home Assistant.