MQTT Topics for Home Assistant#
Topics used for communication between GbbOptimizer and Home Assistant / GbbConnect.
Data from Home Assistant to GbbOptimizer#
SUB
{PlantId}/ha_gbb/sensorQoS 0HA sensor data — cumulative counters
Required fields:
| Field | Type | Description |
|---|---|---|
soc_perc | decimal | Battery SOC (%). Use V if “Control via V” is checked |
loads_total_kWh | decimal | Consumption — cumulative counter |
fromgrid_total_kWh | decimal | Grid import — cumulative counter |
togrid_total_kWh | decimal | Grid export — cumulative counter |
pv_total_kWh | decimal | PV production — cumulative counter |
Optional fields:
| Field | Type | Description |
|---|---|---|
ev_charge_total_kWh | decimal | EV charging |
hp_total_kWh | decimal | Heat pump |
other1_total_kWh – other6_total_kWh | decimal | Other 1–6 |
Multiple PV sources:
| |
- Counters may reset — you can send daily counters for example
- Values < 0 are treated as missing data
- You can send only optional data if the main data is imported from the inverter. In that case add the HomeAssistant system in the IoT menu
pv_total_kWhis the same as"more"withnumber=1— do not use both at the same time- Solarman/DeyeCloud: individual fields (
soc_perc,fromgrid_total_kWh,togrid_total_kWh,loads_total_kWh) can be sent separately if the corresponding options are checked in installation parameters
Commands from GbbOptimizer to Home Assistant#
GbbOptimizer sends control commands to dedicated topics:
PUB
{PlantId}/ha_gbb/Start_ChargeStart charging battery to SOC from Payload
PUB
{PlantId}/ha_gbb/Start_DischargeStart discharging battery to grid (to SOC from Payload)
PUB
{PlantId}/ha_gbb/Start_DisableChargeDo not charge battery — PV to home and grid
PUB
{PlantId}/ha_gbb/Start_NormalReturn to normal operation
In parallel, the same data is sent to:
PUB
{PlantId}/ha_gbb/EMSCombined EMS command with full JSON payload
JSON Payload:
| Field | Type | Description |
|---|---|---|
Hour | int | Hour |
FromMinute | int | Start minute |
ToMinute | int | End minute |
DischargeLimitW | int | Discharge limit (W) |
ChargeLimitW | int | Charge limit (W) |
InputLimitW | int | Import limit (W) |
PriceLessZero | int | 0 = normal price, 1 = price < 0 |
Operation | string | "Normal", "Discharge", "DisableCharge" or "Charge" |
SOC | int | Target SOC |
V | decimal | SOC converted to V (if control via V) |
Example:
| |
HA Automation Example#
| |
Example: Publishing Data to MQTT#
| |