Skip to content

Commit

Permalink
TTS_Helper
Browse files Browse the repository at this point in the history
  • Loading branch information
djak250 committed Jun 8, 2024
1 parent 335c7e9 commit 096d218
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions Frigate Camera Notifications/Beta
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ action:
critical_input: !input critical
critical: "{{ true if critical_input == 'true' else true if critical_input == True else false }}"
tts: !input tts
tts_helper: !input tts_helper
custom_filter: !input custom_filter
icon: !input icon
group: !input group
Expand All @@ -898,7 +899,8 @@ action:
camera(formatted): {{camera}}({{camera_name}}),
Base URL: {{base_url}},
critical: {{critical}},
tts: {{tts}},
tts: {{tts}}
helper: {{tts_helper if tts else 'N/A'}},
alert once: {{alert_once}},
Update Thumbnails: {{update_thumbnail}},
Video: {{video}},
Expand Down Expand Up @@ -1128,29 +1130,37 @@ action:
icon: "{{icon_3}}"
destructive: true

- if: "{{tts}}"
- if: "{{tts}} and {{id not in states(tts_helper)}}"
then:
- choose:
- conditions: "{{ not notify_group_target }}"
sequence:
- device_id: !input notify_device
domain: mobile_app
type: notify
sequence:
- choose:
- conditions: "{{ not notify_group_target }}"
sequence:
- device_id: !input notify_device
domain: mobile_app
type: notify
message: "{{'TTS'}}"
data:
tag: "{{ id }}{{'-tts'}}"
channel: "{{'alarm_stream' if critical else channel}}"
alert_once: "{{ alert_once }}"
tts_text: "{{message}}"
default:
- service: "notify.{{ notify_group_target }}"
data:
message: "{{'TTS'}}"
data:
tag: "{{ id }}{{'-tts'}}"
channel: "{{'alarm_stream' if critical else channel}}"
alert_once: "{{ alert_once }}"
tts_text: "{{message}}"
default:
- service: "notify.{{ notify_group_target }}"
data:
message: "{{'TTS'}}"
data:
tag: "{{ id }}{{'-tts'}}"
channel: "{{'alarm_stream' if critical else channel}}"
alert_once: "{{ alert_once }}"
tts_text: "{{message}}"
- service: input_text.set_value
data:
value: |
{% set newIds = id + '|' + states(tts_helper) %}
{{ newIds[:250] }
target:
entity_id: input_text.tts_notifications
- repeat:
sequence:
- wait_for_trigger:
Expand Down

0 comments on commit 096d218

Please sign in to comment.