Skip to content

smart-swimmingpool/pool-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

436 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Pool Controller | \ud83c\udfca Smart Swimming Pool

Smart Swimmingpool PlatformIO CI License: MIT ko-fi


\u26a0\ufe0f WARNING: This project involves 230V AC mains voltage!

  • Only proceed if you have basic electronics knowledge.
  • Always use a Residual Current Device (RCD/FI circuit breaker) for the pump circuit.
  • Disconnect power before working on the circuit.
  • Keep low-voltage (sensor) wiring separate from mains wiring.
  • If in doubt, consult a qualified electrician.
  • This project is NOT certified (no CE/UL mark). For personal use only!

\ud83c\udfca Overview

The Pool Controller is an ESP32-based control unit that automates your swimming pool management. It provides intelligent circulation, solar heating control, and comprehensive monitoring via MQTT integration with Home Assistant and other smart home systems.

Key Features:

  • \u2705 Timed circulation for water cleaning
  • \u2705 Solar heating control via additional pump
  • \u2705 Multiple operation modes: Auto, Manual, Boost, Timer
  • \u2705 Temperature-based automation
  • \u2705 Home Assistant MQTT Discovery (v3.3.0+)
  • \u2705 Built-in web interface with REST API
  • \u2705 State persistence across reboots
  • \u2705 System health monitoring with auto-recovery
  • \u2705 OTA firmware updates

Cost: ~45\u201375\u20ac (excluding pumps and pool infrastructure)


\ud83d\ude80 Quick Start

New to the project? Begin with these resources:


\ud83d\udcbb Hardware Requirements

Component Qty Approx. Cost Notes
ESP32 Development Board 1 10\u201315\u20ac 4MB+ flash required
DS18B20 Temperature Sensor (waterproof) 2 8\u201312\u20ac Pool + solar collector
2-Channel 5V Relay Module 1 5\u20138\u20ac With optocoupler isolation
Resistor 4.7k\u03a9 2 < 1\u20ac Pull-up for OneWire
USB Power Supply 5V/\u22651A 1 5\u201310\u20ac For ESP32
Total ~45\u201375\u20ac Without pumps

Recommended Shops: Amazon, AliExpress, Reichelt, Pollin, Conrad (DE/AT/CH)


\ud83d\udce6 Software & Development

PlatformIO Setup

# Clone the repository
git clone https://github.com/smart-swimmingpool/pool-controller.git
cd pool-controller

# Build the firmware (first build downloads dependencies)
pio run

# Flash to device
pio run --target upload

# Monitor serial output
pio run --target monitor

Platform: ESP32 DevKit V1 (esp32dev)

Key Dependencies

  • Homie for ESP8266/ESP32 (MQTT framework)
  • OneWire (DS18B20 sensor communication)
  • DallasTemperature (temperature sensor library)
  • ArduinoJson (JSON processing for MQTT)
  • NTPClient (time synchronization)
  • ESPmDNS (mDNS discovery)

\ud83c\udf10 MQTT Integration

Home Assistant (Recommended)

The Pool Controller supports native Home Assistant MQTT Discovery (v3.3.0+). Devices and entities are automatically discovered and added to your Home Assistant instance.

MQTT Protocol: homeassistant (only option in v3.3.0+)

Supported Smart Home Systems

System Integration Method Status
Home Assistant MQTT Discovery \u2705 Native support
openHAB MQTT Binding \u2705 Manual configuration
Node-RED MQTT nodes \u2705 Works with any MQTT broker
ioBroker MQTT adapter \u2705 Works with any MQTT broker

MQTT Topics: See MQTT Configuration Guide for complete topic reference.


\ud83d\udee1\ufe0f Reliability Features (v3.3.0)

State Persistence

All settings survive reboots and power failures:

  • Operation mode, temperatures, timer settings
  • ESP32 NVS storage
  • Automatic restoration on boot

System Health Monitoring

  • Memory monitoring every 10 seconds
  • Auto-reboot at critical memory threshold (8KB)
  • Hardware watchdog timer (30s timeout)
  • Boot-loop detection with Safe Mode

Memory Optimization

  • 90% reduction in heap fragmentation
  • 2,880\u201328,800 fewer allocations per day
  • Fixed millis() overflow for operation beyond 49.7 days

\ud83d\udcda Documentation

Guide Description Audience
Quick Start Guide Step-by-step setup for beginners \ud83c\udd95 New users
FAQ Troubleshooting common issues \u2753 All users
Users Guide Web dashboard, operation modes, MQTT \ud83c\udf9b\ufe0f Intermediate users
Hardware Guide Assembly, wiring, parts list \ud83d\udd27 Builders
MQTT Configuration Home Assistant Discovery, entity reference \ud83c\udf10 Smart home integrators
State Persistence How settings are saved across reboots \ud83d\udcbe Advanced users
OTA Updates Remote firmware updates \ud83d\udce1 Developers
Software Guide Development environment, build process \ud83d\udd27 Developers
ESP32 Schematic Optimization Pin assignment and optimization \ud83d\udd0c Hardware experts

\ud83d\udce6 Recent Updates

v3.3.0 (Current)

  • ESP8266 support removed (ESP32-only)
  • Phase 3: Proactive Resilience
    • Fast sensor recovery (5s polling on NaN)
    • Boot-loop detection with Safe Mode
    • Configurable fallback times
  • Critical bug fixes (logging, millis() overflow)
  • State persistence across reboots
  • Home Assistant MQTT Discovery support
  • System health monitoring
  • Hardware watchdog timer

Full Changelog: CHANGELOG.md


\ud83d\ude80 Planned Features

  • Configurable NTP Server
  • Smart learning: Improved pool pump circulation optimization
  • Two separate circulation cycles
  • Temperature-based cleaning circulation time
  • Improved operation without WiFi connection
  • Display and button setup interface

See: Issue List


\ud83e\udd1d Contributing

We welcome contributions! Please follow these steps:

  1. Read the guidelines: CONTRIBUTING.md
  2. Fork the repository and create a feature branch
  3. Make your changes following project standards
  4. Test thoroughly and update documentation
  5. Run quality checks: make lint-fix && make lint
  6. Submit a Pull Request

Quality Gates:

  • \u2705 Super-Linter (code quality)
  • \u2705 PlatformIO CI (build verification)
  • \u2705 Manual review by maintainers

\ud83d\udcdc License

MIT License \u2013 Free to use, modify, and share.


\ud83c\udf10 Community & Support

Need Help?

  1. Check the FAQ
  2. Search Discussions
  3. Open a new issue

\ud83d\udce2 Project Links

Module Description
Pool Controller Main control unit (this repository)
Pool Monitor Solar-powered wireless temperature display
Grafana Dashboard Visualization dashboard
openHAB Config openHAB configuration files
Water Quality Monitor Water quality monitoring (pH, chlorine)
Website Project documentation website

Made with \u2764\ufe0f by the Smart Swimming Pool community

About

🏊 Smart Swimming Pool - ESP32 based Controller managing your Swimming Pool

Topics

Resources

License

Code of conduct

Contributing

Stars

23 stars

Watchers

5 watching

Forks

Sponsor this project

Contributors