# christophebelmont/flow.io-waveshare architecture

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

- Interactive diagram: https://gitdiagram.com/christophebelmont/flow.io-waveshare
- Repository: https://github.com/christophebelmont/flow.io-waveshare

## Overview

flow.io is modular ESP32 pool-monitoring and automation firmware. Its main workflow gathers sensor and equipment measurements, evaluates pool state and safety, coordinates filtration and treatment equipment, then exposes status and controls locally or through network integrations. The graph also preserves the documented history, alarm, update, and AI/weather capabilities. Several internal links are based on README descriptions; unsampled implementation details are not asserted as direct calls.

Main entry points: [`src/Domain/DomainStatusServiceProvider.cpp`](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Domain/DomainStatusServiceProvider.cpp) (Domain status), [`src/Modules/Network/WebInterfaceModule/WebInterfaceServer.cpp`](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/WebInterfaceModule/WebInterfaceServer.cpp) (Web interface), [`src/Modules/PoolDeviceModule/PoolDeviceControl.cpp`](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/PoolDeviceModule/PoolDeviceControl.cpp) (Pool device control), [`src/Modules/IOModule/IOModule.cpp`](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/IOModule/IOModule.cpp) (I/O module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Runtime platform"]
  node_modulemanager["Module lifecycle<br/>[ModuleManager.cpp]"]
  node_profile["Waveshare profile"]
  node_config[("Configuration store")]
  node_datastore[("Runtime data store")]
end

subgraph group_pool["Pool automation"]
  node_domain["Pool domain model<br/>[PoolDomain.h]"]
  node_domainstatus["Domain status"]
  node_poollogic["Automation logic"]
  node_pooldevice["Pool device control"]
  node_history[("Pool history")]
  node_alarms["Alarm handling<br/>[AlarmModule.cpp]"]
end

subgraph group_io["Sensors and equipment"]
  node_io["I/O module<br/>[IOModule.cpp]"]
  node_drivers["I/O drivers"]
end

subgraph group_supervision["Local supervision"]
  node_web["Web interface"]
  node_hmi["Touchscreen HMI<br/>[HMIModule.cpp]"]
end

subgraph group_connectivity["Network integrations"]
  node_mqtt["MQTT integration<br/>[MQTTModule.cpp]"]
  node_ha["Home Assistant<br/>[HAModule.cpp]"]
  node_firmwareupdate["Network updates"]
  node_ai["AI pool insight"]
end

node_operator(("Pool operator"))
node_weather["Weather service"]
node_openai["OpenAI service"]
node_localnetwork(("Local network"))
node_poolinstallation["Pool installation"]

node_modulemanager -.->|"releases modules"| node_profile
node_profile -->|"assembles I/O"| node_io
node_poolinstallation -->|"provides measurements"| node_drivers
node_drivers -.->|"feeds readings"| node_io
node_io -->|"reports status"| node_domainstatus
node_domain -.->|"defines pool roles"| node_domainstatus
node_domainstatus -->|"informs control"| node_poollogic
node_poollogic -->|"coordinates equipment"| node_pooldevice
node_pooldevice -->|"commands actuators"| node_io
node_domainstatus -->|"raises conditions"| node_alarms
node_domainstatus -->|"records measurements"| node_history
node_operator -->|"views and controls"| node_web
node_operator -->|"views and controls"| node_hmi
node_web -->|"serves locally"| node_localnetwork
node_hmi -.->|"issues commands"| node_pooldevice
node_web -.->|"issues commands"| node_pooldevice
node_domainstatus -->|"publishes status"| node_mqtt
node_mqtt -->|"supports integration"| node_ha
node_localnetwork -->|"delivers updates"| node_firmwareupdate
node_ai -.->|"fetches forecast"| node_weather
node_ai -.->|"requests insight"| node_openai
node_config -.->|"supplies settings"| node_poollogic
node_datastore -.->|"supplies runtime data"| node_web

click node_modulemanager "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Core/ModuleManager.cpp"
click node_profile "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Profiles/Waveshare/WaveshareProfile.cpp"
click node_domain "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Domain/Pool/PoolDomain.h"
click node_domainstatus "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Domain/DomainStatusServiceProvider.cpp"
click node_poollogic "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/PoolLogicModule/PoolLogicControl.cpp"
click node_pooldevice "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/PoolDeviceModule/PoolDeviceControl.cpp"
click node_io "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/IOModule/IOModule.cpp"
click node_drivers "https://github.com/christophebelmont/flow.io-waveshare/tree/main/src/Modules/IOModule/IODrivers"
click node_history "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/PoolHistoryModule/PoolHistoryModule.cpp"
click node_alarms "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/AlarmModule/AlarmModule.cpp"
click node_config "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Stores/ConfigStoreModule/ConfigStoreModule.cpp"
click node_datastore "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Stores/DataStoreModule/DataStoreModule.cpp"
click node_web "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/WebInterfaceModule/WebInterfaceServer.cpp"
click node_hmi "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/HMIModule/HMIModule.cpp"
click node_mqtt "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/MQTTModule/MQTTModule.cpp"
click node_ha "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/HAModule/HAModule.cpp"
click node_firmwareupdate "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/FirmwareUpdateModule/FirmwareUpdateModule.cpp"
click node_ai "https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/AiInsightModule/AiInsightModule.cpp"

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_modulemanager,node_profile,node_config,node_datastore toneBlue
class node_domain,node_domainstatus,node_poollogic,node_pooldevice,node_history,node_alarms toneAmber
class node_io,node_drivers toneMint
class node_web,node_hmi toneRose
class node_mqtt,node_ha,node_firmwareupdate,node_ai,node_operator,node_weather,node_openai,node_localnetwork,node_poolinstallation toneIndigo
```

## Components

### Runtime platform

- [Module lifecycle](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Core/ModuleManager.cpp): `src/Core/ModuleManager.cpp`
- [Waveshare profile](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Profiles/Waveshare/WaveshareProfile.cpp): `src/Profiles/Waveshare/WaveshareProfile.cpp`
- [Configuration store](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Stores/ConfigStoreModule/ConfigStoreModule.cpp): `src/Modules/Stores/ConfigStoreModule/ConfigStoreModule.cpp`
- [Runtime data store](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Stores/DataStoreModule/DataStoreModule.cpp): `src/Modules/Stores/DataStoreModule/DataStoreModule.cpp`

### Pool automation

- [Pool domain model](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Domain/Pool/PoolDomain.h): `src/Domain/Pool/PoolDomain.h`
- [Domain status](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Domain/DomainStatusServiceProvider.cpp): `src/Domain/DomainStatusServiceProvider.cpp`
- [Automation logic](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/PoolLogicModule/PoolLogicControl.cpp): `src/Modules/PoolLogicModule/PoolLogicControl.cpp`
- [Pool device control](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/PoolDeviceModule/PoolDeviceControl.cpp): `src/Modules/PoolDeviceModule/PoolDeviceControl.cpp`
- [Pool history](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/PoolHistoryModule/PoolHistoryModule.cpp): `src/Modules/PoolHistoryModule/PoolHistoryModule.cpp`
- [Alarm handling](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/AlarmModule/AlarmModule.cpp): `src/Modules/AlarmModule/AlarmModule.cpp`

### Sensors and equipment

- [I/O module](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/IOModule/IOModule.cpp): `src/Modules/IOModule/IOModule.cpp`
- [I/O drivers](https://github.com/christophebelmont/flow.io-waveshare/tree/main/src/Modules/IOModule/IODrivers): `src/Modules/IOModule/IODrivers`

### Local supervision

- [Web interface](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/WebInterfaceModule/WebInterfaceServer.cpp): `src/Modules/Network/WebInterfaceModule/WebInterfaceServer.cpp`
- [Touchscreen HMI](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/HMIModule/HMIModule.cpp): `src/Modules/HMIModule/HMIModule.cpp`

### Network integrations

- [MQTT integration](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/MQTTModule/MQTTModule.cpp): `src/Modules/Network/MQTTModule/MQTTModule.cpp`
- [Home Assistant](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/HAModule/HAModule.cpp): `src/Modules/Network/HAModule/HAModule.cpp`
- [Network updates](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/Network/FirmwareUpdateModule/FirmwareUpdateModule.cpp): `src/Modules/Network/FirmwareUpdateModule/FirmwareUpdateModule.cpp`
- [AI pool insight](https://github.com/christophebelmont/flow.io-waveshare/blob/main/src/Modules/AiInsightModule/AiInsightModule.cpp): `src/Modules/AiInsightModule/AiInsightModule.cpp`

### Other components

- **Pool operator**
- **Weather service**
- **OpenAI service**
- **Local network**
- **Pool installation**

## Connections

- Module lifecycle → Waveshare profile: releases modules
- Waveshare profile → I/O module: assembles I/O
- Pool installation → I/O drivers: provides measurements (evidence: `README.md`)
- I/O drivers → I/O module: feeds readings
- I/O module → Domain status: reports status (evidence: `README.md`)
- Pool domain model → Domain status: defines pool roles
- Domain status → Automation logic: informs control (evidence: `README.md`)
- Automation logic → Pool device control: coordinates equipment (evidence: `README.md`)
- Pool device control → I/O module: commands actuators (evidence: `README.md`)
- Domain status → Alarm handling: raises conditions (evidence: `README.md`)
- Domain status → Pool history: records measurements (evidence: `README.md`)
- Pool operator → Web interface: views and controls (evidence: `README.md`)
- Pool operator → Touchscreen HMI: views and controls (evidence: `README.md`)
- Web interface → Local network: serves locally (evidence: `README.md`)
- Touchscreen HMI → Pool device control: issues commands
- Web interface → Pool device control: issues commands
- Domain status → MQTT integration: publishes status (evidence: `README.md`)
- MQTT integration → Home Assistant: supports integration (evidence: `README.md`)
- Local network → Network updates: delivers updates (evidence: `README.md`)
- AI pool insight → Weather service: fetches forecast
- AI pool insight → OpenAI service: requests insight
- Configuration store → Automation logic: supplies settings
- Runtime data store → Web interface: supplies runtime data
