Home Assistant - MQTT broker with bridge setup

This guide is intended for advanced users that prefer to run an MQTT broker on their Home Assistant installation. After completing this guide your Home Assistant MQTT broker will pull messages from SolarAssistant via an MQTT bridge.

Step 1 - Install file editor add-on

Go to the Home Assistant add-ons.

Home Assistant add-ons

Install file editor add-on.

File add-on install

Under the "configuration" tab, allow editing of any file by not enforcing the basepath.

File add-on configuration

Under the "info" tab, set the settings below and start the add-on.

  • start on boot
  • show in sidebar
File add-on information

Step 2 - Install MQTT broker

Go to the Home Assistant add-ons.

Home Assistant add-ons

Go to the add-ons and install the MQTT broker.

Home Assistant MQTT broker add-on

Under the "configuration" tab, enable customization. This will make the MQTT server (mosquitto) look for config files under /share/mosquitto for customization config.

MQTT broker configuration

Under "info", set the add-on to start at boot and start it now.

MQTT broker information

Step 3 - Create the mosquitto bridge config file

Open the file editor and browse for files.

Browse files in File edit add-on

Select the share folder.

Select share folder

Select create folder.

Create new folder

Enter mosquitto as the folder name.

Name folder mosquitto

Select the newly created folder.

Select mosquitto folder

Select create file.

Create new file

Enter solar_assistant.conf as the file name.

Name file solar_assistant.conf

Select the newly created file.

Edit solar_assistant.conf

Paste the code below into the file content and click save. Note:

  • address the IP address of your SolarAssistant device instead of
  • remote_username and remote_password should be uncommented if you configured MQTT authentication in SolarAssistant.
  • topic in is to pull all messages from SolarAssistant
  • topic out is to push solar setting change messages from your existing broker to SolarAsssistant.

connection SolarAssistant
#remote_username solar-assistant
#remote_password solar123
topic # in
topic solar_assistant/# out

Save solar_assistant.conf

Step 4 - Restart MQTT broker

Go to the Mosquitto broker add-on and click "restart".

Restart Home Assistant MQTT broker

Under the "log" tab, ensure your configuration file is loaded.

Home Assistant MQTT broker log

Step 5 - Confirm MQTT integration is working

Go to the Home Assistant integrations.

Home Assistant integrations

Configure MQTT integration or add it if it hasn't been discovered already.

Configure Home Assistant MQTT integration

If it's the first time you are opening this page, it will prompt to connect to the Home Assistant mosquitto server you created.

Use Home Assistant MQTT broker

Go to the MQTT integration configuration. and subscribe to the # topic. You should see SolarAssistant messages appear.

Home Assistant MQTT integration configuration

Subscribe to the # topic. You should see SolarAssistant messages appear.

Test HomeAssistant MQTT messages