Sonarr
The Sonarr integration pulls data from a given Sonarr instance.
此集成可通过 UI 配置。前往 设置 > 设备与服务 添加。
Sensors
The Sonarr integration will add the following sensors:
- Upcoming: The number of upcoming episodes.
- Commands: The number of commands being run. (disabled by default)
- Disk space: Available disk space in gigabytes. (disabled by default)
- Queue: The number of episodes in the download queue. (disabled by default)
- Shows: The number of series in Sonarr. (disabled by default)
- Wanted: The number of episodes still wanted. (disabled by default)
The sensors provide summary counts. For detailed information about each item, such as series details or download progress, use the corresponding actions described below.
Actions
Action: Get series
The sonarr.get_series action retrieves the list of all series in your Sonarr library with their details and statistics.
- Data attribute:
entry_id- Description: The config entry ID to use.
- Optional: No
Response data
The response contains a shows key with a dictionary of series keyed by series title.
- id: Internal Sonarr series ID
- year: Series premiere year
- tvdb_id: TheTVDB ID
- imdb_id: IMDb ID
- status: Series status, such as
continuingorended - monitored: Whether the series is monitored
- episode_file_count: Number of episode files downloaded
- episode_count: Total number of episodes
- episodes_info: Formatted string showing downloaded/total episodes
- images: Dictionary of image URLs by type, including poster, banner, fanart, and clearlogo
Example
Action: Get episodes
The sonarr.get_episodes action retrieves all episodes for a specific series. Useful for displaying episode details, tracking watched status, or building episode lists.
- entry_id (required): The config entry ID to use.
- series_id (required): Internal Sonarr series ID from
sonarr.get_series. - season_number (optional): Filter to a specific season.
Response data
The response contains an episodes key with a dictionary of episodes keyed by episode identifier (for example, S01E01).
- id: Internal episode ID
- series_id: Internal Sonarr series ID
- tvdb_id: Episode TheTVDB ID
- season_number: Season number
- episode_number: Episode number
- episode_identifier: Formatted identifier like
S01E01 - title: Episode title
- air_date: Air date in local time
- air_date_utc: Air date in UTC
- overview: Episode overview or description if available
- has_file: Whether the episode file exists
- monitored: Whether the episode is monitored
- runtime: Episode runtime in minutes
- episode_file_id: ID of the episode file, or 0 if no file exists
- finale_type: Finale type if applicable, such as
seriesorseason
Example
Action: Get queue
The sonarr.get_queue action retrieves all episodes currently in the download queue with their progress and details.
- entry_id (required): The config entry ID to use.
- max_items (optional): Maximum number of queue items to return. Use 0 for no limit, maximum is 500, default is 0.
Response data
The response contains a shows key with a dictionary of queue items keyed by download title.
- 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 like
S01E01 - progress: Download progress percentage
- size: Total download size in bytes
- size_left: Remaining download size in bytes
- status: Download status, such as
downloadingorpaused - tracked_download_status: Tracked download status, such as
okorwarning - tracked_download_state: Tracked download state like
downloading - quality: Quality profile name, such as
Bluray-1080p - languages: List of language names
- download_client: Download client name
- download_id: Download client's ID for this download
- indexer: Indexer name
- protocol: Download protocol like
ProtocolType.TORRENTorProtocolType.USENET - episode_has_file: Whether the episode already has a file
- estimated_completion_time: Estimated completion timestamp, or
None - time_left: Time remaining, or
None - images: Dictionary of series image URLs by type including poster, banner, fanart, and clearlogo
Example
Action: Get disk space
The sonarr.get_diskspace action retrieves the disk space information for all storage locations configured in Sonarr.
- entry_id (required): The config entry ID to use.
- space_unit (optional): Unit for disk space values, such as KB, KiB, GB, GiB, PB, and PiB. Default is bytes.
Response data
The response contains a disks key with a dictionary of disk information keyed by path.
- path: The storage path
- label: The disk label if available
- free_space: Free space in the selected unit
- total_space: Total space in the selected unit
- unit: The unit being used for the space values
- usage_percent: Percentage of disk space used
Example
Action: Get upcoming
The sonarr.get_upcoming action retrieves upcoming episodes from the calendar. Episodes are returned if their air date falls between today and today plus the specified number of days.
- entry_id (required): The config entry ID to use.
- days (optional): Number of days to look ahead for upcoming episodes. Valid range is 1-30, default is 1.
Response data
The response contains an episodes key with a dictionary of upcoming episodes keyed by series title and episode identifier (for example, Breaking Bad S01E01).
- id: Internal episode ID
- series_id: Internal Sonarr series ID
- season_number: Season number
- episode_number: Episode number
- episode_identifier: Formatted identifier like
S01E01 - title: Episode title
- air_date: Air date in local time
- air_date_utc: Air date in UTC
- overview: Episode overview or description
- has_file: Whether the episode file exists
- monitored: Whether the episode is monitored
- runtime: Episode runtime in minutes
- finale_type: Finale type if applicable, such as
seriesorseason - series_title: Series title
- series_year: Series premiere year
- series_tvdb_id: Series TheTVDB ID
- series_imdb_id: Series IMDb ID
- series_status: Series status
- network: Network the series airs on
- images: Dictionary of series image URLs by type including poster, banner, fanart, and clearlogo
Example
Action: Get wanted
The sonarr.get_wanted action retrieves wanted (missing) episodes that Sonarr is searching for.
- entry_id (required): The config entry ID to use.
- max_items (optional): Maximum number of wanted episodes to return. 0 = no limit, max: 500, default: 0.
Response data
The response contains an episodes key with a dictionary of wanted episodes keyed by series title and episode identifier (for example, Westworld S00E62).
- id: Internal episode ID
- series_id: Internal Sonarr series ID
- season_number: Season number
- episode_number: Episode number
- episode_identifier: Formatted identifier like
S01E01 - title: Episode title
- air_date: Air date in local time
- air_date_utc: Air date in UTC
- overview: Episode overview or description
- has_file: Whether the episode file exists
- monitored: Whether the episode is monitored
- runtime: Episode runtime in minutes
- tvdb_id: Episode TheTVDB ID
- series_title: Series title
- series_year: Series premiere year
- series_tvdb_id: Series TheTVDB ID
- series_imdb_id: Series IMDb ID
- series_status: Series status
- network: Network the series airs on
- images: Dictionary of series image URLs by type including poster, banner, fanart, and clearlogo

