Skip to content

Instantly share code, notes, and snippets.

@sekyHC
Last active November 21, 2023 19:11
Show Gist options
  • Save sekyHC/5f001951b04159f12e700b8b110602a4 to your computer and use it in GitHub Desktop.
Save sekyHC/5f001951b04159f12e700b8b110602a4 to your computer and use it in GitHub Desktop.
homeassistant smoke sensors notification
blueprint:
name: Smoke Alert
description: 'Push notification (mobile App) + persistent notification will be sent
as soon as one of the sensors detects smoke.'
domain: automation
input:
title:
name: Title
description: Title of the notification - by example !! FIRE ALERT !!
default: ' !! FIRE ALERT !!'
selector:
text:
text:
name: Text
description: 'Text Message. This message will be added
to the name of the sensor [sensor name] [text message].'
default: ' has detected Smoke!'
selector:
text:
trigger:
platform: template
value_template: "{{ states.binary_sensor | selectattr('attributes.device_class', 'eq', 'smoke') | map(attribute='state') | list | join(',') == 'on' }}"
variables:
text_var: !input text
action:
- service: notify.notify
data:
title: !input title
message: "{{state_attr(trigger.entity_id, 'friendly_name')}} {{text_var}}"
- service: notify.persistent_notification
data:
title: !input title
message: "{{state_attr(trigger.entity_id, 'friendly_name')}} {{text_var}}"
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment