# thomluther/ha-anker-solix architecture

> Architecture diagram of the GitHub repository thomluther/ha-anker-solix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thomluther/ha-anker-solix
- Repository: https://github.com/thomluther/ha-anker-solix

## Overview

Anker Solix is a Home Assistant integration for monitoring and controlling Anker power-system devices. Users configure an account, the integration retrieves cloud data (with MQTT as an optional device-data/control channel), and Home Assistant exposes the resulting device, system, and account data as entities and controls. The graph preserves the cloud/API, MQTT, and entity-platform branches. Source excerpts are partial; links to unsampled subsystems are included only where the README or source index supports them.

Main entry points: [`custom_components/anker_solix/coordinator.py`](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/coordinator.py) (Data coordinator), [`custom_components/anker_solix/solixapi/api.py`](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/api.py) (Solix API), [`custom_components/anker_solix/solixapi/mqtt_device.py`](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqtt_device.py) (MQTT device control), [`custom_components/anker_solix/api_client.py`](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/api_client.py) (Integration client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and runtime"]
  node_config["Configuration flow<br/>[config_flow.py]"]
  node_client["Integration client<br/>[api_client.py]"]
  node_coordinator["Data coordinator<br/>[coordinator.py]"]
end

subgraph group_cloud["Cloud API"]
  node_api["Solix API<br/>[api.py]"]
  node_base["API transport base<br/>[apibase.py]"]
  node_session["Cloud session<br/>[session.py]"]
  node_types["API data types<br/>[apitypes.py]"]
  node_hes["Home energy systems<br/>[hesapi.py]"]
  node_poller["Device poller<br/>[poller.py]"]
  node_schedule["Schedules and plans<br/>[schedule.py]"]
end

subgraph group_mqtt["MQTT devices"]
  node_mqtt_device["MQTT device control<br/>[mqtt_device.py]"]
  node_mqtt_factory["MQTT device factory<br/>[mqtt_factory.py]"]
  node_mqtt_map["MQTT state mappings<br/>[mqttmap.py]"]
  node_mqtt_commands["MQTT command mappings<br/>[mqttcmdmap.py]"]
end

subgraph group_ha["Home Assistant entities"]
  node_entity["Shared entity model<br/>[entity.py]"]
  node_sensor["Monitoring entities<br/>[sensor.py]"]
  node_controls["Device controls<br/>[number.py]"]
  node_select["Select controls<br/>[select.py]"]
  node_switch["Switch controls<br/>[switch.py]"]
  node_button["Action controls<br/>[button.py]"]
  node_datetime["Date and time controls<br/>[datetime.py]"]
  node_time["Time controls<br/>[time.py]"]
  node_services["Integration services<br/>[services.py]"]
end

node_user(("Home Assistant user"))
node_cloud_service{{"Anker cloud API"}}
node_mqtt_service{{"Anker MQTT service"}}

node_user -->|"configures"| node_config
node_config -.->|"provides settings"| node_client
node_client -->|"calls"| node_api
node_client -->|"creates devices"| node_mqtt_factory
node_client -->|"tracks devices"| node_mqtt_device
node_coordinator -->|"refreshes data"| node_client
node_api -->|"uses transport"| node_base
node_base -->|"uses session"| node_session
node_session -->|"authenticates and requests"| node_cloud_service
node_api -->|"retrieves device data"| node_cloud_service
node_api -->|"uses definitions"| node_types
node_api -->|"uses HES support"| node_hes
node_api -->|"uses polling"| node_poller
node_api -->|"uses scheduling"| node_schedule
node_mqtt_device -.->|"communicates"| node_mqtt_service
node_mqtt_factory -.->|"creates instances"| node_mqtt_device
node_mqtt_device -.->|"decodes device data"| node_mqtt_map
node_mqtt_device -.->|"encodes commands"| node_mqtt_commands
node_mqtt_device -->|"uses definitions"| node_types
node_coordinator -.->|"provides shared data"| node_entity
node_sensor -->|"reads updates"| node_coordinator
node_controls -->|"reads and updates"| node_coordinator
node_select -->|"reads and updates"| node_coordinator
node_switch -->|"reads and updates"| node_coordinator
node_button -->|"invokes actions"| node_coordinator
node_datetime -->|"reads and updates"| node_coordinator
node_time -->|"reads and updates"| node_coordinator
node_services -->|"uses shared model"| node_entity

click node_config "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/config_flow.py"
click node_client "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/api_client.py"
click node_coordinator "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/coordinator.py"
click node_api "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/api.py"
click node_base "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/apibase.py"
click node_session "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/session.py"
click node_types "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/apitypes.py"
click node_hes "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/hesapi.py"
click node_poller "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/poller.py"
click node_schedule "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/schedule.py"
click node_mqtt_device "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqtt_device.py"
click node_mqtt_factory "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqtt_factory.py"
click node_mqtt_map "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqttmap.py"
click node_mqtt_commands "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqttcmdmap.py"
click node_entity "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/entity.py"
click node_sensor "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/sensor.py"
click node_controls "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/number.py"
click node_select "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/select.py"
click node_switch "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/switch.py"
click node_button "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/button.py"
click node_datetime "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/datetime.py"
click node_time "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/time.py"
click node_services "https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/services.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config,node_client,node_coordinator,node_user toneBlue
class node_api,node_base,node_session,node_types,node_hes,node_poller,node_schedule toneAmber
class node_mqtt_device,node_mqtt_factory,node_mqtt_map,node_mqtt_commands,node_cloud_service toneMint
class node_entity,node_sensor,node_controls,node_select,node_switch,node_button,node_datetime,node_time,node_services toneRose
class node_mqtt_service toneIndigo
```

## Components

### Setup and runtime

- [Configuration flow](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/config_flow.py): `custom_components/anker_solix/config_flow.py`
- [Integration client](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/api_client.py): `custom_components/anker_solix/api_client.py`
- [Data coordinator](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/coordinator.py): `custom_components/anker_solix/coordinator.py`

### Cloud API

- [Solix API](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/api.py): `custom_components/anker_solix/solixapi/api.py`
- [API transport base](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/apibase.py): `custom_components/anker_solix/solixapi/apibase.py`
- [Cloud session](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/session.py): `custom_components/anker_solix/solixapi/session.py`
- [API data types](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/apitypes.py): `custom_components/anker_solix/solixapi/apitypes.py`
- [Home energy systems](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/hesapi.py): `custom_components/anker_solix/solixapi/hesapi.py`
- [Device poller](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/poller.py): `custom_components/anker_solix/solixapi/poller.py`
- [Schedules and plans](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/schedule.py): `custom_components/anker_solix/solixapi/schedule.py`

### MQTT devices

- [MQTT device control](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqtt_device.py): `custom_components/anker_solix/solixapi/mqtt_device.py`
- [MQTT device factory](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqtt_factory.py): `custom_components/anker_solix/solixapi/mqtt_factory.py`
- [MQTT state mappings](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqttmap.py): `custom_components/anker_solix/solixapi/mqttmap.py`
- [MQTT command mappings](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/solixapi/mqttcmdmap.py): `custom_components/anker_solix/solixapi/mqttcmdmap.py`

### Home Assistant entities

- [Shared entity model](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/entity.py): `custom_components/anker_solix/entity.py`
- [Monitoring entities](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/sensor.py): `custom_components/anker_solix/sensor.py`
- [Device controls](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/number.py): `custom_components/anker_solix/number.py`
- [Select controls](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/select.py): `custom_components/anker_solix/select.py`
- [Switch controls](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/switch.py): `custom_components/anker_solix/switch.py`
- [Action controls](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/button.py): `custom_components/anker_solix/button.py`
- [Date and time controls](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/datetime.py): `custom_components/anker_solix/datetime.py`
- [Time controls](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/time.py): `custom_components/anker_solix/time.py`
- [Integration services](https://github.com/thomluther/ha-anker-solix/blob/main/custom_components/anker_solix/services.py): `custom_components/anker_solix/services.py`

### Other components

- **Home Assistant user**
- **Anker cloud API**
- **Anker MQTT service**

## Connections

- Home Assistant user → Configuration flow: configures (evidence: `README.md`)
- Configuration flow → Integration client: provides settings (evidence: `custom_components/anker_solix/config_flow.py`)
- Integration client → Solix API: calls (evidence: `custom_components/anker_solix/api_client.py`)
- Integration client → MQTT device factory: creates devices (evidence: `custom_components/anker_solix/api_client.py`)
- Integration client → MQTT device control: tracks devices (evidence: `custom_components/anker_solix/api_client.py`)
- Data coordinator → Integration client: refreshes data (evidence: `custom_components/anker_solix/coordinator.py`)
- Solix API → API transport base: uses transport (evidence: `custom_components/anker_solix/solixapi/api.py`)
- API transport base → Cloud session: uses session (evidence: `custom_components/anker_solix/solixapi/apibase.py`)
- Cloud session → Anker cloud API: authenticates and requests (evidence: `custom_components/anker_solix/solixapi/session.py`)
- Solix API → Anker cloud API: retrieves device data (evidence: `README.md`)
- Solix API → API data types: uses definitions (evidence: `custom_components/anker_solix/solixapi/api.py`)
- Solix API → Home energy systems: uses HES support (evidence: `custom_components/anker_solix/solixapi/api.py`)
- Solix API → Device poller: uses polling (evidence: `custom_components/anker_solix/solixapi/api.py`)
- Solix API → Schedules and plans: uses scheduling (evidence: `custom_components/anker_solix/solixapi/api.py`)
- MQTT device control → Anker MQTT service: communicates (evidence: `README.md`)
- MQTT device factory → MQTT device control: creates instances (evidence: `custom_components/anker_solix/api_client.py`)
- MQTT device control → MQTT state mappings: decodes device data (evidence: `custom_components/anker_solix/solixapi/mqtt_device.py`)
- MQTT device control → MQTT command mappings: encodes commands (evidence: `custom_components/anker_solix/solixapi/mqtt_device.py`)
- MQTT device control → API data types: uses definitions (evidence: `custom_components/anker_solix/solixapi/mqtt_device.py`)
- Data coordinator → Shared entity model: provides shared data (evidence: `custom_components/anker_solix/coordinator.py`)
- Monitoring entities → Data coordinator: reads updates (evidence: `custom_components/anker_solix/sensor.py`)
- Device controls → Data coordinator: reads and updates (evidence: `custom_components/anker_solix/number.py`)
- Select controls → Data coordinator: reads and updates (evidence: `custom_components/anker_solix/select.py`)
- Switch controls → Data coordinator: reads and updates (evidence: `custom_components/anker_solix/switch.py`)
- Action controls → Data coordinator: invokes actions (evidence: `custom_components/anker_solix/button.py`)
- Date and time controls → Data coordinator: reads and updates (evidence: `custom_components/anker_solix/datetime.py`)
- Time controls → Data coordinator: reads and updates (evidence: `custom_components/anker_solix/time.py`)
- Integration services → Shared entity model: uses shared model (evidence: `custom_components/anker_solix/services.py`)
