How har1x/ha-franklinwh-modbus works
FranklinWH Modbus is a Home Assistant integration for monitoring and controlling an aGate over local Modbus TCP, with optional cloud writes for operating mode and reserve settings. Users configure and validate a local connection, then the integration polls status into a coordinator that feeds Home Assistant entities. Control entities issue local commands or optional cloud operations; battery commands also use a persisted safety deadline. The README documents the sensor and control capabilities; sampled code shows the coordinator/entity path and optional cloud behavior, but not all platform implementations or the local client library.
Main entry points: coordinator.py Status coordinator · __init__.py Integration setup · select.py Mode selector · switch.py Charge/discharge switches
Components 19
Setup and options
- Setup flow
custom_components/ha_franklinwh_modbus/config_flow.py - Integration setup
custom_components/ha_franklinwh_modbus/__init__.py - Options and defaults
custom_components/ha_franklinwh_modbus/const.py
Polling and state
- Local Modbus client
- Status coordinator
custom_components/ha_franklinwh_modbus/coordinator.py - Command deadline
custom_components/ha_franklinwh_modbus/coordinator.py
Home Assistant entities
- Shared entity base
custom_components/ha_franklinwh_modbus/entity.py - Status sensors
custom_components/ha_franklinwh_modbus/sensor.py - Alarm sensors
custom_components/ha_franklinwh_modbus/binary_sensor.py
Control paths
- Cloud API client
custom_components/ha_franklinwh_modbus/cloud.py - Mode selector
custom_components/ha_franklinwh_modbus/select.py - Reserve controls
custom_components/ha_franklinwh_modbus/number.py - Battery power controls
custom_components/ha_franklinwh_modbus/number.py - Command duration
custom_components/ha_franklinwh_modbus/number.py - Charge/discharge switches
custom_components/ha_franklinwh_modbus/switch.py
Other components
- Home Assistant user
- FranklinWH aGate
- FranklinWH cloud
- Home Assistant
Connections 29
- Home Assistant user → Setup flow: configures
README.md - Setup flow → Local Modbus client: validates connection
custom_components/ha_franklinwh_modbus/config_flow.py - Integration setup → Local Modbus client: connects and reads
custom_components/ha_franklinwh_modbus/__init__.py - Integration setup → Status coordinator: creates
custom_components/ha_franklinwh_modbus/__init__.py - Integration setup → Cloud API client: optionally creates
custom_components/ha_franklinwh_modbus/__init__.py - Integration setup → Home Assistant: registers entities
custom_components/ha_franklinwh_modbus/__init__.py - Setup flow → Options and defaults: uses defaults
custom_components/ha_franklinwh_modbus/config_flow.py - Local Modbus client → FranklinWH aGate: Modbus TCP
README.md - Status coordinator → Local Modbus client: polls status
custom_components/ha_franklinwh_modbus/coordinator.py - Status coordinator → Command deadline: persists deadlines
custom_components/ha_franklinwh_modbus/coordinator.py - Shared entity base → Status coordinator: observes state
custom_components/ha_franklinwh_modbus/entity.py - Status sensors → Shared entity base: extends
custom_components/ha_franklinwh_modbus/sensor.py - Alarm sensors → Shared entity base: extends
custom_components/ha_franklinwh_modbus/binary_sensor.py - Mode selector → Status coordinator: reads and writes
custom_components/ha_franklinwh_modbus/select.py - Mode selector → Local Modbus client: sets mode locally
custom_components/ha_franklinwh_modbus/select.py - Mode selector → Cloud API client: optionally sets mode
custom_components/ha_franklinwh_modbus/select.py - Reserve controls → Status coordinator: reads state
custom_components/ha_franklinwh_modbus/number.py - Reserve controls → Cloud API client: optionally updates reserve
custom_components/ha_franklinwh_modbus/number.py - Cloud API client → FranklinWH cloud: sends API requests
custom_components/ha_franklinwh_modbus/cloud.py - Charge/discharge switches → Status coordinator: gets power and deadline
custom_components/ha_franklinwh_modbus/switch.py - Charge/discharge switches → Local Modbus client: starts commands
custom_components/ha_franklinwh_modbus/switch.py - Charge/discharge switches → Battery power controls: reads setpoint
custom_components/ha_franklinwh_modbus/switch.py - Battery power controls → Status coordinator: uses limits
custom_components/ha_franklinwh_modbus/number.py - Command duration → Status coordinator: configures timeout
custom_components/ha_franklinwh_modbus/number.py - Home Assistant → Status sensors: displays measurements
README.md - Home Assistant → Alarm sensors: displays alarms
README.md - Home Assistant → Mode selector: selects mode
README.md - Home Assistant → Reserve controls: sets reserve
README.md - Home Assistant → Charge/discharge switches: controls battery
README.md