Files
Home-AssistantConfig/config/packages/phynplus.yaml
Carlo Costanzo 39d79f1ac4 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
2025-09-19 22:08:27 -04:00

113 lines
3.6 KiB
YAML
Executable File

#-------------------------------------------
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# Phyn Smart Water ShutOff Support
# https://www.vcloudinfo.com/2020/05/phyn-plus-smart-water-shutoff-device.html
# Added in Custom HACK integration via https://github.com/MizterB/homeassistant-phyn
#-------------------------------------------
######################################################################
## Phyn Plus Water ShutOff - https://amzn.to/2Zy3sbJ
######################################################################
automation:
- alias: 'Phyn ShutOff Notification'
id: 78bbd270-ee1e-4b3d-80fd-44ce7c66dab5
mode: single
trigger:
- platform: state
entity_id: valve.phyn_shutoff_valve
to: 'closed'
condition:
- condition: state
entity_id: binary_sensor.phyn_leak_test_running
state: 'off'
action:
- service: script.notify_engine_two_button
data:
title: 'Phyn Leak Detection'
value1: 'Phyn is sensing a leak and turned off the water. Please verify.'
who: 'parents'
group: 'Phyn'
action1: 'PHYN_WATER_ON'
action2: 'SNOOZE_PHYN_NOTIFICATION'
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
trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
action: PHYN_WATER_ON
action:
- 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'
value1: 'Request Received. Attempting to Turn the Water back on.'
who: 'parents'
group: 'Phyn'
level: 'time-sensitive'
- service: script.speech_engine
data:
value1: >
I have been asked to Turn the House Water back on. Please verify there are no leaks in the house.
call_no_announcement: 1
- alias: Snooze Phyn Notification
id: 2f295bb8-8925-4b22-PHYN-9fe079b295a8
trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
action: SNOOZE_PHYN_NOTIFICATION
action:
- delay: '00:30:00'
- service: script.notify_engine_two_button
data:
title: 'Phyn Leak Detection'
value1: 'Phyn is sensing a leak and turned off the water. Please verify.'
who: 'parents'
group: 'Phyn'
action1: 'PHYN_WATER_ON'
action2: 'SNOOZE_PHYN_NOTIFICATION'
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'