I am having some automations where I have notified only myself. My wife would also like to receive the notifications, and I have made that work like this:
def skal (self, entity, attribute, old, new, kwargs):
if self.get_state("input_boolean.alarm_mode") == "on":
self.notify("Vindue eller dør åben!", name = "telegram_morten")
self.notify("Vindue eller dør åben!", name = "telegram_trine")
But I think it is rather ineffecient to have two lines doing basically the same.
I tried to make a:
self.notify("Vindue eller dør åben!", name = ("telegram_trine", "telegram_morten")
self.notify("Vindue eller dør åben!", name = (["telegram_trine", "telegram_morten"])
But none of those works.
I also tried to make a workaround via apps.yaml:
Alarm:
module: alarm
class: alarm
telegramID:
-telegram_morten
-telegram_trine
And then in the app
self.notify("Vindue eller dør åben!", name = self.args["telegramID"])
Also no luck.