Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TTS option for android dnd/silence override #221

Merged
merged 2 commits into from
Jun 8, 2024

Conversation

djak250
Copy link
Contributor

@djak250 djak250 commented Jun 5, 2024

TTS is sent separately from real message to get both.

@@ -1072,7 +1081,7 @@ action:
title: "{{title}}"
message: "{{message}}"
data:
tag: "{{ id }}{{'-loitering' if loitering}}"
tag: "{{ id }}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reson this was changed. I personally have never enabled loitering but if there is something i should know please let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was on the "new" event notification. It was inconsistent with the other two notification types in the section, and I don't believe you can get a new event that is also loitering, anyways. It would have to be an update, since loitering is some amount of time since the event began, right?

SgtBatten
SgtBatten previously approved these changes Jun 5, 2024
@djak250
Copy link
Contributor Author

djak250 commented Jun 5, 2024

I need to do a little more refinement on this. TTS alerting configs aren't consistent with normal notification configs. alert_once, for instance, seems to mean nothing when TTS is involved, since the audio from a TTS notification isn't an "alert" (like a ringer). I'll need to find a way to store if a TTS notification has been sent already, and check it during subsequent qualified event updates. Right now it announces every update, which is very annoying. TTS alerts may just need to be locked down to notifying one time, regardless of the alert_once Boolean.

TTS is sent separately from real message to get both.
@djak250
Copy link
Contributor Author

djak250 commented Jun 5, 2024

Made an issue for better support: home-assistant/android#4440
However, I'm still experimenting with some ways to accomplish it without that change.

When an Event triggers a TTS notification, the Event ID is prepended
onto this input text helper. On subsequent updates to the event, this
helper is first checked to see if it contains the event ID, indicating
that a TTS alert has already fired. If this is the case, TTS will not
fire again for this event.
@djak250 djak250 marked this pull request as ready for review June 8, 2024 05:30
@djak250
Copy link
Contributor Author

djak250 commented Jun 8, 2024

@SgtBatten I found a rough solution to prevent TTS alerts occurring on every update. Unfortunately it involves having the end user create a input text helper, and specifying it in the config.

A small price to pay, all things considered.

@SgtBatten SgtBatten merged commit 50c90d5 into SgtBatten:main Jun 8, 2024
SgtBatten added a commit that referenced this pull request Jun 8, 2024
@djak250 djak250 deleted the tts branch June 10, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants