How prabhunde/bess works
This is an AC-coupled battery-storage plant simulator and EMS lab. The main runtime starts a shared plant state, MQTT integration, a timestep engine, optional CSV logging, and a Flask operator dashboard. Each engine tick samples PV and load, applies scenario inputs and EMS mode selection, advances battery/PCS behavior, then publishes telemetry and optionally archives it. Operators can view live state and submit overrides, faults, and scenarios; an external EMS can send mode commands over MQTT. Some links to unsampled modules are omitted or marked unverified.
Main entry points: simulator_engine.py Simulation engine · app.py Runtime entry · dashboard/app.py Dashboard API · state_manager.py Shared plant state
Components 18
Runtime coordination
- Runtime entry
app.py - Plant configuration
config.py - Shared plant state
state_manager.py
Plant simulation
- Simulation engine
simulator_engine.py - Solar model
solar_model.py - Load model
load_model.py - Battery model
battery_model.py - Embedded EMS policy
embedded_simple_ems.py - EMS mode logic
ems_logic.py
EMS and telemetry
- MQTT manager
mqtt_manager.py - CSV archive
csv_logger.py
Operator tools
- Scenario presets
scenario_lab.py - Dashboard API
dashboard/app.py - Dashboard page
dashboard/templates/index.html - Dashboard client
dashboard/static/simple_lab.js
Other components
- Operator
- External EMS
- MQTT broker
Connections 25
- Operator → Dashboard API: uses controls
README.md - Runtime entry → Shared plant state: creates
app.py - Runtime entry → MQTT manager: starts
app.py - Runtime entry → Simulation engine: starts
app.py - Runtime entry → CSV archive: configures
app.py - Runtime entry → Dashboard API: runs
app.py - Runtime entry → Plant configuration: reads settings
app.py - Dashboard API → Shared plant state: reads and updates
dashboard/app.py - Dashboard API → Dashboard page: renders
dashboard/app.py - Dashboard API → Plant configuration: reads settings
dashboard/app.py - Dashboard client → Dashboard API: uses API
- Simulation engine → Shared plant state: reads and updates
simulator_engine.py - Simulation engine → Solar model: samples
simulator_engine.py - Simulation engine → Load model: samples
simulator_engine.py - Simulation engine → Battery model: advances SOC
simulator_engine.py - Simulation engine → Embedded EMS policy: selects mode
simulator_engine.py - Simulation engine → Plant configuration: reads settings
simulator_engine.py - Simulation engine → MQTT manager: publishes telemetry
app.py - Simulation engine → CSV archive: appends rows
simulator_engine.py - Shared plant state → Scenario presets: resolves scenario
state_manager.py - Shared plant state → EMS mode logic: normalizes mode
state_manager.py - MQTT manager → MQTT broker: publishes and subscribes
mqtt_manager.py - External EMS → MQTT broker: sends commands
README.md - MQTT broker → MQTT manager: delivers commands
README.md - MQTT manager → Shared plant state: forwards commands
app.py