Skip to content

Commit

Permalink
Add Blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Aug 15, 2024
1 parent 2a73672 commit 169110c
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 1 deletion.
185 changes: 185 additions & 0 deletions blueprints/confirmable_open_door_notification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
blueprint:
name: Confirmable Doorbell Open Door Notification
description: >-
A script that sends an actionable notification with a confirmation to open the door.
author: "AzonInc"
homeassistant:
min_version: "2024.6.0"
domain: automation
source_url: https://github.com/AzonInc/Doorman/blob/dev/blueprints/confirmable_open_door_notification.yaml
input:
doorbell_section:
name: "Doorbell Details"
icon: "mdi:doorbell"
input:
doorbell_sensor:
name: "Doorbell Sensor"
description: "The Binary Sensor which is triggered by the doorbell"
selector:
entity:
integration: esphome
domain: binary_sensor
open_door_command:
name: "Open Door Command"
description: "This Command will be sent to open the Door"
default: "1100"
selector:
text:
open_door_button_command:
name: "Open Door Button Command"
description: "This command will be used to check if the physical 'Open Door' button of your intercom was pressed."
default: "1c30ba80"
selector:
text:

notification_details_section:
name: "Notification Details"
icon: "mdi:bell"
input:
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
title:
name: "Title"
description: "The title of the button shown in the notification."
default: "Entrance Doorbell"
selector:
text:
short_message:
name: "Short Message"
description: "The message body"
default: "Somebody is at the door!"
selector:
text:
message:
name: "Message"
description: "The message body"
default: "Somebody is at the door! Would you like to open it?"
selector:
text:
confirm_text:
name: "Confirmation Text"
description: "Text to show on the confirmation button"
default: "Open Door"
selector:
text:
dismiss_text:
name: "Dismiss Text"
description: "Text to show on the dismiss button"
default: "No"
selector:
text:

notification_actions_section:
name: "Notification Actions"
icon: "mdi:gesture-tap-button"
input:
confirm_action:
name: "Confirmation Action"
description: "Action to run when notification is confirmed"
default:
- service: esphome.doorman_s3_send_tcs_command
data:
command: "{{ open_door_command | int(base=16) }}"
selector:
action:
dismiss_action:
name: "Dismiss Action"
description: "Action to run when notification is dismissed"
default: []
selector:
action:


mode: restart

trigger:
platform: state
entity_id: !input doorbell_sensor
from: "off"
to: "on"

action:
- alias: "Set up variables"
variables:
action_confirm: "{{ 'CONFIRM_' ~ context.id }}"
action_dismiss: "{{ 'DISMISS_' ~ context.id }}"
open_door_command: !input open_door_command
open_door_button_command: !input open_door_button_command
- parallel:
- sequence:
- alias: "Send notification"
domain: mobile_app
type: notify
device_id: !input notify_device
title: !input title
message: !input message
data:
tag: doorbell
timeout: 600
priority: high
ttl: 0
subject: !input short_message
actions:
- action: "{{ action_confirm }}"
title: !input confirm_text
- action: "{{ action_dismiss }}"
title: !input dismiss_text
- alias: "Awaiting response"
wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_confirm }}"
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_dismiss }}"
continue_on_timeout: false
timeout:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- choose:
- conditions: "{{ wait.trigger.event.data.action == action_confirm }}"
sequence: !input confirm_action
- conditions: "{{ wait.trigger.event.data.action == action_confirm }}"
sequence:
- alias: "Clear notification"
domain: mobile_app
type: notify
device_id: !input notify_device
message: clear_notification
data:
tag: doorbell
- conditions: "{{ wait.trigger.event.data.action == action_dismiss }}"
sequence: !input dismiss_action

- alias: "Clear Notification when someone opened the door already"
sequence:
- alias: "Awaiting response"
wait_for_trigger:
- platform: event
event_type: esphome.doorman
event_data:
command: !input open_door_command
- platform: event
event_type: esphome.doorman
event_data:
command: !input open_door_button_command
continue_on_timeout: false
timeout:
hours: 0
minutes: 10
seconds: 0
- alias: "Clear notification"
domain: mobile_app
type: notify
device_id: !input notify_device
message: clear_notification
data:
tag: doorbell
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export default defineConfig({
text: 'Automations',
items: [
{ text: 'Pattern Events', link: '/automation/pattern-events' },
{ text: 'Ring To Open', link: '/automation/ring-to-open' }
{ text: 'Ring To Open', link: '/automation/ring-to-open' },
{ text: 'Blueprints', link: '/automation/blueprints' }
]
},
{
Expand Down
11 changes: 11 additions & 0 deletions docs/automation/blueprints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Blueprints for Home Assistant

This is a collection of community contributed Blueprints.

## Confirmable Doorbell Open Door Notification

This Blueprint allows you to send a confirmable notification to a device with the Home Assistant app whenever someone rings the doorbell.

The default confirm action will send a command to open the entrance door but you can modify it to your needs.

[![Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.](https://my.home-assistant.io/badges/blueprint_import.svg)](https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https%3A%2F%2Fgithub.com%2FAzonInc%2FDoorman%2Fblob%2Fdev%2Fblueprints%2Fconfirmable_open_door_notification.yaml)

0 comments on commit 169110c

Please sign in to comment.