Get queue
Use this action to retrieve all episodes currently in the download queue, together with their progress and details.
This action returns its result in a response variable, which you can use in later steps of the same automation or script, for example to notify yourself when a download is still in progress.
Using this action from the user interface
If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.
To get the download queue from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- If you’re setting up a new automation, add a trigger in the When section. Scripts don’t need a trigger. They run when something else calls them.
- In the Then do section, select Add action.
- From the search box, search for and select Sonarr: Get queue.
- Select the Sonarr entry to query and optionally set Max items.
- In the Response variable field, enter a name to store the data in, such as
queue_data. - Select Save.
This action does not support targets. In the UI, you are not prompted to choose an area, device, entity, or label.
Options in the UI
Using this action in YAML
If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.
In YAML, refer to this action as sonarr.get_queue. Store the result in a response variable so you can use it in later steps:
action: sonarr.get_queue
data:
entry_id: "01234567890abcdef1234567890abcde"
max_items: 50
response_variable: queue_data
This fetches up to 50 items from the download queue.
Options in YAML
Response data
The response contains a shows key with a mapping of queue items keyed by download title. Each queue item includes the following fields:
-
id: Internal queue item ID. -
series_id: Internal Sonarr series ID. -
episode_id: Internal episode ID. -
title: Series title. -
download_title: Download release name. -
season_number: Season number. -
episode_number: Episode number. -
episode_title: Episode title. -
episode_identifier: Formatted identifier, such asS01E01. -
progress: Download progress percentage. -
size: Total download size in bytes. -
size_left: Remaining download size in bytes. -
status: Download status, such asdownloadingorpaused. -
tracked_download_status: Tracked download status, such asokorwarning. -
tracked_download_state: Tracked download state, such asdownloading. -
quality: Quality profile name, such asBluray-1080p. -
languages: List of language names. -
download_client: Download client name. -
download_id: The download client’s ID for this download. -
indexer: Indexer name. -
protocol: Download protocol, such asProtocolType.TORRENTorProtocolType.USENET. -
episode_has_file: Whether the episode already has a file. -
estimated_completion_time: Estimated completion timestamp, or empty if unknown. -
time_left: Time remaining, or empty if unknown. -
images: Mapping of series image URLs by type, including poster, banner, fanart, and clearlogo.
A shortened example of the response looks like this:
shows:
"Homeland.S02.Bluray.EAC3.5.1.1080p.x265-iVy":
id: 785716933
series_id: 65
episode_id: 2497
title: "Homeland"
download_title: "Homeland.S02.Bluray.EAC3.5.1.1080p.x265-iVy"
season_number: 2
episode_number: 12
episode_title: "The Choice"
episode_identifier: "S02E12"
progress: "3.80%"
size: 13525611258
size_left: 13011284730
status: "paused"
quality: "Bluray-1080p"
languages:
- "English"
download_client: "qBittorrent"
protocol: "ProtocolType.TORRENT"
episode_has_file: false
Try it yourself
Ready to test this? Open Developer tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.
Still stuck?
The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.
Related actions
These actions work well alongside this one:
-
Get series: Retrieves all series in your Sonarr library with their details and statistics.
-
Get wanted: Retrieves wanted (missing) episodes that Sonarr is searching for.