Skip to content

smart-swimmingpool/monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

105 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Pool Monitor | Smart Swimmingpool

Smart Swimmingpool License: MIT

works with Home Assistant

ko-fi

The Pool Monitor is a small additional device to show current pool data using e-ink displays:

  • Temperature of the pool water
  • Temperature of solar storage
  • Pool pump status (on/off)
  • Solar heating status (on/off)

Features

  • Configurable MQTT server
  • Automatically connect to MQTT messages of pool controller
  • Open hotspot (captive portal) to configure WiFi and MQTT server
  • Home Assistant MQTT Discovery compatible (reads pool-controller state topics)
  • Time sync via NTP (europe.pool.ntp.org)
  • Deep sleep operation for battery-powered use
  • OTA firmware updates via GitHub Releases
  • System monitoring with watchdog and memory checks
  • Boot-loop detection for reliable operation

Planned Features

  • Solar powering using solar panel
  • Nice case to place outdoor at pool
  • Support of different displays
  • Ability to switch on/off solar heating
  • Ability to switch on/off pool pump
  • Ability to change controller mode (auto, manual, ...)
  • Ability to configure pool controller

Guides

Architecture

The Pool Monitor follows the same architectural patterns as the Pool Controller for consistency and maintainability:

Namespace Structure

All code is organized under the PoolMonitor namespace, matching the PoolController namespace pattern.

Class Structure

  • PoolMonitorContext: Main singleton context that owns all subsystems
  • SystemMonitor: Watchdog, memory monitoring, and boot-loop detection
  • NetworkManager: WiFi and MQTT connection management
  • DisplayManager: E-Ink display management
  • OtaUpdater: OTA firmware update checker and installer
  • TimeClientHelper: NTP time client and timezone support

Key Design Principles

  1. RAII: Resources are managed through constructors/destructors
  2. Singleton Pattern: Subsystems are accessed through static methods
  3. Dependency Injection: Preferences and other dependencies are passed during initialization
  4. Error Handling: Graceful degradation with clear error messages
  5. Memory Safety: Stack-allocated buffers instead of heap allocation where possible

Quality Checks

Run the local quality gates before pushing changes so lint findings are fixed before CI:

  • Install Python-based linters once with python3 -m pip install --user cpplint yamllint
  • markdownlint-cli2 and jscpd are executed on demand via npx
  • Stage your changes first, then run the following Bash-only snippet (mapfile, arrays and git diff --cached require Bash)
platformio check --environment LILYGO_T5_V231 --skip-packages
platformio run --environment LILYGO_T5_V231
mapfile -t cpp_files < <(git diff --cached --name-only -- '*.cpp' '*.hpp' '*.h')
((${#cpp_files[@]})) && cpplint "${cpp_files[@]}"
mapfile -t md_files < <(git diff --cached --name-only -- '*.md')
((${#md_files[@]})) && npx --yes markdownlint-cli2 "${md_files[@]}"
mapfile -t yaml_files < <(git diff --cached --name-only -- '*.yml' '*.yaml')
((${#yaml_files[@]})) && yamllint "${yaml_files[@]}"
npx --yes jscpd --config .jscpd.json src .github/workflows
python -m json.tool .jscpd.json > /dev/null

Discussions

see: https://github.com/smart-swimmingpool/smart-swimmingpool.github.io/discussions

License

LICENSE

About

Monitoring Device to visualize temperature of swimming pool

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors