# thomluther/anker-solix-api architecture

> Architecture diagram of the GitHub repository thomluther/anker-solix-api, 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/anker-solix-api
- Repository: https://github.com/thomluther/anker-solix-api

## Overview

Anker Solix API is an experimental Python client for monitoring and controlling Anker energy devices. A client application uses the API facade to authenticate and retrieve site/device data; polling and domain modules cover energy, schedules, chargers, vehicles, and PowerPanel/HES capabilities. MQTT provides a parallel device-control path, with device-specific handlers selected by a factory. Export and shared helpers support these workflows. Edges are limited to relationships shown in excerpts or the source index; unsampled call details are left unasserted or marked unverified.

Main entry points: [`src/anker_solix_api/api.py`](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/api.py) (API Facade), [`src/anker_solix_api/mqtt_factory.py`](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_factory.py) (Device Factory), [`src/anker_solix_api/mqtt_device.py`](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_device.py) (Device Controls), [`src/anker_solix_api/mqtt_pps.py`](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_pps.py) (PPS Controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Cloud API"]
  node_api_facade["API Facade<br/>[api.py]"]
  node_http_base["API Base<br/>[apibase.py]"]
  node_session["Cloud Session<br/>[session.py]"]
  node_poller["Data Poller<br/>[poller.py]"]
  node_hes["HES API<br/>[hesapi.py]"]
end

subgraph group_mqtt["MQTT Control"]
  node_mqtt_session["MQTT Session<br/>[mqtt.py]"]
  node_mqtt_factory["Device Factory<br/>[mqtt_factory.py]"]
  node_mqtt_device["Device Controls<br/>[mqtt_device.py]"]
  node_mqtt_pps["PPS Controls<br/>[mqtt_pps.py]"]
  node_mqtt_charger["MQTT Charger<br/>[mqtt_charger.py]"]
  node_mqtt_solarbank["Solarbank MQTT<br/>[mqtt_solarbank.py]"]
  node_mqtt_generator["Generator MQTT<br/>[mqtt_generator.py]"]
  node_mqtt_various["Other MQTT<br/>[mqtt_various.py]"]
  node_command_map["Command Mapping<br/>[mqttcmdmap.py]"]
  node_message_map["Message Mapping<br/>[mqttmap.py]"]
end

subgraph group_domains["Device Domains"]
  node_powerpanel["PowerPanel<br/>[powerpanel.py]"]
  node_energy["Energy Data<br/>[energy.py]"]
  node_schedule["Schedules<br/>[schedule.py]"]
  node_charger["Charger API<br/>[charger.py]"]
  node_vehicle["Vehicle API<br/>[vehicle.py]"]
end

subgraph group_support["Data Support"]
  node_types["API Types<br/>[apitypes.py]"]
  node_helpers["Data Helpers<br/>[helpers.py]"]
  node_errors["API Errors<br/>[errors.py]"]
  node_export["System Export<br/>[export.py]"]
  node_common["CLI Helpers<br/>[common.py]"]
end

node_client(("Client App"))

node_client -.->|"calls"| node_api_facade
node_api_facade -.->|"uses session"| node_session
node_api_facade -.->|"polls data"| node_poller
node_api_facade -.->|"uses HES"| node_hes
node_api_facade -.->|"uses energy"| node_energy
node_api_facade -.->|"uses schedules"| node_schedule
node_api_facade -.->|"uses charger API"| node_charger
node_api_facade -.->|"uses vehicles"| node_vehicle
node_api_facade -.->|"uses PowerPanel"| node_powerpanel
node_mqtt_session -->|"gets MQTT info"| node_session
node_mqtt_factory -->|"selects handler"| node_mqtt_pps
node_mqtt_factory -->|"selects handler"| node_mqtt_charger
node_mqtt_factory -->|"selects handler"| node_mqtt_solarbank
node_mqtt_factory -->|"selects handler"| node_mqtt_generator
node_mqtt_factory -->|"selects handler"| node_mqtt_various
node_mqtt_pps -->|"inherits controls"| node_mqtt_device
node_mqtt_charger -->|"inherits controls"| node_mqtt_device
node_mqtt_solarbank -->|"inherits controls"| node_mqtt_device
node_mqtt_generator -->|"uses base"| node_mqtt_device
node_mqtt_various -->|"uses base"| node_mqtt_device
node_api_facade -.->|"supports export"| node_export

click node_api_facade "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/api.py"
click node_http_base "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/apibase.py"
click node_session "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/session.py"
click node_poller "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/poller.py"
click node_hes "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/hesapi.py"
click node_powerpanel "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/powerpanel.py"
click node_energy "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/energy.py"
click node_schedule "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/schedule.py"
click node_charger "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/charger.py"
click node_vehicle "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/vehicle.py"
click node_mqtt_session "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt.py"
click node_mqtt_factory "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_factory.py"
click node_mqtt_device "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_device.py"
click node_mqtt_pps "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_pps.py"
click node_mqtt_charger "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_charger.py"
click node_mqtt_solarbank "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_solarbank.py"
click node_mqtt_generator "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_generator.py"
click node_mqtt_various "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_various.py"
click node_command_map "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqttcmdmap.py"
click node_message_map "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqttmap.py"
click node_types "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/apitypes.py"
click node_helpers "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/helpers.py"
click node_errors "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/errors.py"
click node_export "https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/export.py"
click node_common "https://github.com/thomluther/anker-solix-api/blob/main/common.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_api_facade,node_http_base,node_session,node_poller,node_hes,node_client toneBlue
class node_mqtt_session,node_mqtt_factory,node_mqtt_device,node_mqtt_pps,node_mqtt_charger,node_mqtt_solarbank,node_mqtt_generator,node_mqtt_various,node_command_map,node_message_map toneAmber
class node_powerpanel,node_energy,node_schedule,node_charger,node_vehicle toneMint
class node_types,node_helpers,node_errors,node_export,node_common toneRose
```

## Components

### Cloud API

- [API Facade](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/api.py): `src/anker_solix_api/api.py`
- [API Base](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/apibase.py): `src/anker_solix_api/apibase.py`
- [Cloud Session](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/session.py): `src/anker_solix_api/session.py`
- [Data Poller](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/poller.py): `src/anker_solix_api/poller.py`
- [HES API](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/hesapi.py): `src/anker_solix_api/hesapi.py`

### MQTT Control

- [MQTT Session](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt.py): `src/anker_solix_api/mqtt.py`
- [Device Factory](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_factory.py): `src/anker_solix_api/mqtt_factory.py`
- [Device Controls](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_device.py): `src/anker_solix_api/mqtt_device.py`
- [PPS Controls](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_pps.py): `src/anker_solix_api/mqtt_pps.py`
- [MQTT Charger](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_charger.py): `src/anker_solix_api/mqtt_charger.py`
- [Solarbank MQTT](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_solarbank.py): `src/anker_solix_api/mqtt_solarbank.py`
- [Generator MQTT](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_generator.py): `src/anker_solix_api/mqtt_generator.py`
- [Other MQTT](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqtt_various.py): `src/anker_solix_api/mqtt_various.py`
- [Command Mapping](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqttcmdmap.py): `src/anker_solix_api/mqttcmdmap.py`
- [Message Mapping](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/mqttmap.py): `src/anker_solix_api/mqttmap.py`

### Device Domains

- [PowerPanel](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/powerpanel.py): `src/anker_solix_api/powerpanel.py`
- [Energy Data](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/energy.py): `src/anker_solix_api/energy.py`
- [Schedules](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/schedule.py): `src/anker_solix_api/schedule.py`
- [Charger API](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/charger.py): `src/anker_solix_api/charger.py`
- [Vehicle API](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/vehicle.py): `src/anker_solix_api/vehicle.py`

### Data Support

- [API Types](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/apitypes.py): `src/anker_solix_api/apitypes.py`
- [Data Helpers](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/helpers.py): `src/anker_solix_api/helpers.py`
- [API Errors](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/errors.py): `src/anker_solix_api/errors.py`
- [System Export](https://github.com/thomluther/anker-solix-api/blob/main/src/anker_solix_api/export.py): `src/anker_solix_api/export.py`
- [CLI Helpers](https://github.com/thomluther/anker-solix-api/blob/main/common.py): `common.py`

### Other components

- **Client App**

## Connections

- Client App → API Facade: calls
- API Facade → Cloud Session: uses session (evidence: `src/anker_solix_api/api.py`)
- API Facade → Data Poller: polls data (evidence: `src/anker_solix_api/api.py`)
- API Facade → HES API: uses HES (evidence: `src/anker_solix_api/api.py`)
- API Facade → Energy Data: uses energy (evidence: `src/anker_solix_api/api.py`)
- API Facade → Schedules: uses schedules (evidence: `src/anker_solix_api/api.py`)
- API Facade → Charger API: uses charger API (evidence: `src/anker_solix_api/api.py`)
- API Facade → Vehicle API: uses vehicles (evidence: `src/anker_solix_api/api.py`)
- API Facade → PowerPanel: uses PowerPanel (evidence: `src/anker_solix_api/api.py`)
- MQTT Session → Cloud Session: gets MQTT info (evidence: `src/anker_solix_api/mqtt.py`)
- Device Factory → PPS Controls: selects handler (evidence: `src/anker_solix_api/mqtt_factory.py`)
- Device Factory → MQTT Charger: selects handler (evidence: `src/anker_solix_api/mqtt_factory.py`)
- Device Factory → Solarbank MQTT: selects handler (evidence: `src/anker_solix_api/mqtt_factory.py`)
- Device Factory → Generator MQTT: selects handler (evidence: `src/anker_solix_api/mqtt_factory.py`)
- Device Factory → Other MQTT: selects handler (evidence: `src/anker_solix_api/mqtt_factory.py`)
- PPS Controls → Device Controls: inherits controls (evidence: `src/anker_solix_api/mqtt_pps.py`)
- MQTT Charger → Device Controls: inherits controls (evidence: `src/anker_solix_api/mqtt_charger.py`)
- Solarbank MQTT → Device Controls: inherits controls (evidence: `src/anker_solix_api/mqtt_solarbank.py`)
- Generator MQTT → Device Controls: uses base (evidence: `src/anker_solix_api/mqtt_generator.py`)
- Other MQTT → Device Controls: uses base (evidence: `src/anker_solix_api/mqtt_various.py`)
- API Facade → System Export: supports export (evidence: `src/anker_solix_api/export.py`)
