Mosquitto Bridge#
For GbbOptimizer to communicate with Home Assistant, you need to configure a bridge between the local Mosquitto broker in HA and the GbbOptimizer MQTT server.
Requirements#
- Home Assistant with the Mosquitto broker add-on installed
- An active installation in GbbOptimizer with an assigned PlantId and PlantToken
- MQTT server address — see MQTT Servers
Step-by-Step Configuration#
1. Enable the configuration folder in Mosquitto#
In Home Assistant go to Settings -> Add-ons -> Mosquitto broker -> Configuration.
Activate the Customize option and set the folder to:
| |
2. Create the bridge configuration file#
Create the file /share/mosquitto/GbbOptimizer.conf with the following content:
| |
Replace:
<PlantId>— with your PlantId<PlantToken>— with your PlantToken<mqtt-server-address>— with the server address from the MQTT Servers table
3. Restart Mosquitto#
After saving the file, restart the Mosquitto broker add-on in Home Assistant.
The connection uses port 8883 (MQTT over TLS). CA certificates are taken from
/etc/ssl/certs— no need to add your own.
How the Bridge Works#
The topic line in the configuration maps topics:
| Direction | Local topic (HA) | Remote topic (GbbOptimizer) |
|---|---|---|
| HA -> GbbOptimizer | ha_gbb/# | <PlantId>/ha_gbb/# |
| GbbOptimizer -> HA | ha_gbb/# | <PlantId>/ha_gbb/# |
This means:
- Sensor data sent to
ha_gbb/sensorin HA reaches GbbOptimizer as<PlantId>/ha_gbb/sensor - Commands from GbbOptimizer (e.g.
<PlantId>/ha_gbb/Start_Charge) appear in HA asha_gbb/Start_Charge
Bridge for SolarAssistant#
If you use SolarAssistant, change the topic line to:
| |
More information: SolarAssistant
Bridge for evcc#
If you are integrating with evcc, add a separate topic line:
| |
More information: evcc
Make sure that PlantId and PlantToken are correct. Incorrect credentials will cause a connection failure — check the Mosquitto logs in HA.