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/result

Result of each data command — OK or error description

FieldTypeDescription
OrderIdstring?Copied from the request
Resultstring"OK" or error description
DataobjectData from the original request

SetManualPrices Set manual energy prices
{PlantId}/ha_gbb/api/setmanualprices
FieldTypeRequiredDescription
OrderIdstringnoText copied to the response
Dataarrayyes
DatedateyesPrice date
StartHourint (0-23)yesStart hour
StartMinuteint (0-59)noMinute (default 0)
PurchasePricedecimalnoPurchase price
TransferPricedecimalnoTransfer price
SalePricedecimalnoSale price

Example:

1
2
3
4
5
{
  "Data": [
    {"Date": "2024-04-20", "StartHour": 20, "PurchasePrice": 0.23}
  ]
}
SetExtraLoads Set Extra Consumption
{PlantId}/ha_gbb/api/setextraloads
FieldTypeRequiredDescription
OrderIdstringnoText copied to the response
Dataarrayyes
DatedateyesDate (today or tomorrow)
StartHourint (0-23)yesHour
StartMinuteint (0-59)noMinute (default 0)
TypeNointyes0=EV, 1=Heat pump, 2=Other1, 3=Other2, …, 7=Other6
ExtraLoads_kWhdecimalyeskWh

Example:

1
2
3
4
5
{
  "Data": [
    {"Date": "2024-04-20", "StartHour": 20, "TypeNo": 1, "ExtraLoads_kWh": 1.23}
  ]
}
SetRealTemperature Set real temperature
{PlantId}/ha_gbb/api/setrealtemperature
FieldTypeRequiredDescription
OrderIdstringnoText copied to the response
Dataarrayyes
DatedateyesDate (yesterday, today, or tomorrow). If Hour is absent — hour taken from the date
Hourint (0-23)noTemperature hour
RealTemperaturedecimalyesTemperature (°C)

Example:

1
2
3
4
5
{
  "Data": [
    {"Date": "2024-04-20", "Hour": 20, "RealTemperature": 1.23}
  ]
}
SetOptimizer Set optimizer parameters
{PlantId}/ha_gbb/api/setoptimizer
FieldTypeRequiredDescription
OrderIdstringnoText copied to the response
Dataobjectyes
Opt2_3x100Requestintno0 or 1 — force 3h×100%
CurrentLoadProfileIdintnoConsumption Profile ID
CurrentLoadProfileNamestringnoConsumption Profile name (case insensitive)

Example:

1
{"Data": {"Opt2_3x100Request": 1}}
SetCar Set EV car parameters
{PlantId}/ha_gbb/api/setcar

The “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.

FieldTypeRequiredDescription
OrderIdstringnoText copied to the response
DataarrayyesMultiple cars can be updated
VINstringyesIdentification key. New VIN = new car (max 10)
BatteryKWhdecimalnoCar battery capacity
ChargeAdecimalnoDefault charging current (A)
Phasesintno1 or 3 phases
SOCintnoCurrent SOC
SOC_ChargeLimitintnoTarget SOC
InServiceboolnoWhether the car is in service
IsConnectedboolnoWhether connected to charger
IsChargingboolnoWhether currently charging
Position_LongitudedoublenoLongitude
Position_LatitudedoublenoLatitude

Example:

1
2
3
4
5
{
  "Data": [
    {"VIN": "vin1234", "SOC": 40, "SOC_ChargeLimit": 90}
  ]
}
SetHP Set heat pump parameters
{PlantId}/ha_gbb/api/sethp
FieldTypeRequiredDescription
OrderIdstringnoText copied to the response
DataobjectyesOnly provided parameters are changed
HPForecast_Break_OnboolnoHeat pump break: enable/disable
HPForecast_BreakFromDatedatenoBreak start date
HPForecast_BreakFromHourint (0-23)noBreak start hour
HPForecast_BreakToDatedatenoBreak end date (inclusive)
HPForecast_BreakToHourint (0-23)noBreak end hour (inclusive)

Example:

1
2
3
4
5
6
7
{
  "Data": {
    "HPForecast_Break_On": true,
    "HPForecast_BreakToDate": "2026-01-30",
    "HPForecast_BreakToHour": 23
  }
}