Update Transmission docs with event ID info (#15905)

This commit is contained in:
Alec Rust 2021-01-25 15:06:00 +00:00 committed by GitHub
parent d7a7f01aaf
commit 23b8bb4a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ The Transmission integration will add the following sensors and switches.
## Event Automation ## Event Automation
The Transmission integration is continuously monitoring the status of torrents in the target client. Once a torrent is started or completed, an event is triggered on the Home Assistant Bus, which allows to implement any kind of automation. The Transmission integration is continuously monitoring the status of torrents in the target client. Once a torrent is started or completed, an event is triggered on the Home Assistant Bus containing the torrent name and ID, which can be used with automations.
Possible events are: Possible events are:
@ -89,20 +89,24 @@ Possible events are:
Inside of the event, there is the name of the torrent that is started or completed, as it is seen in the Transmission User Interface. Inside of the event, there is the name of the torrent that is started or completed, as it is seen in the Transmission User Interface.
Example of configuration of an automation with completed torrents: Example of an automation that notifies on successful download and removes the torrent from the client:
{% raw %} {% raw %}
```yaml ```yaml
- alias: Completed Torrent - alias: Notify and remove completed torrent
trigger: trigger:
platform: event platform: event
event_type: transmission_downloaded_torrent event_type: transmission_downloaded_torrent
action: action:
service: notify.telegram_notifier - service: notify.telegram_notifier
data: data:
title: "Torrent completed!" title: "Torrent completed!"
message: "{{trigger.event.data.name}}" message: "{{trigger.event.data.name}}"
- service: transmission.remove_torrent
data:
name: "Transmission"
id: "{{trigger.event.data.id}}"
``` ```
{% endraw %} {% endraw %}