Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save justintime/b6f97526963276ef52da247d9f7c10fe to your computer and use it in GitHub Desktop.
Save justintime/b6f97526963276ef52da247d9f7c10fe to your computer and use it in GitHub Desktop.
blueprint:
name: Leak detection & notifier
description: Send a notification when any configured moisture sensor becomes moist
domain: automation
input:
notify_device:
name: Notify device
description: "The device where the notification should be sent to."
selector:
device:
integration: mobile_app
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:
domain: mobile_app
type: notify
device_id: !input notify_device
title: "Leak detected!"
message: "{{ trigger.event.data.new_state.attributes.friendly_name }} has detected a leak."
data:
push:
sound:
name: default
critical: 1
volume: 1
mode: single
@justintime
Copy link
Author

This is the same as the version it's forked from, except that the notification it sends is sent as a critical notification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment