MQTT (aka MQ Telemetry Transport) is a machine-to-machine or “Internet of Things” connectivity protocol on top of TCP/IP. It allows extremely lightweight publish/subscribe messaging transport.

Your first step to get MQTT and Home Assistant working is to choose a broker.


Adding MQTT to your Home Assistant instance can be done via the user interface, by taking the following steps:

  • Browse to your Home Assistant instance.

  • In the sidebar click on Configuration.

  • From the configuration menu select: Integrations.

  • In the bottom right, click on the Add Integration button.

  • From the list, search and select “MQTT”.

  • Follow the instruction on screen to complete the set up.

After completing, the MQTT integration will be immediately available for use.

Manual configuration

Alternatively, if you want to manually configure MQTT, you will need to add the following to your configuration.yaml file.

To connect to your own MQTT broker:

# Example configuration.yaml entry

Manual configuration is required when connecting to a broker over TLS.

# Example configuration.yaml entry
  certificate: "PATH_TO_CA.crt"
  port: 8883
  username: "MQTT_USERNAME"
  password: !secret MQTT_PASSWORD

Additional features