AGILEPI / KNOWLEDGE BASE

How it all works.

Technical notes, explanations and guides covering the hardware, software and operation of my home energy management system. This is where I'm documenting how I've put everything together.

PROJECT DOCUMENTATION / CONTINUALLY DEVELOPING
01 / GETTING STARTED

Project overview

AgilePi is my home-built energy monitoring and management system. It combines solar generation, EcoFlow battery storage, household energy information and Octopus Agile electricity pricing.

The system runs on a Raspberry Pi 3 Model B+ and uses a collection of Python applications to gather information, store historical readings, analyse prices and coordinate battery operation.

What this documentation covers

Hardware installation, application architecture, data collection, automated control, historical records, backups and general maintenance.

02 / HARDWARE

Equipment and components

The project uses a small collection of energy equipment and computing hardware. Each component supplies information or provides a function used by the wider system.

Solar panels4 panels · 1,830Wp total
Solar panel types2 × JA Solar 465W, 2 × DMEGC 450W
Battery storageEcoFlow Stream Ultra X
MeteringEcoFlow Smart Meter
Controller computerRaspberry Pi 3 Model B+
Read the hardware overview →
03 / SOFTWARE ARCHITECTURE

How the applications fit together

I've separated the software into smaller applications so that data collection, storage, analysis and presentation can each be managed independently.

↔Data sourcesEcoFlow · Octopus · Weather
↓
▤Collection and storagePython · MQTT · SQLite
↓
⌘Processing and controlForecasts · Prices · Controller
↓
▥PresentationFlask · Web pages · Inky display

The applications are managed using Linux services and scheduled tasks. This allows important processes to run independently and restart automatically when required.

Read the software overview →
04 / AUTOMATED ENERGY MANAGEMENT

The AgilePi controller

The controller is responsible for planning battery operation. It considers several inputs rather than making charging decisions using electricity price alone.

01
Battery informationState of charge, power readings and available capacity.
02
Electricity pricesPublished and forecast tariff information.
03
Solar forecastsExpected generation and potential future energy availability.
04
Operating safeguardsLimits, device constraints and checks before control actions.
Important

Automated control affects real electrical equipment. Any installation or configuration changes must be tested carefully, with appropriate device safeguards retained.

05 / HISTORICAL INFORMATION

Data collection and storage

Historical information is important because a live reading only tells me what's happening at that moment. Storing readings allows me to look back at performance and understand longer-term patterns.

SQLite databases

SQLite is used to store readings and other project information locally. Python applications collect and retrieve data, while the web applications make selected historical information available for analysis.

Historical monitoring includes battery state of charge, solar generation, power flows and energy-related information.

06 / BACKUPS AND RECOVERY

Protecting the project

A database containing months of energy readings is worth protecting. The backup process creates a consistent SQLite snapshot and an archive of selected system files.

01
Database snapshotSQLite backup with validation of the resulting copy.
02
System archiveImportant project files and system configuration are packaged.
03
Remote storageBackup copies are transferred to private cloud storage.
04
Verification and retentionUploaded files are checked and older local backups are rotated.

The backup process is managed by systemd, allowing scheduled backups as well as manual runs when significant changes have been made.

RUN A MANUAL BACKUPsudo systemctl start agilepi-backup.serviceThis command runs a one-off backup without changing the regular schedule.
07 / SECURITY AND CONFIGURATION

Keeping sensitive information private

The project uses API credentials, device access information and other local configuration. These are kept separate from the public source code.

A few important rules

Never publish API keys, passwords, tokens, account identifiers, private network details or live operational data. Example configuration files should use placeholders rather than real credentials.

Public documentation describes the architecture and general setup without revealing private installation details.

08 / MAINTENANCE

Troubleshooting and development

Like most home-built systems, AgilePi occasionally needs investigation and adjustment. Logs and service status provide useful information when something doesn't behave as expected.

01
Check application servicesConfirm whether the relevant services are running.
02
Examine application logsLook for errors and unexpected behaviour.
03
Check stored dataConfirm that readings are being collected correctly.
04
Back up before changesProtect the working system before making significant modifications.

I'll add more detailed, step-by-step guides here as the project documentation develops.

A
That's AgilePi.A home project, built through experimentation, problem-solving and a lot of learning along the way.