Compare commits

..

No commits in common. "main" and "20250725_ZUHUS-27-Notify-Script-einbauen" have entirely different histories.

3 changed files with 10 additions and 2407 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -74,33 +74,30 @@ fields:
selector:
boolean: {}
required: true
sequence:
- variables:
persistent_data: >-
{% if notify_persistent %}
{"notification_id": "{{ title | default("benachrichtigung") | lower | replace(" ", "_") }}"}
{% else %} {} {% endif %}
{% if notify_persistent %} {"notification_id": "{{ title |
default("benachrichtigung") | lower | replace(" ", "_") }}"} {% else %}
{} {% endif %}
- variables:
tv_on: "{{ is_state('media_player.lg_webos_tv_nano769qa', 'on') }}"
- variables:
notify_targets: >-
notify_targets: |-
{% set t = [] %}
{% if notify_persistent %}
{% set t = t + ['notify.persistent_notification'] %}
{% endif %}
{% if notify_alexa_durchsagen %}
{% set alexas_durchsagen = states.notify
| selectattr('entity_id', 'match', 'notify\\..*_durchsagen')
| rejectattr('entity_id', 'search', 'multiroom_durchsagen')
| rejectattr('entity_id', 'search', 'uberall_durchsagen')
| selectattr('entity_id', 'match', 'notify\\.echo_.*_durchsagen')
| map(attribute='entity_id')
| list %}
{% set t = t + alexas_durchsagen %}
{% endif %}
{% if notify_alexa_sprechen %}
{% set alexas_sprechen = states.notify
| selectattr('entity_id', 'match', 'notify\\..*_sprechen')
| selectattr('entity_id', 'match', 'notify\\.echo_.*_sprechen')
| map(attribute='entity_id')
| list %}
{% set t = t + alexas_sprechen %}
@ -123,14 +120,11 @@ sequence:
{% if notify_familie %}
{% set t = t + ['notify.mobile_app_finger_weg_du_spasst', 'notify.mobile_app_meins'] %}
{% endif %}
{{ t | map('lower') | map('trim') | unique | list }}
{{ t | unique | list }}
- repeat:
for_each: "{{ notify_targets }}"
sequence:
- choose:
# PERSISTENT NOTIFICATION
- conditions:
- condition: template
value_template: "{{ repeat.item == 'notify.persistent_notification' }}"
@ -140,8 +134,6 @@ sequence:
title: "{{ title | default('Benachrichtigung') }}"
data: "{{ persistent_data | from_json(default={}) }}"
action: notify.persistent_notification
# PUSHOVER
- conditions:
- condition: template
value_template: "{{ repeat.item.startswith('notify.pushover') }}"
@ -168,12 +160,9 @@ sequence:
message: "{{ message }}"
title: "{{ title | default('Benachrichtigung') }}"
action: "{{ repeat.item }}"
# ALEXA / SONOS (mit Verzögerung)
- conditions:
- condition: template
value_template: >
{{ repeat.item.endswith('_durchsagen') or repeat.item.endswith('_sprechen') }}
value_template: "{{ repeat.item.startswith('notify.echo_') }}"
sequence:
- data:
message: "{{ message }}"
@ -181,9 +170,6 @@ sequence:
target:
entity_id: "{{ repeat.item }}"
action: notify.send_message
- delay: "00:00:02"
# MOBILE APP (iOS/Android)
- conditions:
- condition: template
value_template: "{{ repeat.item.startswith('notify.mobile_app') }}"
@ -201,7 +187,7 @@ sequence:
sound:
name: default
critical: 1
volume: 1.0
volume: 1
action: "{{ repeat.item }}"
- conditions:
- condition: template
@ -211,8 +197,6 @@ sequence:
message: "{{ message }}"
title: "{{ title | default('Benachrichtigung') }}"
action: "{{ repeat.item }}"
# FALLBACK (TV, andere)
- conditions:
- condition: template
value_template: "{{ True }}"