EcoFlow data collection
Python applications communicate with the EcoFlow equipment using MQTT and the available interfaces to collect battery, solar and power-flow information.
A collection of Python applications, databases, APIs and services that collect energy information, monitor performance and automate battery operation.
I've gradually built up a number of small applications, each responsible for a particular part of the energy monitoring and control process.
Collecting information from EcoFlow equipment, electricity pricing services and weather forecasts.
SQLite databases store energy readings, price information and forecast data for later use.
Python applications analyse the available information and plan battery operating modes.
Flask web applications, historical graphs and the Inky display make the information accessible.
Rather than one enormous program, the system is divided into individual applications that perform specific tasks.
Python applications communicate with the EcoFlow equipment using MQTT and the available interfaces to collect battery, solar and power-flow information.
Readings are recorded in SQLite so that battery performance, solar generation, power consumption and other measurements can be examined over time.
Lightweight Flask applications provide access to current system information and historical readings, including graphs covering different time periods.
Price collection applications retrieve Octopus Agile electricity prices and gas tariff information for storage and analysis.
Weather forecast information is used to estimate future solar generation and help the controller plan how much energy may be needed from the grid.
The controller brings together battery telemetry, electricity prices, forecasts and operating constraints to plan charging and battery discharge limits.
One of the most interesting parts of AgilePi is the automated energy controller. Electricity prices change throughout the day, and the amount of solar energy available tomorrow is not always predictable.
The controller considers the available information and plans when to charge the battery, when to hold its stored energy and when it may be appropriate to allow discharge.
I have also built in safeguards and operating limits. I want the system to make sensible decisions, but I also want to understand what it is doing and why.
Linux services keep the important applications running, while scheduled jobs take care of periodic tasks.
I prefer to know what my software is doing. Logs, historical records and clear monitoring are important parts of AgilePi. When something goes wrong, I want to be able to investigate it rather than simply hope that it fixes itself.
That also means keeping the project organised, documenting changes and making backups before major updates. It's an ongoing learning process, and the software will continue to evolve as the project grows.