Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d6db296
[wifi-info] Add IP address text sensor
bharvey88 Feb 25, 2026
d50e4b9
[version] Add ESPHome and Apollo firmware version sensors
bharvey88 Feb 25, 2026
d000ca3
[esphome] Modernise board spec, web server version, remove legacy opt…
bharvey88 Feb 25, 2026
8c2a09e
fix: add entity_category diagnostic to ESPHome Version sensor
bharvey88 Feb 26, 2026
02ff25c
fix: add update_interval: never to static Apollo Firmware Version sensor
bharvey88 Feb 26, 2026
d547a43
fix: remove duplicate entity_category key on ESPHome Version sensor
bharvey88 Feb 26, 2026
64c94a4
Merge pull request #27 from ApolloAutomation/esphome-modernisation
TrevorSchirmer Feb 27, 2026
6d2d9a6
Merge pull request #26 from ApolloAutomation/version-sensors
TrevorSchirmer Feb 27, 2026
80c1945
fix: remove unused id, add entity_category diagnostic to IP address s…
bharvey88 Feb 25, 2026
d73a082
Merge pull request #25 from ApolloAutomation/wifi-info-ip-address
bharvey88 Feb 27, 2026
4783838
[cpap] Add invert water logic and auto refill for CPAP filling use case
bharvey88 Mar 1, 2026
2b6250e
Fix auto refill triggering on boot by using on_release instead of on_…
bharvey88 Mar 1, 2026
0519e65
Fix premature pump stop in inverted mode when using two sensors
bharvey88 Mar 1, 2026
f7af815
Bump version to 26.3.2.1
bharvey88 Mar 2, 2026
e637d23
Bump version to 26.3.2.1
bharvey88 Mar 2, 2026
1d3fc49
Merge pull request #28 from ApolloAutomation/cpap-invert-water-logic
Bunton33 Mar 3, 2026
817818c
fix: remove update_interval: never from Apollo Firmware Version sensor
bharvey88 Mar 6, 2026
09d3d60
Fix Apollo Firmware Version sensor showing unknown
bharvey88 Mar 6, 2026
abfb0e8
fix: publish firmware version once on boot instead of polling
bharvey88 Mar 6, 2026
f0f2a12
fix: add firmware version publish to PUMP-1_Minimal
bharvey88 Mar 7, 2026
bb2c678
Fix: publish firmware version once on boot instead of polling
bharvey88 Mar 7, 2026
23a8b4c
fix: add logbook entry when auto refill triggers via invert water logic
bharvey88 Mar 9, 2026
bd58d14
[cpap] Add logbook entry for auto refill trigger
bharvey88 Mar 9, 2026
ab51496
feat: add Pump Activity event entity for HA logbook
bharvey88 Mar 10, 2026
dd9cb47
fix: guard pump_stopped event and log against rejected starts
bharvey88 Mar 10, 2026
9a9644a
fix: replace event entity with text sensor for readable HA logbook en…
bharvey88 Mar 10, 2026
0cabc9c
[cpap] Add Last Pump Action text sensor for HA logbook
bharvey88 Mar 11, 2026
0ec11e9
feat: rename Invert Water Logic to Tank Refill Mode + auto-configure …
bharvey88 Mar 11, 2026
712e264
fix: sync dependent switches on boot to match restored tank_refill_mo…
bharvey88 Mar 11, 2026
894a316
feat: auto-toggle Auto Refill with Tank Refill Mode
bharvey88 Mar 17, 2026
623f8cb
[ux] Rename Invert Water Logic to Tank Refill Mode + auto-configure s…
bharvey88 Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 104 additions & 5 deletions Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
substitutions:
name: apollo-pump-1
version: "25.12.18.1"
version: "26.3.2.1"
device_description: ${name} made by Apollo Automation - version ${version}.

esp32:
board: esp32-c6-devkitm-1
variant: esp32c6
flash_size: 8MB
framework:
Expand All @@ -18,9 +17,22 @@ esphome:
id(pump_start_time) = 0;
id(safety_alert_active) = false;
- script.execute: pump_safety_check
- priority: -20
then:
- if:
condition:
switch.is_on: tank_refill_mode
then:
- switch.turn_on: stop_pump_when_full
- switch.turn_off: stop_pump_when_dry
- switch.turn_on: auto_refill
else:
- switch.turn_off: stop_pump_when_full
- switch.turn_on: stop_pump_when_dry
- switch.turn_off: auto_refill
- priority: -100
then:
- delay: 1000ms
- delay: 1000ms
- script.execute: statusCheck
- priority: -10
then:
Expand Down Expand Up @@ -69,6 +81,7 @@ captive_portal:

web_server:
port: 80
version: 3

