Text notify can now send actionable notifications, close #78

This commit is contained in:
2023-03-05 15:09:09 -05:00
parent bb94b7d003
commit 0b503aab41
2 changed files with 23 additions and 13 deletions

View File

@ -724,6 +724,12 @@ script:
required: false
selector:
text:
actions:
name: Actions
description: Dictionary describing actions for an actionable notification
required: false
selector:
object:
sequence:
- choose:
- conditions:
@ -749,6 +755,7 @@ script:
message: "{{ message }}"
data:
tag: '{{ tag if tag is defined else "{}" }}'
actions: '{{ actions if actions is defined else "{}" }}'
entity_id: '{{ entity if entity is defined else "{}" }}'
push:
sound:
@ -777,6 +784,7 @@ script:
message: '{{ message }}'
data:
tag: '{{ tag if tag is defined else "{}" }}'
actions: '{{ actions if actions is defined else "{}" }}'
entity_id: '{{ entity if entity is defined else "{}" }}'
push:
sound:
@ -833,6 +841,7 @@ script:
message: '{{ message }}'
data:
tag: '{{ tag if tag is defined else "{}" }}'
actions: '{{ actions if actions is defined else "{}" }}'
entity_id: '{{ entity if entity is defined else "{}" }}'
push:
sound:

View File

@ -468,21 +468,22 @@ script:
- condition: state
entity_id: group.adults
state: not_home
- service: >
{% if states('person.christina_stork') in ['Bob Evans','BobEvans'] %}
notify.ios_nerds
{% else %}
notify.all_ios
{% endif %}
- service: script.text_notify
data:
who: >
{% if states('person.christina_stork') in ['Bob Evans','BobEvans'] %}
nerds
{% else %}
all
{% endif %}
type: alert
title: "Everyone Left"
message: "Away mode arming in 1 minute"
data:
tag: skip-away
actions:
- action: "SKIP_AWAY"
title: Skip Away Mode
icon: mdi:debug-step-over
message: "Away Mode arming in 1 minute"
tag: skip-away
actions:
- action: "SKIP_AWAY"
title: Skip Away Mode
icon: mdi:debug-step-over
- wait_template: "{{ is_state('input_boolean.away_mode_skipped','on') or is_state('group.adults','home') }}"
continue_on_timeout: true
timeout: