diff --git a/homeassistant/components/notify_events/notify.py b/homeassistant/components/notify_events/notify.py index 23df01a128b..ce7c353badb 100644 --- a/homeassistant/components/notify_events/notify.py +++ b/homeassistant/components/notify_events/notify.py @@ -28,6 +28,8 @@ ATTR_FILE_MIME_TYPE = "mime_type" ATTR_FILE_KIND_FILE = "file" ATTR_FILE_KIND_IMAGE = "image" +ATTR_TOKEN = "token" + _LOGGER = logging.getLogger(__name__) @@ -114,7 +116,12 @@ class NotifyEventsNotificationService(BaseNotificationService): def send_message(self, message, **kwargs): """Send a message.""" + token = self.token data = kwargs.get(ATTR_DATA) or {} msg = self.prepare_message(message, data) - msg.send(self.token) + + if data.get(ATTR_TOKEN, "").trim(): + token = data[ATTR_TOKEN] + + msg.send(token)