WTH are alerts only support triggering a notify? Supporting scripts would be awesome.
I’m having a script that:
1 - if people are at home; only notifies those people
2 - if theres nobody; sends notify to the person last leaved home (within the last 5 minutes)
3 - if theres nobody; sends notify to all persons
This can’t be done using alerts. Automations support that, but it’s harder to archive things like skip first X messages, repeat every 30, 60, then 90 minutes, and so on.
How about having the alert integration just directly support the script syntax, and create variable(s) with the message details? That way you can notify if you want, or do a couple of different things directly in the alert config, or have it call a script.
FWIW, in the meantime, the “work around” I’ve seen used is to use a “dummy” notify that does nothing, then have an automation that watches for a call_service event that calls that notify. The automation actions can then do whatever you like.
Would love this as well. Running into significant limitations with Alerts right now due to the inability to call a script (or more specifically MQTT Publish, even by proxy via a script).
Another option would be to allow Alerts to trigger automations. There are workarounds like this but something native would be much nicer for lots of reasons.
Perhaps this could be accomplished via an event that is created when the Alert triggers then the Automation can listen for that as a trigger? Maybe it needs it’s own, new mechanism.
By allowing direct trigger of automations you could call scripts and do a bunch of other things too. My use case is to just get a script to run but doing it via an Automation (and the added power that comes with that) would be a good solution too.