How bebbssos/ha-defa-power works
This is a Home Assistant integration for DEFA Power and eRange EV chargers. Users configure CloudCharge credentials, after which the integration discovers chargepoints and connectors, polls charger data, and exposes entities and actions for monitoring and control. The graph separates setup, data coordination, Home Assistant entities/actions, and the CloudCharge API. Several capabilities are documented in the README but their implementation details were not sampled; those branches are included without inventing internal call paths.
Main entry points: client.py API client · coordinator.py Data coordinators · __init__.py Entry setup · services.py Services and schedules
Components 20
Setup and runtime
- Configuration flow
custom_components/defa_power/config_flow.py - Entry setup
custom_components/defa_power/__init__.py - Runtime data
custom_components/defa_power/models.py - Device metadata
custom_components/defa_power/devices.py
Charger data
- Data coordinators
custom_components/defa_power/coordinator.py
Home Assistant features
- Sensors
custom_components/defa_power/sensor.py - Binary sensors
custom_components/defa_power/binary_sensor.py - Current and eco controls
custom_components/defa_power/number.py - Switch controls
custom_components/defa_power/switch.py - Selection controls
custom_components/defa_power/select.py - Charger actions
custom_components/defa_power/button.py - Services and schedules
custom_components/defa_power/services.py - Diagnostics
custom_components/defa_power/diagnostics.py - ID anonymizer
custom_components/defa_power/utils/id_anonymizer.py
CloudCharge API
- API client
custom_components/defa_power/cloudcharge_api/client.py - API data models
custom_components/defa_power/cloudcharge_api/models.py - API exceptions
custom_components/defa_power/cloudcharge_api/exceptions.py
Other components
- Home Assistant user
- Home Assistant
- CloudCharge service
Connections 28
- Home Assistant user → Configuration flow: configures
README.md - Home Assistant → Entry setup: loads entry
custom_components/defa_power/__init__.py - Configuration flow → API client: authenticates
custom_components/defa_power/config_flow.py - Entry setup → API client: creates client
custom_components/defa_power/__init__.py - Entry setup → Data coordinators: initializes
custom_components/defa_power/__init__.py - Entry setup → Device metadata: creates devices
custom_components/defa_power/__init__.py - Entry setup → Runtime data: stores runtime
custom_components/defa_power/__init__.py - Entry setup → Services and schedules: sets up services
custom_components/defa_power/__init__.py - Data coordinators → API client: fetches data
custom_components/defa_power/coordinator.py - API client → CloudCharge service: sends requests
custom_components/defa_power/cloudcharge_api/client.py - API client → API data models: uses typed data
custom_components/defa_power/cloudcharge_api/client.py - API client → API exceptions: raises errors
custom_components/defa_power/cloudcharge_api/client.py - Sensors → Data coordinators: reads updates
custom_components/defa_power/sensor.py - Binary sensors → Data coordinators: reads updates
custom_components/defa_power/binary_sensor.py - Current and eco controls → Data coordinators: reads updates
custom_components/defa_power/number.py - Current and eco controls → API client: sets values
custom_components/defa_power/number.py - Switch controls → Data coordinators: reads updates
custom_components/defa_power/switch.py - Switch controls → API client: controls charger
custom_components/defa_power/switch.py - Selection controls → Data coordinators: reads updates
custom_components/defa_power/select.py - Selection controls → API client: sets options
custom_components/defa_power/select.py - Charger actions → Data coordinators: refreshes data
custom_components/defa_power/button.py - Charger actions → API client: sends commands
custom_components/defa_power/button.py - Home Assistant user → Services and schedules: invokes actions
README.md - Services and schedules → API client: controls charger
custom_components/defa_power/services.py - Services and schedules → Data coordinators: refreshes data
custom_components/defa_power/services.py - Diagnostics → ID anonymizer: anonymizes IDs
custom_components/defa_power/diagnostics.py - Diagnostics → Runtime data: reports runtime
custom_components/defa_power/diagnostics.py - API client → CloudCharge service: manages schedules
README.md