Enhanced firmware for Apollo Automation's Pump-1 device featuring dual operating modes, intelligent time synchronization with fallback, cycle counting, and advanced automation capabilities.
- β¨ Features
- π Hardware Pinout
- π¦ Requirements
- β‘ Quick Start
- π₯ Installation
- π¨ Home Assistant Dashboard Cards
- βοΈ Configuration Guide
- π Operating Modes
- π¬ Sensor Configuration & Use Cases
- π οΈ Example Projects
- π§ Troubleshooting
- π€ About the Author
- π€ Contributing
- π Version History
- π Dual Operating Modes
- Continuous Mode: Time-based pumping for water evacuation
- Cycle Mode (Dispensing): Counted dispensing with low-fluid alerts
- π·οΈ Automatic Device Naming: MAC address suffix ensures unique device IDs
- π Flexible Security: Auto-generated or manual OTA password and API encryption
- πΎ Persistent Cycle Counting: Tracks pump cycles across reboots
- π¨ Smart Alerts: Visual (RGB LED) and audio (buzzer) notifications
- β° Intelligent Time Synchronization (NEW!)
- Expanded NTP server list (6 servers: hostname + IP pairs)
- Explicit DNS configuration for reliability
- Fallback timer system - Ensures operation even without SNTP sync
- Automatic transition between SNTP and uptime-based timing
- π Dual Sensor Support: INPUT/OUTPUT fluid level monitoring
- π‘οΈ Safety Timeouts: Configurable maximum runtime protection
- π‘ WiFi Setup: Captive portal for easy initial configuration
- π§ͺ Boot Test Sequence: Automatic hardware verification on startup
- π Web Interface: Built-in web server for monitoring
- π Home Assistant Integration: Full API support with auto-discovery
| GPIO Pin | Function | Description | Configuration |
|---|---|---|---|
| GPIO3 | RGB LED | WS2812 status indicator | Output, 1 LED, GRB order |
| GPIO4 | Fluid Input Sensor | Monitors source container level | Input, Pull-up, Inverted |
| GPIO5 | Buzzer | RTTTL audio alerts | LEDC Output |
| GPIO7 | Pump Control | Main pump relay/control | Output |
| GPIO9 | Reset Button | Physical control button | Input, Pull-up, Inverted |
| GPIO14 | Fluid Output Sensor | Monitors destination level | Input, Pull-up, Inverted |
GPIO3 - RGB LED (WS2812)
- Type: Addressable RGB LED
- Chipset: WS2812
- Purpose: Visual status indication
- States:
- π΅ Blue: AP mode (WiFi setup needed)
- π’ Green: WiFi connected
- π£ Purple: Home Assistant connected
- π‘ Yellow (pulsing): Warning - near cycle limit
- π΄ Red (pulsing): Alert - refill needed
GPIO4 - Fluid Input Sensor
- Type: Digital input (moisture sensor)
- Pull-up: Enabled
- Logic: Inverted (LOW = fluid detected)
- Purpose: Monitors source container fluid level
- Use Case: Prevents pump operation when source is empty
GPIO5 - Buzzer
- Type: LEDC PWM output
- Purpose: Audio alerts and notifications
- Supports: RTTTL (Ring Tone Text Transfer Language)
- Alerts:
- Boot test sequence
- Low fluid warnings
- Cycle limit reached
- Safety timeout
GPIO7 - Pump Control
- Type: Digital output
- Purpose: Controls main pump relay
- Safety: Monitored by safety timeout system
- Max Runtime: Configurable (default 60 seconds)
GPIO9 - Reset Button
- Type: Digital input with multi-click detection
- Pull-up: Enabled
- Logic: Inverted (LOW = pressed)
- Functions:
- Single tap (< 1s): Run pump manually
- 3-second hold: Run boot test sequence
- 10-second hold: Factory reset
GPIO14 - Fluid Output Sensor
- Type: Digital input (moisture sensor)
- Pull-up: Enabled
- Logic: Inverted (LOW = fluid detected)
- Purpose: Monitors destination container level
- Use Case: Auto-stop pump when destination is full
- β Apollo Automation Pump-1 device
- β ESP32-C6-DevKitM-1 (8MB Flash) - included in Pump-1
- β USB-C cable for initial flashing
- β
ESPHome (latest version recommended)
- Install via: ESPHome Installation Guide
- β Home Assistant (optional, for full integration)
- β HACS (optional, for dashboard cards)
# 1. Download the firmware
git clone https://github.com/yourusername/apollo-pump-dual-mode.git
# 2. Customize friendly_name in apollo-pump-1-dual-mode.yaml
# 3. Compile and flash
esphome run apollo-pump-1-dual-mode.yaml
# 4. Configure WiFi via captive portal
# 5. Add to Home Assistant (auto-discovered)# Install ESPHome
pip3 install esphome
# Start dashboard
esphome dashboard config/# Install ESPHome
pip3 install esphome
# Validate configuration
esphome config apollo-pump-1-dual-mode.yaml
# Compile firmware
esphome compile apollo-pump-1-dual-mode.yamlOpen apollo-pump-1-dual-mode.yaml and customize the substitutions section:
substitutions:
# REQUIRED: Unique identifier for this pump (for organization)
device_id: "pump1" # Change for each pump: pump1, pump2, pump3, etc.
# Customize the display name
friendly_name: "Kitchen Cleaner Pump"
# Timezone (see full list in YAML file)
timezone: "America/New_York"
# OTA password (can use substitution)
ota_password: ""
β οΈ Important: When using custom firmware, you MUST manually provide credentials. ESPHome only auto-generates credentials when using the wizard, not with custom YAML files.
For New Devices (First-Time Setup):
Generate new credentials manually:
# Generate OTA password (any random 32+ character string)
openssl rand -hex 16
# Generate API encryption key (base64, 32 Byte >>> exactly 44 characters)
openssl rand -base64 32Alternative: Online Key Generators
- Random 32+ String Generator - Generate a 32+ Character Password online
- Random Base64 String Generator - Generate a 32-byte base64 key online
1. OTA Password - Add to substitutions section:
substitutions:
ota_password: "your-generated-password-here"2. API Encryption Key - Must be added directly in the api: section (around line 223):
api:
encryption:
key: "your-generated-base64-key-here="
β οΈ Note: API encryption key CANNOT use substitutions in current ESPHome versions (2025.9.3). It must be placed directly in theapi:section.
For Existing Devices (Firmware Update):
Copy credentials from your existing device to prevent re-pairing with Home Assistant:
- OTA password in substitutions
- API key directly in
api:section (line ~223)
π‘ Tip: Each pump MUST have unique credentials. Never reuse credentials across multiple devices.
WiFi Configuration:
Create secrets.yaml in your ESPHome config directory:
wifi_ssid: "YourWiFiNetwork"
wifi_password: "YourWiFiPassword"# Connect Pump-1 via USB-C
esphome run apollo-pump-1-dual-mode.yaml
# Select serial port when prompted# Update wirelessly
esphome run apollo-pump-1-dual-mode.yaml
# Select network device when prompted- Device will appear in Settings > Devices & Services > Discovered
- Click Configure
- Device will be added automatically
- Go to Settings > Devices & Services
- Click + Add Integration
- Search for ESPHome
- Enter device IP address
πΈ View All Card Screenshots - See the dashboard card in various states and configurations
Install required custom cards via HACS:
- Install HACS: HACS Installation Guide
- Install fold-entity-row:
- HACS > Frontend > Search "fold-entity-row" > Install
- Install auto-entities (optional, for multi-pump card):
- HACS > Frontend > Search "auto-entities" > Install
File: HASS-Apollo-Pump-Card-Template.yaml
Setup Steps:
-
Find your device's MAC suffix:
- In ESPHome: Look for name like
apollo-pump-1-a1b2c3 - In Home Assistant: Settings > Devices > Apollo Pump
- Suffix is last 6 characters (e.g.,
a1b2c3)
- In ESPHome: Look for name like
-
Open
HASS-Apollo-Pump-Card-Template.yamlin text editor -
Find & Replace:
- Find:
{DEVICE_SUFFIX} - Replace:
a1b2c3(your actual suffix)
- Find:
-
Copy entire file content
-
In Home Assistant:
- Edit Dashboard > Add Card > Manual
- Paste the modified YAML
File: HASS-Apollo-Pump-Card-Auto-Entities.yml
Setup Steps:
- Ensure
auto-entitiescustom card is installed - Copy entire file content (no editing needed!)
- In Home Assistant:
- Edit Dashboard > Add Card > Manual
- Paste the YAML
Features:
- β Automatically detects all Apollo Pump devices
- β No manual editing required
- β Updates automatically when adding new pumps
- β Perfect for installations with multiple pumps
substitutions:
friendly_name: "Apollo Pump" # Customize for each pumpExamples:
"Kitchen Cleaner Pump""Garage Water Pump""Bathroom Soap Dispenser #1"
Device Naming:
- Internal ID:
apollo-pump-1-[MAC](e.g.,apollo-pump-1-a1b2c3) - Display Name: Your custom
friendly_name
Create secrets.yaml in your ESPHome config directory:
wifi_ssid: "YourWiFiNetwork"
wifi_password: "YourWiFiPassword"Uncomment and configure in the YAML file:
manual_ip:
static_ip: 192.168.50.43
gateway: 192.168.50.1
subnet: 255.255.255.0
dns1: 192.168.50.1 # Primary DNS (router)
dns2: 8.8.8.8 # Secondary DNS (Google)Use Case: Pumping water from areas that continuously accumulate fluid
Features:
- β° Time-based automatic pumping
- βοΈ Configurable interval (hours)
- β±οΈ Configurable run duration (seconds)
- π’ No cycle counting
Configuration:
- Switch to Continuous Mode: Turn OFF "Cycle: Enable Limiting" switch
- Set "Cont: Interval (Hours)" to desired interval (e.g., 6 hours)
- Set "Cont: Run Duration (Sec)" to desired runtime (e.g., 300 seconds)
Example Use Cases:
- AC drain line maintenance
- Basement sump pump backup
- Condensate removal
- Any continuous water evacuation scenario
Use Case: Dispensing finite fluids with low-level alerts
Features:
- π’ Cycle counting with persistent storage
- π Estimated remaining fluid calculation
- π¨ Visual and audio alerts when low
- π Auto-refill confirmation workflow
- π Configurable cycle limits
Configuration:
- Switch to Cycle Mode: Turn ON "Cycle: Enable Limiting" switch
- Set "Cycle: Refill Size (oz)" to container size
- Click "Cycle: Confirm Refill" to auto-calculate cycle limit
- Set "Cont: Interval (Hours)" and "Cont: Run Duration (Sec)"
Example Use Cases:
- Soap/detergent dispensing
- Cleaning solution distribution
- Chemical dosing systems
- Any finite fluid dispensing application
Alert System:
- π‘ Warning (within 10 cycles of limit): Yellow pulsing LED
- π΄ Alert (limit reached): Red pulsing LED + hourly buzzer
- π Auto-clear: Alerts clear after refill confirmation
Purpose: Monitors source container fluid level
Configuration:
- Enable via "Sensor: Enable INPUT" switch
- Sensor reads LOW when fluid detected
- Sensor reads HIGH when dry
Use Cases:
- Behavior: Enables "Run Until Empty" operation
- Button: "Manual: Run Until Empty" appears when INPUT sensor is enabled in Continuous Mode
- Operation: Pump runs continuously until INPUT sensor detects empty (no fluid)
- Safety: Still respects maximum runtime timeout
- Use Case: Pump water from source container until completely empty
- Note: Auto-run is disabled when INPUT sensor is enabled in Continuous Mode
- Behavior: Blocks pump operation when source is empty
- Alert: Buzzer sounds when attempting to run with empty source
- Auto-increment: If fluid detected at cycle limit, automatically adds 10 cycles
- Use Case: Prevents dry-running, extends cycle limit when refilled
Purpose: Monitors destination container level
Configuration:
- Enable via "Sensor: Enable OUTPUT" switch
- Sensor reads LOW when fluid detected
- Sensor reads HIGH when dry
Use Cases:
- Trigger: Press "Manual: Run Until Full" button
- Behavior: Pump runs continuously until OUTPUT sensor detects fluid
- Safety: Still respects maximum runtime timeout
- Use Case: Fill destination container to exact level
- Behavior: Any pump operation auto-stops when OUTPUT sensor detects full
- Use Case: Prevents overflow in destination container
Both sensors use the same wiring configuration:
- Type: Moisture/water level sensors
- Connection: Digital input with internal pull-up
- Logic: Active LOW (sensor grounds the pin when fluid detected)
- Compatibility: Works with most moisture sensors and float switches
This custom firmware enables a wide variety of real-world applications. Below are example projects demonstrating how to use the Apollo Pump-1 in different scenarios.
Project Type: Continuous Mode - Automated Water Evacuation
A solar-powered, automated system for maintaining AC drain lines and preventing clogs. This project demonstrates:
- β Solar panel + powerbank setup for off-grid operation
- β Waterproof enclosure for outdoor installation
- β Scheduled automatic purging to prevent buildup
- β Complete parts list with pricing
- π Planned Upgrade: Water level sensor integration for on-demand pumping (parts on order)
π View Complete Parts List & Setup Guide
Key Features:
- Solar-powered operation (no electrical outlet needed)
- Weatherproof installation
- Automated maintenance schedule
- Future: Sensor-triggered operation for power efficiency
- Total cost: ~$170-$190 USD
Upcoming Enhancement:
The system will be upgraded with a water level sensor to trigger the pump only when water reaches the top of the drain line. This will:
- Reduce power consumption by eliminating interval-based pumping
- Extend powerbank runtime between solar charges
- Provide more efficient on-demand operation
Project Type: Cycle Mode - Automated Cleaning Agent Dispensing
An automated system for dispensing cleaning solution into AC drain pans to prevent algae growth and maintain cleanliness. This project demonstrates:
- β Cycle counting for tracking cleaning agent usage
- β Water sensor integration for fluid level monitoring
- β Scheduled automatic dispensing
- β Low-cost, simple installation
- β Complete parts list with pricing
π View Complete Parts List & Setup Guide
Key Features:
- Automated cleaning agent dispensing
- Cycle tracking to monitor solution usage
- Water sensor detects low fluid levels
- Simple zip-tie and duct tape installation
- Total cost: ~$72 USD (without cleaning solution)
- Total cost: ~$98 USD (with recommended cleaning solution)
Have you built something cool with the Apollo Pump-1? Share your project:
- Open a GitHub Issue with the "project showcase" label
- Include photos, parts list, and configuration details
- Help inspire the community!
Problem: SNTP shows "β Not Synced"
Solutions:
-
Check DNS Configuration:
- Ensure
dns1anddns2are configured in static IP settings - Verify DNS servers are reachable
- Ensure
-
Verify NTP Server Access:
- Check firewall allows UDP port 123
- Ensure router doesn't block NTP traffic
-
Use Fallback Timer:
- Firmware automatically uses uptime-based timing if SNTP fails
- Pumps will continue operating on schedule
- Check logs for "Fallback timer initialized" message
-
Force Time Sync:
- Use "System: Force Time Sync" button
- Wait 30 seconds and check "Time: SNTP Status"
Problem: Device stuck in AP mode (blue LED)
Solutions:
- Connect to "Apollo-Pump-1 Setup" WiFi network
- Navigate to
192.168.4.1in browser - Enter WiFi credentials
- Device will reboot and connect
Problem: Device disconnects frequently
Solutions:
- Check WiFi signal strength (RSSI sensor)
- Move device closer to router or add WiFi extender
- Configure static IP to prevent DHCP issues
Problem: Pump doesn't run at scheduled intervals
Checklist:
- β "System: Enable Pump & Logic" is ON
- β "Status: Next Auto Run" shows valid time (not "Disabled")
- β In Cycle Mode: Check cycle count hasn't reached limit
- β In Cycle Mode with INPUT sensor: Verify source has fluid
- β Check "Status: Last Auto Run" to confirm timestamp is updating
Problem: Red LED and buzzer persist after refill
Solution:
- Set "Cycle: Refill Size (oz)" to actual refill amount
- Press "Cycle: Confirm Refill" button
- This resets counter and clears alerts
Problem: Device not discovered in Home Assistant
Solutions:
- Verify device is on same network as Home Assistant
- Check API encryption key matches between device and HA
- Manually add via Settings > Devices > Add Integration > ESPHome
- Enter device IP address
JadeHawk - IoT Enthusiast & Home Automation Hobbyist
I created this custom firmware and automation solutions to fix 2 issues I personally needed to get working. This project represents a couple of weekends of painful trial & error, testing and documentation formatting to provide the community with a robust, feature-rich custom pump firmware.
- πΊ YouTube: @jadehawk - Tutorials, reviews, and project showcases
- π Blog: techy-notes.com - In-depth guides and technical articles
- β Support: Buy Me a Coffee - Help fund future projects
If this firmware has helped you, please consider:
- β Star this repository on GitHub
- β Buy me a coffee to support development
- πΊ Subscribe to my YouTube channel (Love you to do this!)
- π’ Share this project with others
Your support enables me to create more open-source projects and comprehensive documentation!
Contributions are welcome! Here's how you can help:
- Use GitHub Issues to report bugs
- Include firmware version, hardware details, and logs
- Describe steps to reproduce the problem
- Open a GitHub Issue with the "enhancement" label
- Describe the use case and expected behavior
- Explain how it benefits the community
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code formatting
- Add comments for complex logic
- Update documentation for new features
- Test thoroughly before submitting
-
π Enhanced "Next Auto Run" Status Display
- Added mode-specific status messages for Trigger and Safety modes
- Shows
"Waiting for Sensor Trigger"when in Trigger mode - Shows
"Auto-run disabled (Safety mode)"when in Safety mode - Provides clearer feedback about pump operation state
- Eliminates generic "sensor mode" message for better user understanding
-
π¨ Fixed Home Assistant Card Button Visibility Logic
- "Run Until Full" button now only appears when OUTPUT sensor is in Safety mode
- "Run Until Empty" button now only appears when INPUT sensor is in Safety mode
- Prevents confusing UX where buttons appeared in Trigger mode (where they don't make sense)
- Updated all card files: Template, Cleaning Pump, and Purge Pump cards
- Buttons now correctly match sensor behavior expectations
- π― Added three-mode sensor system (Disabled/Safety/Trigger)
- π Added diagnostic status sensor with real-time reporting
- β‘ Added trigger mode indicator
- π‘οΈ Implemented mode-aware safety logic
- π Added 2-second monitoring interval for trigger detection
- π¨ Enhanced Home Assistant cards with sensor mode selectors
- π§Ή Removed legacy sensor switches for cleaner UI
- β¨ Added intelligent time synchronization with fallback timer
- β¨ Expanded NTP server list (6 servers: hostname + IP pairs)
- β¨ Added explicit DNS configuration support
- β¨ Implemented uptime-based fallback timing system
- π·οΈ Added dynamic device naming with MAC suffix
- π Added flexible security credential system
- π Comprehensive documentation overhaul
- π¨ Enhanced Home Assistant dashboard cards
- π§ Improved sensor configuration and use cases
- Initial release with dual-mode operation
- Basic time synchronization
- Cycle counting and alerts
- Sensor support
This project is licensed under the MIT License - see the LICENSE file for details.
- Apollo Automation - For creating the excellent Pump-1 hardware
- ESPHome Community - For the amazing framework and support
- Home Assistant Community - For inspiration and feedback
- Contributors - Everyone who has helped improve this project
This firmware is provided "as is" without warranty of any kind. Use at your own risk. Always test thoroughly in a safe environment before deploying in critical applications.


