MQTT Data Commands#
Commands that allow external programs to modify data in GbbOptimizer. Each command sends data to a dedicated topic and receives a result on {PlantId}/ha_gbb/api/result.
Command Result#
PUB
{PlantId}/ha_gbb/api/resultResult of each data command — OK or error description
| Field | Type | Description |
|---|---|---|
OrderId | string? | Copied from the request |
Result | string | "OK" or error description |
Data | object | Data from the original request |
SUBSetManualPrices Set manual energy prices
SUB
{PlantId}/ha_gbb/api/setmanualprices| Field | Type | Required | Description | |
|---|---|---|---|---|
OrderId | string | no | Text copied to the response | |
Data | array | yes | ||
Date | date | yes | Price date | |
StartHour | int (0-23) | yes | Start hour | |
StartMinute | int (0-59) | no | Minute (default 0) | |
PurchasePrice | decimal | no | Purchase price | |
TransferPrice | decimal | no | Transfer price | |
SalePrice | decimal | no | Sale price |
Example:
| |
SUBSetExtraLoads Set Extra Consumption
SUB
{PlantId}/ha_gbb/api/setextraloads| Field | Type | Required | Description | |
|---|---|---|---|---|
OrderId | string | no | Text copied to the response | |
Data | array | yes | ||
Date | date | yes | Date (today or tomorrow) | |
StartHour | int (0-23) | yes | Hour | |
StartMinute | int (0-59) | no | Minute (default 0) | |
TypeNo | int | yes | 0=EV, 1=Heat pump, 2=Other1, 3=Other2, …, 7=Other6 | |
ExtraLoads_kWh | decimal | yes | kWh |
Example:
| |
SUBSetRealTemperature Set real temperature
SUB
{PlantId}/ha_gbb/api/setrealtemperature| Field | Type | Required | Description | |
|---|---|---|---|---|
OrderId | string | no | Text copied to the response | |
Data | array | yes | ||
Date | date | yes | Date (yesterday, today, or tomorrow). If Hour is absent — hour taken from the date | |
Hour | int (0-23) | no | Temperature hour | |
RealTemperature | decimal | yes | Temperature (°C) |
Example:
| |
SUBSetOptimizer Set optimizer parameters
SUB
{PlantId}/ha_gbb/api/setoptimizer| Field | Type | Required | Description | |
|---|---|---|---|---|
OrderId | string | no | Text copied to the response | |
Data | object | yes | ||
Opt2_3x100Request | int | no | 0 or 1 — force 3h×100% | |
CurrentLoadProfileId | int | no | Consumption Profile ID | |
CurrentLoadProfileName | string | no | Consumption Profile name (case insensitive) |
Example:
| |
SUBSetCar Set EV car parameters
SUB
{PlantId}/ha_gbb/api/setcarThe “HomeAssistant EV Car” must be added in the program first. Only the provided parameters are updated — but the program requires current values for:
SOC,SOC_ChargeLimit,IsConnected,IsCharging,Position_Longitude,Position_Latitude.
| Field | Type | Required | Description | |
|---|---|---|---|---|
OrderId | string | no | Text copied to the response | |
Data | array | yes | Multiple cars can be updated | |
VIN | string | yes | Identification key. New VIN = new car (max 10) | |
BatteryKWh | decimal | no | Car battery capacity | |
ChargeA | decimal | no | Default charging current (A) | |
Phases | int | no | 1 or 3 phases | |
SOC | int | no | Current SOC | |
SOC_ChargeLimit | int | no | Target SOC | |
InService | bool | no | Whether the car is in service | |
IsConnected | bool | no | Whether connected to charger | |
IsCharging | bool | no | Whether currently charging | |
Position_Longitude | double | no | Longitude | |
Position_Latitude | double | no | Latitude |
Example:
| |
SUBSetHP Set heat pump parameters
SUB
{PlantId}/ha_gbb/api/sethp| Field | Type | Required | Description | |
|---|---|---|---|---|
OrderId | string | no | Text copied to the response | |
Data | object | yes | Only provided parameters are changed | |
HPForecast_Break_On | bool | no | Heat pump break: enable/disable | |
HPForecast_BreakFromDate | date | no | Break start date | |
HPForecast_BreakFromHour | int (0-23) | no | Break start hour | |
HPForecast_BreakToDate | date | no | Break end date (inclusive) | |
HPForecast_BreakToHour | int (0-23) | no | Break end hour (inclusive) |
Example:
| |