How tomquist/esphome-b2500 works
This repository combines a browser-based B2500 configuration and firmware workflow with the ESPHome component that runs on the resulting ESP32 firmware. The user edits and validates settings, previews or exports YAML, then can request a remote build, follow its status, decrypt the result and install it or download a ZIP. On-device, the component communicates with B2500 hardware over Bluetooth, decodes device messages into state, and exposes sensor entities and controls. The README documents legacy and native component configurations and MQTT topics; excerpts do not establish all build-service or component call wiring, so those links are limited.
Main entry points: b2500_base.cpp Bluetooth component · App.tsx App workflow · BuildModal.tsx Build dialog · b2500_state.cpp Device state
Components 27
Configuration web app
- App workflow
src/App.tsx - Config forms
src/components/ConfigForm.tsx - Storage settings
src/components/StorageForm.tsx - Config validation
src/utils/index.ts - YAML templates
src/templates.ts - YAML preview
src/components/SyntaxHighlighterComponent.tsx
Firmware build and install
- Build dialog
src/components/BuildModal.tsx - Config encryption
src/crypto.ts - Build status polling
src/firmware/buildStatus.ts - Firmware archive
src/firmware/firmwareBundle.ts - Archive decryption
src/firmware/archiveCrypto.ts - Firmware manifest
src/firmware/manifest.ts - Web serial installer
src/components/EspWebInstallButton.tsx
ESPHome device runtime
- Component configuration
components/b2500/__init__.py - Bluetooth component
components/b2500/b2500_base.cpp - Packet codec
components/b2500/b2500_codec.cpp - Device state
components/b2500/b2500_state.cpp - Protocol generations
components/b2500/b2500_v1.cpp
Device entities and controls
- Power sensors
components/b2500/sensor/b2500_sensor.cpp - Status sensors
components/b2500/binary_sensor/b2500_binary_sensor_base.cpp - Device info sensors
components/b2500/text_sensor/b2500_text_sensor.cpp - Controls and automations
components/b2500/__init__.py
Other components
- Browser user
- Build and artifact service
- B2500 battery
- MQTT broker
- ESP32 device
Connections 30
- Browser user → App workflow: edits config
- App workflow → Config forms: renders
- Config forms → Storage settings: configures storage
- App workflow → Config validation: validates
- App workflow → YAML templates: generates YAML
- App workflow → YAML preview: shows YAML
- App workflow → Build dialog: opens build
- Build dialog → Config encryption: encrypts config
- Build dialog → Build and artifact service: submits build
- Build and artifact service → Build status polling: publishes status
- Build dialog → Build status polling: polls status
- Build dialog → Firmware archive: fetches archive
- Firmware archive → Archive decryption: decrypts archive
- Firmware archive → Firmware manifest: reads manifest
- Build dialog → Web serial installer: offers install
- Web serial installer → ESP32 device: flashes firmware
- ESP32 device → Component configuration: loads component
- Component configuration → Bluetooth component: configures runtime
- Bluetooth component → Protocol generations: selects protocol
- Bluetooth component → Packet codec: encodes packets
- Bluetooth component → Device state: updates state
- B2500 battery → Bluetooth component: Bluetooth messages
- Power sensors → Device state: reads state
- Status sensors → Device state: reads state
- Device info sensors → Device state: reads state
- Controls and automations → Bluetooth component: registers actions
- Bluetooth component → B2500 battery: sends commands
- Power sensors → MQTT broker: publishes readings
- Status sensors → MQTT broker: publishes status
- Device info sensors → MQTT broker: publishes info