Skip to content

Instantly share code, notes, and snippets.

@bbbenji
Created March 23, 2026 12:31
Show Gist options
  • Select an option

  • Save bbbenji/0eb0620dbbbcf2810b291d4b68d1ebb3 to your computer and use it in GitHub Desktop.

Select an option

Save bbbenji/0eb0620dbbbcf2810b291d4b68d1ebb3 to your computer and use it in GitHub Desktop.
blueprint:
name: Door Open Notification
description: Sends a notification when a door sensor is opened, with support for actionable responses.
domain: automation
input:
door_sensor:
name: Door Sensor
description: Select the Zigbee door/window sensor
selector:
entity:
filter:
- device_class: door
domain: binary_sensor
- device_class: opening
domain: binary_sensor
notification_type:
name: Notification Type
description: Choose how you want to be notified
selector:
select:
options:
- label: Mobile App Only
value: mobile_only
- label: HTML5 Push Only
value: html5_only
- label: Both
value: both
default: mobile_only
notify_device:
name: Mobile Notification Device
description: Device to receive mobile app notifications
selector:
device:
filter:
integration: mobile_app
default: null
html5_notify_service:
name: HTML5 Notification Service
description: The notify service for HTML5 (e.g., notify.html5_chrome)
selector:
entity:
filter:
domain: notify
default: null
mode: single
triggers:
- trigger: state
entity_id: !input door_sensor
to: "on"
from: "off"
actions:
- variables:
notification_type: !input notification_type
notify_device: !input notify_device
html5_service: !input html5_notify_service
friendly_name: "{{ state_attr(trigger.entity_id, 'friendly_name') | default('A door') }}"
# Send Mobile App Notification
- if:
- condition: template
value_template: "{{ notification_type in ['mobile_only', 'both'] and notify_device is not none }}"
then:
- domain: mobile_app
type: notify
device_id: !input notify_device
title: "Security Alert"
message: "{{ friendly_name }} has been opened."
data:
ttl: 0
priority: high
channel: security_alerts
tag: door_alert
# Send HTML5 Push Notification
- if:
- condition: template
value_template: "{{ notification_type in ['html5_only', 'both'] and html5_service is not none }}"
then:
- action: "{{ html5_service }}"
data:
title: "Security Alert"
message: "{{ friendly_name }} has been opened."
data:
tag: door_alert
requireInteraction: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment