Skip to content

Commit

Permalink
Merge pull request #18 from AzonInc/dev
Browse files Browse the repository at this point in the history
Doorman Firmware 2024.8.2
  • Loading branch information
AzonInc authored Aug 16, 2024
2 parents 9c279d6 + a62159b commit 9bf9159
Show file tree
Hide file tree
Showing 17 changed files with 454 additions and 65 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
if: github.ref != 'refs/heads/master'
run: |
sed -i "s/\"version\": \".*\"/\"version\": \"${VERSION}-dev\"/" package.json
sed -i 's/@master/@dev/g' firmware/examples/stock.example.yaml
sed -i 's/@master/@dev/g' firmware/examples/nuki-bridge.example.yaml
sed -i 's/@master/@dev/g' docs/guide/getting-started.md
- name: Install dependencies
run: npm ci
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/bundle-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bundle build assets

on:
workflow_call:

jobs:
bundle-assets:
name: Create asset bundle
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create Output Directory
run: mkdir -p output

- name: Create Fimrware Directory
run: mkdir -p output/firmware/release/

- name: Download github-pages artifact
uses: actions/download-artifact@v4
with:
name: vitepress-docs
path: output

- name: Download Doorman Stock artifact
uses: actions/download-artifact@v4
with:
name: firmware-doorman-stock
path: output/firmware/release

- name: Download Doorman Nuki Bridge artifact
uses: actions/download-artifact@v4
with:
name: firmware-doorman-nuki-bridge
path: output/firmware/release

- name: Upload Pages artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v3
with:
path: output

- name: Upload Assets Bundle
if: github.ref != 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: asset-bundle
path: output
91 changes: 43 additions & 48 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,83 +19,78 @@ concurrency:
cancel-in-progress: false

jobs:
# Build Vitepress Docs
build-docs:
name: Build Docs
uses: ./.github/workflows/build-docs.yml

build-doorman-stock-firmware:
name: Build Doorman Stock Firmware

# Build stable firmware
build-doorman-stock-stable-firmware:
if: github.ref == 'refs/heads/master'
name: Build Doorman Stock Firmware (stable)
uses: ./.github/workflows/build-esphome.yml
with:
files: firmware/doorman-stock.yaml
name: AzonInc.Doorman
esphome_version: beta
directory_name: doorman-stock

build-doorman-nuki-bridge-firmware:
name: Build Doorman Nuki Bridge Firmware
build-doorman-nuki-bridge-stable-firmware:
if: github.ref == 'refs/heads/master'
name: Build Doorman Nuki Bridge Firmware (stable)
uses: ./.github/workflows/build-esphome.yml
with:
files: firmware/doorman-nuki-bridge.yaml
name: AzonInc.Doorman-Nuki-Bridge
esphome_version: beta
directory_name: doorman-nuki-bridge


# Bundle all assets for Pages
bundle-assets:
name: Create asset bundle
runs-on: ubuntu-latest
needs: [build-docs, build-doorman-stock-firmware, build-doorman-nuki-bridge-firmware]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create Output Directory
run: mkdir -p output

- name: Create Fimrware Directory
run: mkdir -p output/firmware/release/
# Build dev firmware
build-doorman-stock-dev-firmware:
if: github.ref != 'refs/heads/master'
name: Build Doorman Stock Firmware (dev)
uses: ./.github/workflows/build-esphome.yml
with:
files: firmware/doorman-stock.dev.yaml
name: AzonInc.Doorman
esphome_version: dev
directory_name: doorman-stock

- name: Download github-pages artifact
uses: actions/download-artifact@v4
with:
name: vitepress-docs
path: output
build-doorman-nuki-bridge-dev-firmware:
if: github.ref != 'refs/heads/master'
name: Build Doorman Nuki Bridge Firmware (dev)
uses: ./.github/workflows/build-esphome.yml
with:
files: firmware/doorman-nuki-bridge.dev.yaml
name: AzonInc.Doorman-Nuki-Bridge
esphome_version: dev
directory_name: doorman-nuki-bridge

- name: Download Doorman Stock artifact
uses: actions/download-artifact@v4
with:
name: firmware-doorman-stock
path: output/firmware/release

# Bundle all assets for Pages
bundle-assets-stable:
if: github.ref == 'refs/heads/master'
name: Create asset bundle (stable)
uses: ./.github/workflows/bundle-assets.yml
needs: [build-docs, build-doorman-stock-stable-firmware, build-doorman-nuki-bridge-stable-firmware]

- name: Download Doorman Nuki Bridge artifact
uses: actions/download-artifact@v4
with:
name: firmware-doorman-nuki-bridge
path: output/firmware/release
bundle-assets-dev:
if: github.ref != 'refs/heads/master'
name: Create asset bundle (dev)
uses: ./.github/workflows/bundle-assets.yml
needs: [build-docs, build-doorman-stock-dev-firmware, build-doorman-nuki-bridge-dev-firmware]

- name: Upload Pages artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v3
with:
path: output

- name: Upload Assets Bundle
if: github.ref != 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: asset-bundle
path: output

# Deployment job
deploy-master:
deploy-stable:
if: github.ref == 'refs/heads/master'
name: Deploy to Github Pages (stable)
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: [bundle-assets]
needs: [bundle-assets-stable]
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
Expand All @@ -108,7 +103,7 @@ jobs:
environment:
name: surge.sh
url: "https://doorman-dev.surge.sh/"
needs: [bundle-assets]
needs: [bundle-assets-dev]
runs-on: ubuntu-latest
steps:
- name: Download Assets
Expand Down
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
Loading

0 comments on commit 9bf9159

Please sign in to comment.