Remarks:
- In HA, Mosquitto broker options: activate Customize and setup folder to: mosquitto
- In HA create file /share/mosquitto/GbbOptimizer.conf
connection GbbOptimizer_<plantID>
remote_username <plantID>
remote_password <plantToken>
address <mqtt address see here >:8883
bridge_capath /etc/ssl/certs
topic # both 2 ha_gbb/ <plantID>/ha_gbb/
- You should write yourself how commands from/to GbbOptimizer are translated to commands to/from Inverter.
- You should use HA Automation to process operation to inverter as describe bellow
Downloads
Data reading in mqtt by GbbOptimizer:
Program is waiting for data in mqtt in topic: <plantId>/ha_gbb/sensor.
In Payload should be send json data with following information:
- "soc_perc" (or "V" if 'Use Voltage (V) instead of SOC (Deye)' checked)
- "loads_total_kWh"
- "fromgrid_total_kWh"
- "togrid_total_kWh"
- "pv_total_kWh"
Following information are optional:
- "ev_charge_total_kWh"
- "hp_total_kWh"
- "other1_total_kWh"
- "other2_total_kWh"
- "other3_total_kWh"
- "other4_total_kWh"
- "other5_total_kWh"
- "other6_total_kWh"
Remarks:
- Total counters can be reseted from time to time, so it could be for example "daily counters".
- Values<0 is treated as null: no data, wait for data
- Only optional data (one or more) can be sent if main data are imported from inverter. In this case, in the IoT menu you must add the Home Assistant system and counter for each type of optional data you want to import.
- If pv_total_kWh was sent it will be added to PV imported from inverter, if on menu 'PV Forecast' -> button 'Edit' of one of PVField -> 'Data source of PV real production'='HomeAssistant'
- Solarman/DeyeCloud: In main data "soc_perc" can be send separately if checked "SOC data are sending by HomeAssistant/SolarAssistant (not imported from Inverter)"
- Solarman/DeyeCloud: In main data "fromgrid_total_kWh", "togrid_total_kWh" can be send separately if selected "FromGrid and ToGrid data are imported from HomeAssistant/SolarAssistant"
- Solarman/DeyeCloud: In main data "loads_total_kWh" can be send separately if checked "Loads data are sending from HomeAssistant/SolarAssistant"
Example of mqtt publish configuration:
alias: mqtt_publikacja
trigger:
- platform: time_pattern
minutes: /5
action:
- service: mqtt.publish
data:
qos: "0"
retain: false
payload_template: |2-
{
"loads_total_kWh": {{ states.sensor.easun_out_total_daily_energy.state | float(-1) }},
"fromgrid_total_kWh": {{ states.sensor.easun_in_total_daily_energy.state | float(-1) }},
"pv_total_kWh": {{ states.sensor.total_daily_energy_offgrid.state | float(-1) }},
"soc_perc": {{ states.sensor.easun_battery_soc.state | float(-1) }},
"togrid_total_kWh": 0,
}
topic: ha_gbb/sensor
Commands reiceived from GbbOptimizer:
Program sends following topics:
- <plantid>/ha_gbb/Start_Charge - start charge up to SOC specify in payload (see below) from PV and grid. When SOC level is riched: stop charge from grid, stop discharge battery, can charge from PV
- <plantid>/ha_gbb/Start_Discharge - start discharge from battery to grid
- <plantid>/ha_gbb/Start_DisableCharge - stop charge battery, send PV to loads and grid
- <plantid>/ha_gbb/Start_Normal - return to normal operation (PV to loads than to battery than to grid, Loads from PV than from battery than from grid)
In parallel program send the same information to one topic:
As payload program sends JSON data with following properties: {"Hour":22, "FromMinute":0, "ToMinute":59, "PriceLessZero":0, "Operation":"Normal", "SOC":90}
- Hour
- FromMinute
- ToMinute
- DischargeLimitW
- ChargeLimitW
- InputLimitW
- PriceLessZero: 0 - normal purchase price, 1- price<0
- Operation: "Normal", "Discharge", "DisableCharge", "Charge"
- SOC: SOC level to charge to
- V: SOC converted to V (if 'Use Voltage (V) instead of SOC (Deye)' checked)
Example of mqtt trigger:
alias: mqtt output_source_priority_battery
description: ""
trigger:
- platform: mqtt
topic: ha_gbb/Start_Charge
condition: []
action:
- service: switch.turn_on
target:
entity_id: switch.bms_1_output_source_priority_battery
data: {}
mode: single