Charts in Home Assistant#

GbbOptimizer provides an interactive Battery Forecast chart that can be embedded in a Home Assistant dashboard as an iframe card.

Chart URL#

1
https://<address>/Forecast/IndexChart?PlantId=<PlantId>&PlantToken=<PlantToken>&NoMenu=1&ui-culture=en

Where:

  • <address> — your GbbOptimizer server address (see Server table), without < or >
  • <PlantId>PlantId of your installation
  • <PlantToken>PlantToken of your installation

If your PlantToken contains a plus sign (+), replace it in the URL with %2b. If it contains a slash (/), replace it with %2f.

To enable Dark Mode, append &DarkMode=1 to the end of the URL.

URL Builder#

Fill in the fields to automatically generate a ready-to-use address for Home Assistant:

Without https:// — see Server table

Embedding in Home Assistant#

Copy the generated URL and paste it into a Webpage card (or manually as an iframe):

1
2
3
type: iframe
url: "https://<address>/Forecast/IndexChart?PlantId=<PlantId>&PlantToken=<PlantToken>&NoMenu=1&ui-culture=en"
aspect_ratio: "16:9"

The chart requires internet access. If Home Assistant is running on a local network without access to external services, the chart will not load.

Alternative — Custom Charts from MQTT Data#

If you prefer to create charts locally, you can use data transmitted via MQTT (see Automation) combined with cards such as:

  • ApexCharts Card (HACS)
  • Mini Graph Card (HACS)
  • Built-in HA history cards

Ready-made package — GBB Forecast Downloader#

A ready-made Home Assistant package is available that automatically pulls the battery SOC forecast from GbbOptimizer via MQTT and exposes it as a sensor for visualization in ApexCharts Card.

Example battery SOC forecast chart

The package creates a sensor.gbb_battery_forecast sensor that queries the MQTT API for the forecast every 5 minutes and exposes data in its attributes (timestamps + SOC values). The forecast is displayed as a dashed line on an ApexCharts graph.

Installation:

  1. Make sure you have the MQTT bridge configured
  2. Copy the gbb_battery_forecast.yaml file to the /config/packages/ directory in Home Assistant
  3. Ensure packages are enabled in configuration.yaml:
    1
    2
    
    homeassistant:
      packages: !include_dir_named packages
  4. Install ApexCharts Card from HACS
  5. Restart Home Assistant

Full documentation and YAML file: HomeAssistant-pull-forecast-from-GbbOptimizer