Transmission
The Transmission integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows you to monitor your Transmission
Prerequisites
Before setting up the Transmission integration, ensure you have:
- Transmission installed and running on your network.
- The IP address or hostname and port of your Transmission instance.
- The username and password of your Transmission instance, if set.
- Your Transmission client must first be configured to allow remote access. In your Transmission client navigate to Preferences -> Remote tab and then click the Allow remote access checkbox.
Configuration
To add the Transmission service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Transmission.
-
Follow the instructions on screen to complete the setup.
The IP address or hostname of your Transmission instance. For example: 192.168.1.100 or transmission.local.
Supported functionality
The Transmission integration will add the following sensors and switches.
Sensors
- The status of your Transmission daemon.
- The current download speed [MB/s].
- The current upload speed [MB/s].
- The current number of active torrents.
- The current number of paused torrents.
- The total number of torrents present in the client.
- The current number of started torrents (downloading).
- The current number of completed torrents (seeding).
Switches
- A switch to start/stop all torrents.
- A switch to enable turtle mode (a.k.a. alternative speed limits).
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 containing the torrent name, ID, and labels, which can be used with automations.
Possible events are:
transmission_downloaded_torrenttransmission_started_torrenttransmission_removed_torrent
Inside the event, there is the name of the torrent that is started or completed and the path where the files are downloaded, as seen in the Transmission User Interface.
Example of an automation that notifies on successful download and removes the torrent from the client if the torrent has a label of Remove:
alias: Transmission download complete
description: "Notify on download complete and remove if label set"
triggers:
- trigger: event
event_type: transmission_downloaded_torrent
actions:
- action: notify.persistent_notification
metadata: {}
data:
message: >-
{{trigger.event.data.name}} downloaded to
{{trigger.event.data.download_path}} with labels
{{trigger.event.data.labels}}
- if:
- condition: template
value_template: "{{ 'Remove' in trigger.event.data.labels }}"
then:
- action: transmission.remove_torrent
data:
delete_data: false
entry_id: YOUR_TRANSMISSION_ENTRY_ID
id: "{{trigger.event.data.id}}"
Actions
All Transmission actions require integration entry_id. To find it, go to Developer tools > Actions. Choose the desired action and select your integration from dropdown. Then switch to YAML mode to see entry_id.
Action: Add torrent
The transmission.add_torrent action is used to add a new torrent to download.
-
Data attribute:
entry_id- Description: The ID of the Transmission config entry.
- Optional: No
-
Data attribute:
torrent- Description: The torrent to download. It can either be a URL (HTTP, HTTPS or FTP), magnet link or a local file (make sure that the path is white listed).
- Optional: No
-
Data attribute:
download_path- Description: The absolute path to the download directory. If not specified, the Transmission’s default directory will be used.
- Optional: Yes
-
Data attribute:
labels- Description: A comma-separated list of labels to assign to the torrent.
- Optional: Yes
Action: Remove torrent
The transmission.remove_torrent action is used to remove a torrent from the client.
-
Data attribute:
entry_id- Description: The ID of the Transmission config entry.
- Optional: No
-
Data attribute:
id-
Description: The ID of the torrent, can be found in the
torrent_infoattribute of the*_torrentssensors. - Optional: No
-
Description: The ID of the torrent, can be found in the
-
Data attribute:
delete_data- Description: Delete torrent data (Default: false).
- Optional: Yes
Action: Start torrent
The transmission.start_torrent action is used to start a torrent downloading or seeding within the client.
-
Data attribute:
entry_id- Description: The ID of the Transmission config entry.
- Optional: No
-
Data attribute:
id-
Description: The ID of the torrent, can be found in the
torrent_infoattribute of the*_torrentssensors. - Optional: No
-
Description: The ID of the torrent, can be found in the
Action: Stop torrent
The transmission.stop_torrent action is used to stop a torrent downloading or seeding within the client.
-
Data attribute:
entry_id- Description: The ID of the Transmission config entry.
- Optional: No
-
Data attribute:
id-
Description: The ID of the torrent, can be found in the
torrent_infoattribute of the*_torrentssensors. - Optional: No
-
Description: The ID of the torrent, can be found in the
Action: Get torrents
This transmission.get_torrents action populates Response Data with a dictionary of torrents based on the provided filter.
-
Data attribute:
entry_id- Description: The ID of the Transmission config entry.
- Optional: No
-
Data attribute:
torrent_filter- Description: The type of torrents you want in the response (all, active, started, paused, or completed).
- Optional: No
action: transmission.get_torrents
data:
entry_id: YOUR_TRANSMISSION_ENTRY_ID
torrent_filter: "all"
response_variable: torrents
Templating
Attribute torrent_info
All *_torrents sensors e.g. sensor.transmission_total_torrents or sensor.transmission_started_torrents have a state attribute torrent_info that contains information about the torrents that are currently in a corresponding state. You can see this information in Developer Tools -> States -> sensor.transmission_total_torrents -> Attributes, or by adding a Markdown card to a dashboard with the following code:
content: >
{% set payload = state_attr('sensor.transmission_total_torrents', 'torrent_info') %}
{% for torrent in payload.items() %} {% set name = torrent[0] %} {% set data = torrent[1] %}
{{ name|truncate(20) }} is {{ data.percent_done }}% complete, with {{ data.ratio }} ratio, {{ data.eta }} remaining {% endfor %}
type: markdown
Removing the integration
This integration follows standard integration removal. After removal, your Transmission instance continues running with its current configuration.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots
menu. Then, select Delete.