Hi @benji,
I’ve been using this blueprint for a few weeks now and I never would’ve gotten this far without you, so thanks.
I migrated from Hubitat and they had a built in feature for this as well as some smart subsequent automations. I’m not here to tell anybody that this needs to be changed, but here’s some things that’ve helped me on another platform and I altered your blueprint to fit my needs (which might be useful to others).
Basic operation:
Detects the state change of moisture type sensors to on
Turn off DND on all voice assistants to prep for the announcements in case it’s at night
Turn off water supply valve (this is the part that was built into hubitat and what I am suggesting)
The water supply valve has it’s own independent automations that notify the house and devices if it is ever closed.
Activate a scene that turns all accent lights in the house blue
Notify phones with the dynamic announcement including leak sensor name
Announce via voice assistants including leak sensor name
By this time, the water supply valve would be closed and another message would’ve went to phones/voice assistant indicating the threat has been neutralized by turning off the water (in case I am unable to witness the messages in real time, the phones will still say where the leak was and that the water supply valve was closed).
This of course could all be in one automation and that’s where I was headed with this but then I decided at the last minute, I want to be notified of a water supply valve closure in all circumstances (not just leaks) so I left it separate for my circumstance.
Now that the lights are blue, I know where the leak is, and the water has been turned off, what do I do? I tied the lights reset automation back to the water supply valve being opened. Reason being, a leak sensor could stop being wet but the issue not yet resolved (because the water is still off or perhaps the leak is unresolved). The resetting of all the lights was cumbersome in Hubitat but I have adaptive lighting in HA, so I just automate a toggle on the adaptive lights and it puts everything back to how it should be. I guess this would be different for the user; a scene could be used for this too.
mode: single
- id: '1642307791979'
alias: Leak Detection - Notifier and Shutdown
description: ''
trigger:
- platform: event
event_type: state_changed
event_data: {}
condition:
- condition: template
value_template: '{{ trigger.event.data.new_state.attributes.device_class == "moisture"
}}'
- condition: template
value_template: '{{ trigger.event.data.new_state.state == "on" }}'
action:
- service: script.alexa_disable_do_not_disturb_all_devices
- type: turn_off
device_id: dfd03c8879f516f34824e0ade307bdf8
entity_id: switch.water_supply_valve
domain: switch
- service: scene.turn_on
target:
entity_id: scene.leak_detection_scene
- service: notify.mobile_app_sarge_s_phone
data:
message: '{{ trigger.event.data.new_state.attributes.friendly_name }} has detected
a leak.'
- service: notify.mobile_app_iphone
data:
message: '{{ trigger.event.data.new_state.attributes.friendly_name }} has detected
a leak.'
- service: notify.alexa_media
data:
target: media_player.kitchen_echo_show, media_player.2nd_floor_hallway_echo_dot,media_player.bathroom_1_echo_dot,
media_player.bedroom_2_echo_show,media_player.bedroom_echo_show, media_player.office_echo_show,media_player.garage_entryway_echo_show,
media_player.garage_echo_dot
data:
type: announce
message: '{{ trigger.event.data.new_state.attributes.friendly_name }} has detected
a leak.'
mode: single
These are merely fun suggestions that I’ve used in my personal setup and you can decide to incorporate them or not. Again, I want to thank you for the foundational legwork that made this easy for me to do.