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
pull/1535/head
Carlo Costanzo 3 months ago
parent fdc6e62708
commit 39d79f1ac4

@ -36,6 +36,17 @@ automation:
icon1: 'sfsymbols:arrow.up.circle' icon1: 'sfsymbols:arrow.up.circle'
icon2: 'sfsymbols:clock' icon2: 'sfsymbols:clock'
level: 'critical' 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 - alias: Turn Phyn Water On
id: 1f295bb8-8925-4b22-PHYN-9fe079b295a8 id: 1f295bb8-8925-4b22-PHYN-9fe079b295a8
@ -48,6 +59,10 @@ automation:
- service: homeassistant.turn_on - service: homeassistant.turn_on
entity_id: valve.phyn_shutoff_valve entity_id: valve.phyn_shutoff_valve
- service: persistent_notification.dismiss
data:
notification_id: 'phyn_leak_detection'
- service: script.notify_engine - service: script.notify_engine
data: data:
title: 'Phyn Leak Detection' title: 'Phyn Leak Detection'
@ -82,3 +97,16 @@ automation:
icon1: 'sfsymbols:arrow.up.circle' icon1: 'sfsymbols:arrow.up.circle'
icon2: 'sfsymbols:clock' icon2: 'sfsymbols:clock'
level: 'critical' 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'

Loading…
Cancel
Save

Powered by TurnKey Linux.