# Buzzer
output:
Expand Down Expand Up @@ -127,6 +140,30 @@ switch:
restore_mode: RESTORE_DEFAULT_OFF
icon: mdi:water-sync
entity_category: config
- platform: template
name: "Tank Refill Mode"
id: tank_refill_mode
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
icon: mdi:water-sync
entity_category: config
on_turn_on:
then:
- switch.turn_on: stop_pump_when_full
- switch.turn_off: stop_pump_when_dry
- switch.turn_on: auto_refill
on_turn_off:
then:
- switch.turn_off: stop_pump_when_full
- switch.turn_on: stop_pump_when_dry
- switch.turn_off: auto_refill
- platform: template
name: "Auto Refill"
id: auto_refill
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
icon: mdi:autorenew
entity_category: config
- platform: template
name: "Pump Safety Override"
id: pump_safety_override
Expand All @@ -147,10 +184,21 @@ switch:
- if:
condition:
or:
- binary_sensor.is_on: fluid_input_sensor
# Normal mode: input has water
- and:
- switch.is_off: tank_refill_mode
- binary_sensor.is_on: fluid_input_sensor
# Inverted mode: input is dry (destination is low, needs filling)
- and:
- switch.is_on: tank_refill_mode
- binary_sensor.is_off: fluid_input_sensor
# Bypass: dry protection not enabled
- switch.is_off: stop_pump_when_dry
then:
- logger.log: "Pump turning on - conditions met"
- text_sensor.template.publish:
id: last_pump_action
state: "Pump Started"
- lambda: |-
id(pump_start_time) = millis();
id(safety_alert_active) = false;
Expand All @@ -160,10 +208,17 @@ switch:
- switch.turn_off: pump_control
on_turn_off:
then:
- if:
condition:
lambda: 'return id(pump_start_time) != 0;'
then:
- logger.log: "Pump turned off"
- text_sensor.template.publish:
id: last_pump_action
state: "Pump Stopped"
- lambda: |-
id(pump_start_time) = 0;
id(safety_alert_active) = false;
- logger.log: "Pump turned off"

binary_sensor:
- platform: status
Expand Down Expand Up @@ -213,6 +268,20 @@ binary_sensor:
input: true
pullup: true
inverted: true
on_release:
then:
- if:
condition:
and:
- switch.is_on: auto_refill
- switch.is_on: tank_refill_mode
- switch.is_off: pump_control
then:
- logger.log: "Auto refill triggered - tank level low"
- text_sensor.template.publish:
id: last_pump_action
state: "Auto Refill Triggered"
- script.execute: pumpUntilFull

- platform: gpio
name: Fluid Output
Expand Down Expand Up @@ -295,6 +364,26 @@ light:
min_brightness: 50%
max_brightness: 100%

text_sensor:
- platform: template
name: "Last Pump Action"
id: last_pump_action
icon: mdi:pump
- platform: wifi_info
ip_address:
name: "IP Address"
id: wifi_ip
entity_category: "diagnostic"
- platform: version
name: "ESPHome Version"
hide_timestamp: true
entity_category: "diagnostic"
- platform: template
name: "Apollo Firmware Version"
id: apollo_firmware_version
update_interval: never
entity_category: "diagnostic"

script:
- id: pumpUntilFull
then:
Expand Down Expand Up @@ -366,10 +455,20 @@ script:
then:
- logger.log: "Pump stopping - safety"
- switch.turn_off: pump_control
- if:
condition:
- and:
- switch.is_on: tank_refill_mode
- switch.is_off: stop_pump_when_full
- binary_sensor.is_on: fluid_input_sensor
then:
- logger.log: "Pump stopping - destination full (inverted mode)"
- switch.turn_off: pump_control
- if:
condition:
- and:
- switch.is_on: stop_pump_when_dry
- switch.is_off: tank_refill_mode
- binary_sensor.is_off: fluid_input_sensor
then:
- logger.log: "Pump stopping - input dry"
Expand Down
13 changes: 5 additions & 8 deletions Integrations/ESPHome/PUMP-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ esphome:
friendly_name: Apollo PUMP-1
comment: Apollo PUMP-1
name_add_mac_suffix: true
platformio_options:
board_build.flash_mode: dio

on_boot:
- priority: 500
then:
- text_sensor.template.publish:
id: apollo_firmware_version
state: "${version}"
- priority: -10
then:
- if:
Expand Down Expand Up @@ -48,11 +50,6 @@ update:
source: https://apolloautomation.github.io/PUMP-1/firmware/manifest.json

wifi:
on_connect:
- delay: 5s
- ble.disable:
on_disconnect:
- ble.enable:
ap:
ssid: "Apollo PUMP-1 Hotspot"

Expand Down
9 changes: 6 additions & 3 deletions Integrations/ESPHome/PUMP-1_Minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ esphome:
friendly_name: Apollo PUMP-1
comment: Apollo PUMP-1
name_add_mac_suffix: true
platformio_options:
board_build.flash_mode: dio

project:
name: "ApolloAutomation.PUMP-1"
version: "${version}"

min_version: 2023.11.1
on_boot:
priority: 500
then:
- text_sensor.template.publish:
id: apollo_firmware_version
state: "${version}"

dashboard_import:
package_import_url: github://ApolloAutomation/PUMP-1/Integrations/ESPHome/PUMP-1_Minimal.yaml
Expand Down
Loading