From 169110c1fdf4c07b38d3e7771b57569d020d4c8d Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 15 Aug 2024 14:01:02 +0200 Subject: [PATCH] Add Blueprints --- .../confirmable_open_door_notification.yaml | 185 ++++++++++++++++++ docs/.vitepress/config.mts | 3 +- docs/automation/blueprints.md | 11 ++ 3 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 blueprints/confirmable_open_door_notification.yaml create mode 100644 docs/automation/blueprints.md diff --git a/blueprints/confirmable_open_door_notification.yaml b/blueprints/confirmable_open_door_notification.yaml new file mode 100644 index 0000000..6fe6c15 --- /dev/null +++ b/blueprints/confirmable_open_door_notification.yaml @@ -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 diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 8b1e830..134f55f 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -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' } ] }, { diff --git a/docs/automation/blueprints.md b/docs/automation/blueprints.md new file mode 100644 index 0000000..b88f4c0 --- /dev/null +++ b/docs/automation/blueprints.md @@ -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) \ No newline at end of file