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:

1
mosquitto

2. Create the bridge configuration file#

Create the file /share/mosquitto/GbbOptimizer.conf with the following content:

1
2
3
4
5
6
connection GbbOptimizer_<PlantId>
remote_username <PlantId>
remote_password <PlantToken>
address <mqtt-server-address>:8883
bridge_capath /etc/ssl/certs
topic # both 2 ha_gbb/ <PlantId>/ha_gbb/

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:

DirectionLocal topic (HA)Remote topic (GbbOptimizer)
HA -> GbbOptimizerha_gbb/#<PlantId>/ha_gbb/#
GbbOptimizer -> HAha_gbb/#<PlantId>/ha_gbb/#

This means:

  • Sensor data sent to ha_gbb/sensor in HA reaches GbbOptimizer as <PlantId>/ha_gbb/sensor
  • Commands from GbbOptimizer (e.g. <PlantId>/ha_gbb/Start_Charge) appear in HA as ha_gbb/Start_Charge

Bridge for SolarAssistant#

If you use SolarAssistant, change the topic line to:

1
topic # both 2 solar_assistant/ <PlantId>/solar_assistant/

More information: SolarAssistant

Bridge for evcc#

If you are integrating with evcc, add a separate topic line:

1
topic # both 2 evcc/loadpoints/ <PlantId>/evcc/site/loadpoints/

More information: evcc

Make sure that PlantId and PlantToken are correct. Incorrect credentials will cause a connection failure — check the Mosquitto logs in HA.