Last active
October 4, 2021 03:24
-
-
Save wied03/64dc7f7c0993c10a70ee35fccb5c1a9d to your computer and use it in GitHub Desktop.
This file contains hidden or 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: Water main shutoff | |
| description: Shutoff water main when there is a leak | |
| domain: automation | |
| input: | |
| water_cutoff_target: | |
| name: Water cutoff valve | |
| selector: | |
| target: | |
| entity: | |
| domain: switch | |
| 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: | |
| service: switch.turn_off | |
| target: !input water_cutoff_target | |
| mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment