From cb8fa16aa62cc0a1137fcd2a27370f9a435cfe48 Mon Sep 17 00:00:00 2001 From: Jeremy M Crews Date: Mon, 29 Apr 2024 17:37:36 -0700 Subject: [PATCH] pushing LM 0.2.0 --- automations/lock_management/CHANGELOG.md | 6 ++- .../dev/lock_management_dev.yaml | 2 +- .../lock_management/lock_management.yaml | 44 ++++++++++++++++++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/automations/lock_management/CHANGELOG.md b/automations/lock_management/CHANGELOG.md index d67a06b..7c061e6 100644 --- a/automations/lock_management/CHANGELOG.md +++ b/automations/lock_management/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [0.2.0rc1] 2024-04-29 +### Added +- Notification + ## [0.1.0] - 2024-04-29 ### Added -- Initial release of the Log Management Blueprint. +- Initial release of the Log Management Blueprint. \ No newline at end of file diff --git a/automations/lock_management/dev/lock_management_dev.yaml b/automations/lock_management/dev/lock_management_dev.yaml index 4a35b65..9cbd602 100644 --- a/automations/lock_management/dev/lock_management_dev.yaml +++ b/automations/lock_management/dev/lock_management_dev.yaml @@ -1,5 +1,5 @@ blueprint: - name: Lock Management Dev (0.2.0.r13) + name: Lock Management Dev (0.3.0.r0) description: lock Management domain: automation source_url: https://github.com/asucrews/ha-blueprints/blob/main/automations/lock_management/lock_management.yaml diff --git a/automations/lock_management/lock_management.yaml b/automations/lock_management/lock_management.yaml index 012d5a2..b89f8b6 100644 --- a/automations/lock_management/lock_management.yaml +++ b/automations/lock_management/lock_management.yaml @@ -1,5 +1,5 @@ blueprint: - name: Lock Management Stable (0.1.0) + name: Lock Management Stable (0.2.0) description: lock Management domain: automation source_url: https://github.com/asucrews/ha-blueprints/blob/main/automations/lock_management/lock_management.yaml @@ -21,10 +21,20 @@ blueprint: domain: - timer multiple: false + notify_device: + name: Easy Notify - Devices Notified (Optional) + description: If you've enabled device notifications above, please select the devices to receive the notifications. + default: [] + selector: + device: + filter: + - integration: mobile_app + multiple: true variables: lock: !input lock auto_lock_timer: !input auto_lock_timer + notify_device: !input notify_device trigger: - platform: event @@ -69,6 +79,22 @@ action: data: {} target: entity_id: !input auto_lock_timer + - if: + - condition: template + value_template: "{{ notify_device | length > 0 }}" + then: + - repeat: + for_each: !input notify_device + sequence: + - service: notify.mobile_app_{{ device_attr(repeat.item, 'name') | slugify }} + data: + message: > + {% if code_slot > 0 %} + "{{ device_attr(lock, 'name') }} was unlocked by {{ code_slot_name }}" + {% else %} + "{{ device_attr(lock, 'name') }} was unlocked" + {% endif %} + title: "{{ device_attr(lock, 'name') }}" - conditions: - condition: template value_template: "{{ lock_state == 'unlocked' }}" @@ -98,6 +124,22 @@ action: data: {} target: entity_id: !input auto_lock_timer + - if: + - condition: template + value_template: "{{ notify_device | length > 0 }}" + then: + - repeat: + for_each: !input notify_device + sequence: + - service: notify.mobile_app_{{ device_attr(repeat.item, 'name') | slugify }} + data: + message: > + {% if code_slot > 0 %} + "{{ device_attr(lock, 'name') }} was unlocked by {{ code_slot_name }}" + {% else %} + "{{ device_attr(lock, 'name') }} was unlocked" + {% endif %} + title: "{{ device_attr(lock, 'name') }}" - conditions: - condition: and conditions: