Home Assistant - MQTT broker with bridge setup
Step 1 - Install file editor add-on
Go to the Home Assistant add-ons.
![Home Assistant add-ons](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/addons-70ca3288370c1d0041599d64822886ff.png?vsn=d)
Install file editor add-on.
![File add-on install](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-install-bb2596fab4f0d24463e85fa3b115264a.png?vsn=d)
Under the "configuration" tab, allow editing of any file by not enforcing the basepath.
![File add-on configuration](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-config-f12c704f82a149708136a6c0c5a8aa06.png?vsn=d)
Under the "info" tab, set the settings below and start the add-on.
- start on boot
- show in sidebar
![File add-on information](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-info-b8003091062964aaf27c8ad66f77f37e.png?vsn=d)
Step 2 - Install MQTT broker
Go to the Home Assistant add-ons.
![Home Assistant add-ons](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/addons-70ca3288370c1d0041599d64822886ff.png?vsn=d)
Go to the add-ons and install the MQTT broker.
![Home Assistant MQTT broker add-on](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/broker-install-ebdedae9034244485653160410b7118b.png?vsn=d)
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](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/broker-config-6fe4d73d51625dace96b666c24978990.png?vsn=d)
Under "info", set the add-on to start at boot and start it now.
![MQTT broker information](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/broker-info-0a189ca86d24fea2cbde8bff26bf7617.png?vsn=d)
Step 3 - Create the mosquitto bridge config file
Open the file editor and browse for files.
![Browse files in File edit add-on](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse1-54ee64b626e639ca882e34008408d230.png?vsn=d)
Select the share folder.
![Select share folder](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse2-64a49ebe363442c66da29227c30df7a7.png?vsn=d)
Select create folder.
![Create new folder](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse3-edb8e9e3941e439fa3ad2df15a2fb0aa.png?vsn=d)
Enter mosquitto as the folder name.
![Name folder mosquitto](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse4-6cdda3ccdd36f5e63e833e052375e7ae.png?vsn=d)
Select the newly created folder.
![Select mosquitto folder](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse5-d1189b133e5b5e2eaed37b524971fb8d.png?vsn=d)
Select create file.
![Create new file](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse6-c3c289d8a31381e197d7059e6a5f63c9.png?vsn=d)
Enter solar_assistant.conf as the file name.
![Name file solar_assistant.conf](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse7-f093bedfa4c356df493f7b70fa34a88e.png?vsn=d)
Select the newly created file.
![Edit solar_assistant.conf](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse8-6a311dd452b7d1aa543700a63b1b4c70.png?vsn=d)
Paste the code below into the file content and click save. Note:
- address the IP address of your SolarAssistant device instead of 10.0.0.5.
- 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
address 10.0.0.5
topic # in
topic solar_assistant/# out
![Save solar_assistant.conf](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/file-edit-browse9-e3f6ebd080d9b97a629a0e9917fe603a.png?vsn=d)
Step 4 - Restart MQTT broker
Go to the Mosquitto broker add-on and click "restart".
![Restart Home Assistant MQTT broker](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/broker-restart-be8e943ea86ae0e5ca7d2d9632a52a7b.png?vsn=d)
Under the "log" tab, ensure your configuration file is loaded.
![Home Assistant MQTT broker log](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/broker-log-23d29a44818d14b74207e027b9ca5bee.png?vsn=d)
Step 5 - Confirm MQTT integration is working
Go to the Home Assistant integrations.
![Home Assistant integrations](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/devices-and-services-1c13e0c5e9b9daf83d16521bf6fbaa57.png?vsn=d)
Configure MQTT integration or add it if it hasn't been discovered already.
![Configure Home Assistant MQTT integration](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/mqtt-integration-bebdc7ab70ce16d8f5d15e4ea52c754a.png?vsn=d)
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](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/mqtt-integration-broker-28b69a326722cf09844c9558fb2c5107.png?vsn=d)
Go to the MQTT integration configuration. and subscribe to the # topic. You should see SolarAssistant messages appear.
![Home Assistant MQTT integration configuration](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/mqtt-integration-config-8d5d229a4af29f6466410c06f31f869b.png?vsn=d)
Subscribe to the # topic. You should see SolarAssistant messages appear.
![Test HomeAssistant MQTT messages](https://d26qlef5ak4prm.cloudfront.net/images/help/home_assistant/test-mqtt-624a4e24ac825f7c9daf2b3cf9b5571c.png?vsn=d)