From 39d79f1ac49fc7f21a4b62802f49c9339054bdb9 Mon Sep 17 00:00:00 2001 From: Carlo Costanzo Date: Fri, 19 Sep 2025 22:08:19 -0400 Subject: [PATCH] Add Phyn Leak Detection Notification Automation Implemented a persistent notification for critical leak detection alerts in phynplus.yaml. Added automation to dismiss the notification when the water valve is opened, ensuring users are informed and can take necessary actions. This enhances the overall functionality and user experience of the Phyn integration. #1531 --- config/packages/phynplus.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/config/packages/phynplus.yaml b/config/packages/phynplus.yaml index 108daae6..018dd96d 100755 --- a/config/packages/phynplus.yaml +++ b/config/packages/phynplus.yaml @@ -36,6 +36,17 @@ automation: icon1: 'sfsymbols:arrow.up.circle' icon2: 'sfsymbols:clock' level: 'critical' + + - service: persistent_notification.create + data: + title: '🚨 Phyn Leak Detection Alert' + message: | + **CRITICAL**: Phyn has detected a potential leak and automatically shut off the main water supply. + + **Action Required**: Please verify there are no leaks in the house before turning the water back on. + + **Time**: {{ now().strftime('%Y-%m-%d %H:%M:%S') }} + notification_id: 'phyn_leak_detection' - alias: Turn Phyn Water On id: 1f295bb8-8925-4b22-PHYN-9fe079b295a8 @@ -48,6 +59,10 @@ automation: - service: homeassistant.turn_on entity_id: valve.phyn_shutoff_valve + - service: persistent_notification.dismiss + data: + notification_id: 'phyn_leak_detection' + - service: script.notify_engine data: title: 'Phyn Leak Detection' @@ -82,3 +97,16 @@ automation: icon1: 'sfsymbols:arrow.up.circle' icon2: 'sfsymbols:clock' level: 'critical' + + - alias: Dismiss Phyn Notification When Valve Opens + id: 3f295bb8-8925-4b22-PHYN-9fe079b295a8 + trigger: + - platform: state + entity_id: valve.phyn_shutoff_valve + to: 'open' + action: + - service: persistent_notification.dismiss + data: + notification_id: 'phyn_leak_detection' + +