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 scripts and data-templating to alerts #100525
Add scripts and data-templating to alerts #100525
Conversation
Hey there @home-assistant/core, @frenck, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
2bce0cb
to
443f3da
Compare
ec4482e
to
f7ef8d3
Compare
f7ef8d3
to
a7cc2ad
Compare
@frenck I know the guidance is to have one feature per PR, this one has two - data templating for |
Thanks for the PR! The core team has discussed this PR. We don’t want to expand the alert integration any further. Our future plans for this integration is to replace it with blueprinted automations. Once we have evolved our blueprint feature we plan to deprecate this integration. Thanks for your willingness to contribute! |
Understood, thanks for sharing the roadmap. I'll isolate this into a HACS Integration until that time, and watch the release notes (I presume I'll start getting deprecation warnings on Alert!). |
With the decision to deprecate, are we making assumptions about how people use this? I don't use it to trigger alerts in the traditional sense (eg. emails to other "notifiers"). I use it along with auto-entities to display warnings, errors, etc. in the Lovelace interface that a user can easily ackownledge as a known condition. There is no way that I could do this with an automation without creating a whole heap of logic and additional helper entities. |
Proposed change
Alerts are a great tool for easy repeating notifications of things that need to be done. Occasionally, cases come up where users need more functionality than is currently given. In my case, I wanted to be able to have a templated subtitle:
Other's have wanted to be able to call scripts from
alert
, so they can do things like TTS calls (ex1, ex2). Calling a script gives effectively infinite possibilities for the notification message, or other actions, and was my initial implementation to solve this problem. As far as I am aware,alert
integrations are the only place that specifically requires anotify
object. Introducing anotify
that calls a script would be another solution (aka, atemplate_notify
), but it seemed cleaner to me to add the ability for analert
to call a script directly.After getting script calling working, I realized I should just add templating support to the
data
(ordata_template
, which I copied the logic from therest
integration). Both are included in this PR. I can split if needed, or eliminate one half if desired.Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: