From d6db29605d363ab948635a170be5728e64799650 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Tue, 24 Feb 2026 18:43:47 -0600 Subject: [PATCH 01/24] [wifi-info] Add IP address text sensor --- Integrations/ESPHome/Core.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 83294d1..8ea39d3 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -295,6 +295,12 @@ light: min_brightness: 50% max_brightness: 100% +text_sensor: + - platform: wifi_info + ip_address: + name: "IP Address" + id: wifi_ip + script: - id: pumpUntilFull then: From d50e4b93618a5476fc5586dc459a8d1b11acb987 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Tue, 24 Feb 2026 18:44:11 -0600 Subject: [PATCH 02/24] [version] Add ESPHome and Apollo firmware version sensors --- Integrations/ESPHome/Core.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 8ea39d3..49f5fd3 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -300,6 +300,16 @@ text_sensor: ip_address: name: "IP Address" id: wifi_ip + - platform: version + name: "ESPHome Version" + hide_timestamp: true + entity_category: "diagnostic" + - platform: template + name: "Apollo Firmware Version" + id: apollo_firmware_version + lambda: |- + return {"${version}"}; + entity_category: "diagnostic" script: - id: pumpUntilFull From d000ca325fe53cc6036b57f41b8d57eaa398c6db Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Tue, 24 Feb 2026 18:44:53 -0600 Subject: [PATCH 03/24] [esphome] Modernise board spec, web server version, remove legacy options - Remove redundant esp32 board string (variant + flash_size already present) - Add web_server version: 3 to Core.yaml - Remove platformio_options board_build.flash_mode from both device YAMLs - Remove legacy BLE wifi on_connect/on_disconnect hooks from PUMP-1.yaml --- Integrations/ESPHome/Core.yaml | 2 +- Integrations/ESPHome/PUMP-1.yaml | 8 -------- Integrations/ESPHome/PUMP-1_Minimal.yaml | 3 --- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 49f5fd3..3dea60d 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -4,7 +4,6 @@ substitutions: device_description: ${name} made by Apollo Automation - version ${version}. esp32: - board: esp32-c6-devkitm-1 variant: esp32c6 flash_size: 8MB framework: @@ -69,6 +68,7 @@ captive_portal: web_server: port: 80 + version: 3 # Buzzer output: diff --git a/Integrations/ESPHome/PUMP-1.yaml b/Integrations/ESPHome/PUMP-1.yaml index 1c619eb..d0214b5 100644 --- a/Integrations/ESPHome/PUMP-1.yaml +++ b/Integrations/ESPHome/PUMP-1.yaml @@ -3,9 +3,6 @@ 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: -10 then: @@ -48,11 +45,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" diff --git a/Integrations/ESPHome/PUMP-1_Minimal.yaml b/Integrations/ESPHome/PUMP-1_Minimal.yaml index 5a5a83f..ff36804 100644 --- a/Integrations/ESPHome/PUMP-1_Minimal.yaml +++ b/Integrations/ESPHome/PUMP-1_Minimal.yaml @@ -3,9 +3,6 @@ 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}" From 8c2a09e2d348989c400f0e793e9442f1914336dc Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Thu, 26 Feb 2026 07:02:43 -0600 Subject: [PATCH 04/24] fix: add entity_category diagnostic to ESPHome Version sensor --- Integrations/ESPHome/Core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 49f5fd3..8701043 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -304,6 +304,7 @@ text_sensor: name: "ESPHome Version" hide_timestamp: true entity_category: "diagnostic" + entity_category: "diagnostic" - platform: template name: "Apollo Firmware Version" id: apollo_firmware_version From 02ff25cfe2400c9eab1331cb76e955cfa77e9cbe Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Thu, 26 Feb 2026 07:02:44 -0600 Subject: [PATCH 05/24] fix: add update_interval: never to static Apollo Firmware Version sensor --- Integrations/ESPHome/Core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 8701043..eec95bb 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -310,6 +310,7 @@ text_sensor: id: apollo_firmware_version lambda: |- return {"${version}"}; + update_interval: never entity_category: "diagnostic" script: From d547a43e408908142ad0cd972739573bf658949a Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Thu, 26 Feb 2026 10:59:34 -0600 Subject: [PATCH 06/24] fix: remove duplicate entity_category key on ESPHome Version sensor --- Integrations/ESPHome/Core.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index eec95bb..3a9e098 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -304,7 +304,6 @@ text_sensor: name: "ESPHome Version" hide_timestamp: true entity_category: "diagnostic" - entity_category: "diagnostic" - platform: template name: "Apollo Firmware Version" id: apollo_firmware_version From 80c1945270cd108292db1fb5009a085f37a0ebf2 Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:51:17 -0600 Subject: [PATCH 07/24] fix: remove unused id, add entity_category diagnostic to IP address sensor --- Integrations/ESPHome/Core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 9ace62b..193840b 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -300,6 +300,7 @@ text_sensor: ip_address: name: "IP Address" id: wifi_ip + entity_category: "diagnostic" - platform: version name: "ESPHome Version" hide_timestamp: true From 47838380162cb604cd530ca8e87c009c704a0bdc Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Sun, 1 Mar 2026 14:19:42 -0600 Subject: [PATCH 08/24] [cpap] Add invert water logic and auto refill for CPAP filling use case Adds two new optional config switches (off by default): - Invert Water Logic: flips input sensor meaning so DRY = destination low = start pump, WET = destination full = stop pump - Auto Refill: automatically triggers pumpUntilFull when input sensor goes dry in inverted mode Resolves #22 --- Integrations/ESPHome/Core.yaml | 45 +++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 193840b..a4f7295 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -127,6 +127,20 @@ switch: restore_mode: RESTORE_DEFAULT_OFF icon: mdi:water-sync entity_category: config + - platform: template + name: "Invert Water Logic" + id: invert_water_logic + optimistic: true + restore_mode: RESTORE_DEFAULT_OFF + icon: mdi:water-sync + entity_category: config + - 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 @@ -147,7 +161,15 @@ switch: - if: condition: or: - - binary_sensor.is_on: fluid_input_sensor + # Normal mode: input has water + - and: + - switch.is_off: invert_water_logic + - binary_sensor.is_on: fluid_input_sensor + # Inverted mode: input is dry (destination is low, needs filling) + - and: + - switch.is_on: invert_water_logic + - 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" @@ -213,6 +235,18 @@ binary_sensor: input: true pullup: true inverted: true + on_state: + then: + - if: + condition: + and: + - switch.is_on: auto_refill + - switch.is_on: invert_water_logic + - binary_sensor.is_off: fluid_input_sensor + - switch.is_off: pump_control + then: + - logger.log: "Auto refill triggered - tank level low" + - script.execute: pumpUntilFull - platform: gpio name: Fluid Output @@ -384,10 +418,19 @@ script: then: - logger.log: "Pump stopping - safety" - switch.turn_off: pump_control + - if: + condition: + - and: + - switch.is_on: invert_water_logic + - 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: invert_water_logic - binary_sensor.is_off: fluid_input_sensor then: - logger.log: "Pump stopping - input dry" From 2b6250e607195c1ea62cdada8282b2677ad12f27 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Sun, 1 Mar 2026 14:55:04 -0600 Subject: [PATCH 09/24] Fix auto refill triggering on boot by using on_release instead of on_state --- Integrations/ESPHome/Core.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index a4f7295..8736ae9 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -235,14 +235,13 @@ binary_sensor: input: true pullup: true inverted: true - on_state: + on_release: then: - if: condition: and: - switch.is_on: auto_refill - switch.is_on: invert_water_logic - - binary_sensor.is_off: fluid_input_sensor - switch.is_off: pump_control then: - logger.log: "Auto refill triggered - tank level low" From 0519e65c436d1c4a0e2340c511263a0300887da2 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Sun, 1 Mar 2026 15:03:52 -0600 Subject: [PATCH 10/24] Fix premature pump stop in inverted mode when using two sensors When stop_pump_when_full is ON, the output sensor already handles full detection. Skip the inverted-mode input sensor stop to prevent the pump from stopping as water passes the low-level sensor on the way to full. --- Integrations/ESPHome/Core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 8736ae9..c10412a 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -421,6 +421,7 @@ script: condition: - and: - switch.is_on: invert_water_logic + - switch.is_off: stop_pump_when_full - binary_sensor.is_on: fluid_input_sensor then: - logger.log: "Pump stopping - destination full (inverted mode)" From f7af815f2e358bdacb9b6798dd2c3864be2f8c0a Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:22:34 -0600 Subject: [PATCH 11/24] Bump version to 26.3.2.1 --- Integrations/ESPHome/Core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 193840b..d84e73e 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -1,6 +1,6 @@ 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: From 817818cc1ceecbaebb748e596afa8c395f65e5e3 Mon Sep 17 00:00:00 2001 From: bharvey88 <8107750+bharvey88@users.noreply.github.com> Date: Fri, 6 Mar 2026 12:12:55 -0600 Subject: [PATCH 12/24] fix: remove update_interval: never from Apollo Firmware Version sensor The sensor was showing "unknown" because update_interval: never prevents the lambda from ever firing. Removing it allows the default 60s periodic update to publish the version string. --- Integrations/ESPHome/Core.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 27b55f5..7bd4715 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -343,7 +343,6 @@ text_sensor: id: apollo_firmware_version lambda: |- return {"${version}"}; - update_interval: never entity_category: "diagnostic" script: From abfb0e8fec03083141dc2caf24009b0dd23455bd Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Fri, 6 Mar 2026 17:14:55 -0600 Subject: [PATCH 13/24] fix: publish firmware version once on boot instead of polling Per ESPHome dev feedback: the version is a compile-time constant, so publish it once on_boot rather than using a lambda with periodic updates. --- Integrations/ESPHome/Core.yaml | 3 +-- Integrations/ESPHome/PUMP-1.yaml | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 7bd4715..d93f774 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -341,8 +341,7 @@ text_sensor: - platform: template name: "Apollo Firmware Version" id: apollo_firmware_version - lambda: |- - return {"${version}"}; + update_interval: never entity_category: "diagnostic" script: diff --git a/Integrations/ESPHome/PUMP-1.yaml b/Integrations/ESPHome/PUMP-1.yaml index d0214b5..0fa81a0 100644 --- a/Integrations/ESPHome/PUMP-1.yaml +++ b/Integrations/ESPHome/PUMP-1.yaml @@ -4,6 +4,11 @@ esphome: comment: Apollo PUMP-1 name_add_mac_suffix: true on_boot: + - priority: 500 + then: + - text_sensor.template.publish: + id: apollo_firmware_version + state: "${version}" - priority: -10 then: - if: From f0f2a1211038328ea2881177cb101d952dfff711 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Fri, 6 Mar 2026 18:31:10 -0600 Subject: [PATCH 14/24] fix: add firmware version publish to PUMP-1_Minimal Add text_sensor.template.publish for apollo_firmware_version at priority 500 to PUMP-1_Minimal for dashboard import users. --- Integrations/ESPHome/PUMP-1_Minimal.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Integrations/ESPHome/PUMP-1_Minimal.yaml b/Integrations/ESPHome/PUMP-1_Minimal.yaml index ff36804..85c674b 100644 --- a/Integrations/ESPHome/PUMP-1_Minimal.yaml +++ b/Integrations/ESPHome/PUMP-1_Minimal.yaml @@ -8,6 +8,12 @@ esphome: 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 From 23a8b4cb8da0dcb25bdcd65fd3777554b86b4cbc Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Mon, 9 Mar 2026 15:28:43 -0500 Subject: [PATCH 15/24] fix: add logbook entry when auto refill triggers via invert water logic Adds a homeassistant.action logbook.log call in the fluid_input_sensor on_release handler so that HA logbook records when the pump is triggered automatically by the CPAP auto refill + invert water logic mode. --- Integrations/ESPHome/Core.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index d93f774..1dc1635 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -245,6 +245,11 @@ binary_sensor: - switch.is_off: pump_control then: - logger.log: "Auto refill triggered - tank level low" + - homeassistant.action: + action: logbook.log + data: + name: "PUMP-1" + message: "Auto refill triggered - tank level low" - script.execute: pumpUntilFull - platform: gpio From ab51496573ccec3f465ee5b357586955fdd0386e Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Tue, 10 Mar 2026 12:01:04 -0500 Subject: [PATCH 16/24] feat: add Pump Activity event entity for HA logbook Replaces the homeassistant.action logbook.log approach from #32 with an ESPHome event entity, which surfaces natively in the HA logbook without requiring API actions to be enabled on the device. Fires three event types: - auto_refill_triggered: CPAP auto refill + invert water logic triggers pump - pump_started: pump_control turns on and conditions are met - pump_stopped: pump_control turns off --- Integrations/ESPHome/Core.yaml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 1dc1635..4335d9e 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -173,6 +173,9 @@ switch: - switch.is_off: stop_pump_when_dry then: - logger.log: "Pump turning on - conditions met" + - event.trigger: + id: pump_activity_event + event_type: pump_started - lambda: |- id(pump_start_time) = millis(); id(safety_alert_active) = false; @@ -186,6 +189,9 @@ switch: id(pump_start_time) = 0; id(safety_alert_active) = false; - logger.log: "Pump turned off" + - event.trigger: + id: pump_activity_event + event_type: pump_stopped binary_sensor: - platform: status @@ -245,11 +251,9 @@ binary_sensor: - switch.is_off: pump_control then: - logger.log: "Auto refill triggered - tank level low" - - homeassistant.action: - action: logbook.log - data: - name: "PUMP-1" - message: "Auto refill triggered - tank level low" + - event.trigger: + id: pump_activity_event + event_type: auto_refill_triggered - script.execute: pumpUntilFull - platform: gpio @@ -333,6 +337,16 @@ light: min_brightness: 50% max_brightness: 100% +event: + - platform: template + name: "Pump Activity" + id: pump_activity_event + icon: mdi:pump + event_types: + - auto_refill_triggered + - pump_started + - pump_stopped + text_sensor: - platform: wifi_info ip_address: From dd9cb47fbde60d335b8fa51e06120d631efd2820 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Tue, 10 Mar 2026 12:11:02 -0500 Subject: [PATCH 17/24] fix: guard pump_stopped event and log against rejected starts pump_start_time is only set when the pump actually starts successfully. Checking != 0 before logging and emitting pump_stopped prevents false logbook entries when a start is rejected and switch.turn_off is called from the else branch of on_turn_on. --- Integrations/ESPHome/Core.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 4335d9e..0ecf95c 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -185,13 +185,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" + - event.trigger: + id: pump_activity_event + event_type: pump_stopped - lambda: |- id(pump_start_time) = 0; id(safety_alert_active) = false; - - logger.log: "Pump turned off" - - event.trigger: - id: pump_activity_event - event_type: pump_stopped binary_sensor: - platform: status From 9a9644a257192dd1dd8f628bce856e3d4517cb69 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Tue, 10 Mar 2026 13:02:40 -0500 Subject: [PATCH 18/24] fix: replace event entity with text sensor for readable HA logbook entries ESPHome event entities show only a generic 'detected an event' string in the HA logbook. Replaces the Pump Activity event entity with a Last Pump Action text sensor whose state changes (Auto Refill Triggered, Pump Started, Pump Stopped) appear verbatim in the HA logbook. --- Integrations/ESPHome/Core.yaml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 0ecf95c..022b2c8 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -173,9 +173,9 @@ switch: - switch.is_off: stop_pump_when_dry then: - logger.log: "Pump turning on - conditions met" - - event.trigger: - id: pump_activity_event - event_type: pump_started + - text_sensor.template.publish: + id: last_pump_action + state: "Pump Started" - lambda: |- id(pump_start_time) = millis(); id(safety_alert_active) = false; @@ -190,9 +190,9 @@ switch: lambda: 'return id(pump_start_time) != 0;' then: - logger.log: "Pump turned off" - - event.trigger: - id: pump_activity_event - event_type: pump_stopped + - text_sensor.template.publish: + id: last_pump_action + state: "Pump Stopped" - lambda: |- id(pump_start_time) = 0; id(safety_alert_active) = false; @@ -255,9 +255,9 @@ binary_sensor: - switch.is_off: pump_control then: - logger.log: "Auto refill triggered - tank level low" - - event.trigger: - id: pump_activity_event - event_type: auto_refill_triggered + - text_sensor.template.publish: + id: last_pump_action + state: "Auto Refill Triggered" - script.execute: pumpUntilFull - platform: gpio @@ -341,17 +341,11 @@ light: min_brightness: 50% max_brightness: 100% -event: +text_sensor: - platform: template - name: "Pump Activity" - id: pump_activity_event + name: "Last Pump Action" + id: last_pump_action icon: mdi:pump - event_types: - - auto_refill_triggered - - pump_started - - pump_stopped - -text_sensor: - platform: wifi_info ip_address: name: "IP Address" From 0ec11e9ddf85192ebbb124ed475620aa1872d4c5 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Wed, 11 Mar 2026 13:43:50 -0500 Subject: [PATCH 19/24] feat: rename Invert Water Logic to Tank Refill Mode + auto-configure switches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renames the switch name, id, and all 4 condition references from invert_water_logic to tank_refill_mode for clarity. Adds on_turn_on/on_turn_off handlers to auto-configure related switches: - Turn ON: Stop Pump When Output Wet → ON, Stop Pump When Input Dry → OFF - Turn OFF: Stop Pump When Output Wet → OFF, Stop Pump When Input Dry → ON --- Integrations/ESPHome/Core.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 022b2c8..1dc9ef3 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -128,12 +128,20 @@ switch: icon: mdi:water-sync entity_category: config - platform: template - name: "Invert Water Logic" - id: invert_water_logic + 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 + on_turn_off: + then: + - switch.turn_off: stop_pump_when_full + - switch.turn_on: stop_pump_when_dry - platform: template name: "Auto Refill" id: auto_refill @@ -163,11 +171,11 @@ switch: or: # Normal mode: input has water - and: - - switch.is_off: invert_water_logic + - 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: invert_water_logic + - 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 @@ -251,7 +259,7 @@ binary_sensor: condition: and: - switch.is_on: auto_refill - - switch.is_on: invert_water_logic + - switch.is_on: tank_refill_mode - switch.is_off: pump_control then: - logger.log: "Auto refill triggered - tank level low" @@ -435,7 +443,7 @@ script: - if: condition: - and: - - switch.is_on: invert_water_logic + - switch.is_on: tank_refill_mode - switch.is_off: stop_pump_when_full - binary_sensor.is_on: fluid_input_sensor then: @@ -445,7 +453,7 @@ script: condition: - and: - switch.is_on: stop_pump_when_dry - - switch.is_off: invert_water_logic + - switch.is_off: tank_refill_mode - binary_sensor.is_off: fluid_input_sensor then: - logger.log: "Pump stopping - input dry" From 712e264da42ec579a372fd88d97659129a62dfb8 Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Wed, 11 Mar 2026 13:56:08 -0500 Subject: [PATCH 20/24] fix: sync dependent switches on boot to match restored tank_refill_mode state on_turn_on/on_turn_off only fire when explicitly toggled, not on boot restore. Adds a priority -20 on_boot handler that reads tank_refill_mode and sets stop_pump_when_full and stop_pump_when_dry accordingly so all three switches are in sync after every reboot. --- Integrations/ESPHome/Core.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 1dc9ef3..d70358d 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -17,9 +17,20 @@ 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 + else: + - switch.turn_off: stop_pump_when_full + - switch.turn_on: stop_pump_when_dry - priority: -100 then: - - delay: 1000ms + - delay: 1000ms - script.execute: statusCheck - priority: -10 then: From 894a3161379be414c4082bddb5e2f0557c3d65ba Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Tue, 17 Mar 2026 11:49:47 -0500 Subject: [PATCH 21/24] feat: auto-toggle Auto Refill with Tank Refill Mode --- Integrations/ESPHome/Core.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index d70358d..a5e0790 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -25,9 +25,11 @@ esphome: 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 @@ -149,10 +151,12 @@ switch: 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 From bb25a90a680c7f7d524889c366ab11de9f7531bc Mon Sep 17 00:00:00 2001 From: bharvey88 <8107750+bharvey88@users.noreply.github.com> Date: Wed, 10 Jun 2026 16:00:31 -0500 Subject: [PATCH 22/24] Run label-check and auto-assign via pull_request_target Fork-submitted PRs get a read-only token on pull_request runs, so the label and assignee bots fail with 403. pull_request_target runs in the base repo context with a write token; safe here because neither job checks out or executes PR code. Build jobs stay on pull_request. Trim ci.yml permissions to what the builds need. --- .github/workflows/autoassign.yml | 5 ++++- .github/workflows/ci.yml | 7 ------- .github/workflows/label-check.yml | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/label-check.yml diff --git a/.github/workflows/autoassign.yml b/.github/workflows/autoassign.yml index d5a6557..dfdfada 100644 --- a/.github/workflows/autoassign.yml +++ b/.github/workflows/autoassign.yml @@ -1,8 +1,11 @@ name: Auto Assign +# pull_request_target (not pull_request) so assignment works on +# fork-submitted PRs; fork pull_request runs get a read-only token. +# Safe because this workflow never checks out or executes PR code. on: issues: types: [opened] - pull_request: + pull_request_target: types: [opened] jobs: run: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 187fd8b..fb08129 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,17 +4,10 @@ on: pull_request: permissions: - # Allow GITHUB_TOKEN to add labels to pull requests - pull-requests: write - issues: write contents: read id-token: write jobs: - label-check: - name: Label Check - uses: ApolloAutomation/Workflows/.github/workflows/label-check.yml@main - ci: name: Building ${{ matrix.file }} / ESPHome ${{ matrix.esphome-version }} runs-on: ubuntu-latest diff --git a/.github/workflows/label-check.yml b/.github/workflows/label-check.yml new file mode 100644 index 0000000..96a9751 --- /dev/null +++ b/.github/workflows/label-check.yml @@ -0,0 +1,20 @@ +name: Label Check + +# pull_request_target (not pull_request) so the job gets a write token on +# fork-submitted PRs too; plain pull_request runs from forks are read-only +# and cannot add labels. Safe because the called workflow only reads the PR +# body and never checks out or executes PR code. The "edited" type re-runs +# the check when the template checkboxes are changed. +on: + pull_request_target: + types: [opened, edited, reopened, synchronize] + +permissions: + pull-requests: write + issues: write + contents: read + +jobs: + label-check: + name: Label Check + uses: ApolloAutomation/Workflows/.github/workflows/label-check.yml@main From d51b0d9b6da9034a6f39b1669b8f89fba79b56cf Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Wed, 10 Jun 2026 22:00:12 -0500 Subject: [PATCH 23/24] Check for updates when the network connects The http_request update component polls every 6h and the first poll fires before the network is up, so a freshly booted device does not see an available update for up to 6 hours. Trigger a manifest check as soon as the network connects. --- Integrations/ESPHome/PUMP-1.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Integrations/ESPHome/PUMP-1.yaml b/Integrations/ESPHome/PUMP-1.yaml index 0fa81a0..d82dd26 100644 --- a/Integrations/ESPHome/PUMP-1.yaml +++ b/Integrations/ESPHome/PUMP-1.yaml @@ -50,6 +50,8 @@ update: source: https://apolloautomation.github.io/PUMP-1/firmware/manifest.json wifi: + on_connect: + - component.update: firmware_update ap: ssid: "Apollo PUMP-1 Hotspot" From f07d04b3b2f38d7124651831899b6dc2e5362402 Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Wed, 10 Jun 2026 22:33:57 -0500 Subject: [PATCH 24/24] Release notes: compact formatting for the HA update dialog Home Assistant shows only the first 255 characters of an ESPHome release summary, so boilerplate is expensive and ## headings render oversized in the update dialog: - Render category titles and What's Changed in bold instead of H2 - Drop the star-the-repo footer - Drop the Full Changelog line: it semver-truncates 4-part versions (always links ...X.Y.Z.1) - the shared build workflow now appends a correct compare link instead --- .github/release-drafter.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index d827a3b..dc3f169 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -2,6 +2,7 @@ name-template: 'Release v$NEXT_PATCH_VERSION' tag-template: "$RESOLVED_VERSION" change-template: "- #$NUMBER $TITLE @$AUTHOR" sort-direction: ascending +category-template: '**$TITLE**' categories: - title: "🚨 Breaking changes" @@ -26,11 +27,9 @@ include-labels: no-changes-template: '- No changes' +# The shared build workflow appends a Full Changelog compare link to the +# release body (release-drafter cannot render 4-part version tags). template: | - ## What's Changed + **What's Changed** $CHANGES - - **Full Changelog**: https://github.com/ApolloAutomation/PUMP-1/compare/$PREVIOUS_TAG...$RESOLVED_VERSION.1 - - Be sure to 🌟 this repository for updates! \ No newline at end of file