How simat/batterymonitor works
BatteryMonitor collects cell and system measurements from configurable BMS or Linux-based interfaces, derives battery state and demand, raises limit-driven alarms and BeagleBone I/O actions, and logs summaries for browser dashboards and optional MQTT publication. The main loop in batteries.py is the runtime orchestrator. Driver-to-reader wiring is configurable; the README documents the supported hardware model, but sampled excerpts do not establish every interface call. The graph omits uncertain driver links and shows documented optional integrations dashed.
Main entry points: batteries.py Monitor loop · getdata.py Readings · bms.py Bluetooth BMS · alarms.py Limit alarms
Components 21
Measurement acquisition
- Readings
getdata.py - Bluetooth BMS
bms.py - Pylontech driver
pylon.py - PIP inverter
pip.py - ADS1115 driver
ads1115.py
Monitoring and control
- Monitor loop
batteries.py - Runtime configuration
config.py - Solar demand manager
demandmanager.py - Limit alarms
alarms.py
Logging and display
- Summary and aggregation
summary.py - Summary and log files
- Battery web pages
html/batday.php - Summary page
html/battery.php - Excess power page
html/excesspwr.php
External interfaces
- BeagleBone I/O
beagle.py - MQTT publisher
mqtt.py - MQTT broker
- Bluetooth BMS board
Other components
- Battery operator
- Web browser
- Battery bank
Connections 23
- Battery operator → Monitor loop: starts monitor
- Monitor loop → Readings: creates readings
- Readings → Bluetooth BMS: configured acquisition
- Readings → Pylontech driver: configured acquisition
- Readings → PIP inverter: configured acquisition
- Readings → ADS1115 driver: configured acquisition
- Monitor loop → Runtime configuration: loads settings
- Readings → Battery bank: measures cells
- Bluetooth BMS → Bluetooth BMS board: reads serial data
- Readings → Monitor loop: returns measurements
- Monitor loop → Solar demand manager: calculates availability
- Monitor loop → Limit alarms: checks limits
- Limit alarms → BeagleBone I/O: sets I/O
- Monitor loop → Summary and aggregation: updates summaries
- Summary and aggregation → Summary and log files: writes records
- Monitor loop → MQTT publisher: publishes payload
- MQTT publisher → MQTT broker: sends messages
- Web browser → Battery web pages: requests display
- Battery web pages → Summary and log files: reads summary data
- Web browser → Summary page: requests summary
- Summary page → Summary and log files: reads summary file
- Web browser → Excess power page: requests power view
- Excess power page → Summary and log files: reads demand data