docker-apps/home-assistant/Send Dynamic Notification To All Devices.yml

107 lines
3.0 KiB
YAML

alias: Send Dynamic Notification To All Devices
sequence:
- parallel:
# - if:
# - condition: template
# value_template: '{{ send_to_fold | default(True) }}'
# then:
# - data:
# message: '{{ message }}'
# title: '{{ title }}'
# data:
# channel: '{{ channel }}'
# clickAction: '{{ video }}'
# tag: '{{ notifTag }}'
# group: '{{ group }}'
# image: '{% if (importance == "default" and video != null) -%} {{ null
# }} {%- else -%} {{ image }} {%- endif %}'
# video: '{% if (importance == "default" and video != null) -%} {{ video
# }} {%- else -%} {{ null }} {%- endif %}'
# notification_icon: '{{ notifIcon }}'
# importance: '{{ importance }}'
# action: notify.mobile_app_fold
- data:
message: '{{ message }}'
title: '{{ title }}'
data:
url: '{{ video }}'
tag: '{{ notifTag }}'
group: '{{ group }}'
attachment:
url: '{% if (importance == "default" and video != null) -%} {{ video }} {%- else -%} {{ image }} {%- endif %}'
push:
interruption-level: '{% if importance == "max" -%} time-sensitive {%- else -%} passive {%- endif %}'
# must test above data sent to notify.mobile_app_sm_n986b and check whether the following data is needed
# actions:
# - action: URI
# title: Open Image
# uri: https://home-assistant.sthome.org/api/frigate/notifications/{{ id }}/thumbnail.jpg?format=android
action: notify.mobile_app_sm_n986b
# - if:
# - condition: template
# value_template: '{{ states("media_player.nova4k") != "off" }}'
# - condition: template
# value_template: '{{ importance == "max" }}'
# then:
# - data:
# message: '{{ message }}'
# title: '{{ title }}'
# data:
# fontsize: medium
# image:
# url: https://frigate.sthome.org/api/events/{{id}}/snapshot.jpg
# action: notify.nova_4k
mode: parallel
icon: mdi:bell-ring-outline
max: 10
fields:
id:
selector:
text: null
name: id
required: true
title:
selector:
text: null
name: title
required: true
message:
selector:
text: null
name: message
required: true
notiftag:
selector:
text: null
name: notifTag
required: true
notificon:
selector:
text: null
name: notifIcon
required: true
group:
selector:
text: null
name: group
required: true
importance:
selector:
text: null
name: importance
required: true
image:
selector:
text: null
name: image
required: true
clickaction:
selector:
text: null
name: clickAction
required: true
video:
selector:
text: null
name: video
required: true