From 417724042c9e63a672d614481b35523557dd2874 Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Wed, 16 Oct 2019 19:33:55 -0700 Subject: [PATCH 1/3] Add nzbget downloaded event. --- source/_integrations/nzbget.markdown | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/source/_integrations/nzbget.markdown b/source/_integrations/nzbget.markdown index d39e65307962..17efbb3a646c 100644 --- a/source/_integrations/nzbget.markdown +++ b/source/_integrations/nzbget.markdown @@ -66,6 +66,32 @@ This component will create these sensors: - `nzbget_uptime`: NZBGet server uptime. - `nzbget_size`: Amount of data downloaded since server start in MB. +## Event Automation + +The NZBGet integration continuously monitors nzbget's download history. When a download completes, an event usable for automation is triggered on the Home Assistant Bus. + +Possible events are: + +- `nzbget_downloaded_nzb` + +The event includes the name, category, and status of the downloaded nzb. + +Example automation to send a Telegram message on a completed download: + +```yaml +- alias: Completed Torrent + trigger: + platform: event + event_type: nzbget_downloaded_nzb + - event_data: + category: tv + action: + service: notify.telegram_notifier + data_template: + title: "Download completed!" + message: "{% raw %}{{trigger.event.data.name}}{% endraw %}" +``` + ## Services Available services: @@ -76,6 +102,6 @@ Available services: ### Service `nzbget/set_speed` -| Service data attribute | Optional | Description | +| Service data attribute | Optional | Description | |------------------------|----------|-------------------------------------------------------------------------------------------------| | `speed` | yes | Sets the download speed limit, specified in Kb/s. 0 disables the speed limit. Defaults to 1000. | From 1315a302159508c0f134f4a6cd32c12c381f3752 Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Wed, 16 Oct 2019 19:39:28 -0700 Subject: [PATCH 2/3] Move raw tags outside the code block --- source/_integrations/nzbget.markdown | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/_integrations/nzbget.markdown b/source/_integrations/nzbget.markdown index 17efbb3a646c..67598b51ffe0 100644 --- a/source/_integrations/nzbget.markdown +++ b/source/_integrations/nzbget.markdown @@ -77,6 +77,7 @@ Possible events are: The event includes the name, category, and status of the downloaded nzb. Example automation to send a Telegram message on a completed download: +{% raw %} ```yaml - alias: Completed Torrent @@ -89,9 +90,11 @@ Example automation to send a Telegram message on a completed download: service: notify.telegram_notifier data_template: title: "Download completed!" - message: "{% raw %}{{trigger.event.data.name}}{% endraw %}" + message: "{{trigger.event.data.name}}" ``` +{% endraw %} + ## Services Available services: From ae5dcba0a6eeaf6051d1f960d5c3c052faf0b581 Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Fri, 18 Oct 2019 21:11:51 -0700 Subject: [PATCH 3/3] Match event name to code --- source/_integrations/nzbget.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_integrations/nzbget.markdown b/source/_integrations/nzbget.markdown index 67598b51ffe0..e003bd4cef9a 100644 --- a/source/_integrations/nzbget.markdown +++ b/source/_integrations/nzbget.markdown @@ -72,7 +72,7 @@ The NZBGet integration continuously monitors nzbget's download history. When a d Possible events are: -- `nzbget_downloaded_nzb` +- `nzbget_download_complete` The event includes the name, category, and status of the downloaded nzb. @@ -83,7 +83,7 @@ Example automation to send a Telegram message on a completed download: - alias: Completed Torrent trigger: platform: event - event_type: nzbget_downloaded_nzb + event_type: nzbget_download_complete - event_data: category: tv action: