/leak-detector-notifier.yaml Secret
Last active
June 26, 2024 04:44
-
-
Save TurtleFX/213bd28f5cfb1a7cded5eb2e91aa30b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Leak detection & notification | |
description: Send a notification when any configured moisture sensor becomes moist | |
domain: automation | |
input: | |
actions: | |
name: Actions | |
description: Notifications or similar to be run. Use {{ trigger.event.data.new_state.attributes.friendly_name }} in a message for a friendly name of the sensor. | |
selector: | |
action: {} | |
trigger: | |
- event_data: {} | |
event_type: state_changed | |
platform: event | |
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: | |
- choose: [] | |
default: !input 'actions' | |
mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the blueprint. Very useful. Can I suggest an exemption please. So I added 4 leak sensors. Kitchen, Bathroom, toilet and Aquarium. I have your blueprint initiating a water valve turn off cutting off mains water and notification which works perfectly.
The Aquarium leak sensor I added is non critical and need it exempt from it. I am trying to figure out how to manually edit the blueprint but not sure I am getting it since very new to Home assistant let alone YAML.
So if you are not keen on adding this, can I confirm which one would work?
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" }}"
condition: not
conditions:
condition: device
device_id: XXXXXXXXXXXX
entity_id: YYYYYYYYYYYY
domain: binary_sensor
condition: and
conditions:
conditions:
condition: device
device_id: XXXXXXXXXXXX
entity_id: YYYYYYYYYYYY
domain: binary_sensor