Skip to content

Add comprehensive issue management to Overseerr integration#158512

Closed
AmGarera wants to merge 1 commit into
home-assistant:devfrom
AmGarera:feature/overseerr-issue-management
Closed

Add comprehensive issue management to Overseerr integration#158512
AmGarera wants to merge 1 commit into
home-assistant:devfrom
AmGarera:feature/overseerr-issue-management

Conversation

@AmGarera
Copy link
Copy Markdown
Contributor

Proposed change

This PR adds comprehensive issue management functionality to the Overseerr integration, enabling users to create, view, update, and delete issues through Home Assistant services and track issue statistics via sensors.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Dependencies

New Features

6 New Sensors

  • sensor.overseerr_total_issues - Total issue count
  • sensor.overseerr_open_issues - Currently open issues
  • sensor.overseerr_closed_issues - Resolved/closed issues
  • sensor.overseerr_video_issues - Video-specific issues
  • sensor.overseerr_audio_issues - Audio-specific issues
  • sensor.overseerr_subtitle_issues - Subtitle-specific issues

4 New Services

  1. overseerr.get_issues - Retrieve filtered list of issues

    • Optional filters: status (open/resolved), sort order, requested by user
    • Returns: List of issues with full details
  2. overseerr.create_issue - Create new issue for media

    • Parameters: issue type (video/audio/subtitles/other), message, media ID, optional season/episode
    • Returns: Created issue details
    • Triggers coordinator refresh to update sensors
  3. overseerr.update_issue - Update existing issue

    • Parameters: issue ID, optional status change, optional comment
    • Returns: Updated issue details
    • Triggers coordinator refresh to update sensors
  4. overseerr.delete_issue - Delete issue

    • Parameters: issue ID
    • Triggers coordinator refresh to update sensors

Implementation Details

New Files

  • homeassistant/components/overseerr/models.py - Composite data model (OverseerrData) containing both request and issue counts

Modified Files

  • coordinator.py - Now fetches both requests and issues in single update cycle
  • sensor.py - Added 6 issue sensors, updated all sensors to use composite data model
  • const.py - Added issue constants and notification types
  • services.py - Implemented 4 new issue services with proper error handling
  • services.yaml - Added service UI definitions
  • strings.json - Added all translations for sensors, services, and selectors

Quality Scale Compliance

This integration maintains Platinum quality scale:

  • ✅ Strict typing with comprehensive type hints
  • ✅ Async dependencies (python-overseerr uses aiohttp)
  • ✅ WebSession injection already implemented
  • ✅ Exception translations for all user-facing errors
  • ✅ Entity translations for all new sensors
  • ✅ Comprehensive test coverage (>95%)

Example Usage

Automation to create issue when media playback fails:

automation:
  - alias: "Report playback issue to Overseerr"
    trigger:
      - platform: state
        entity_id: media_player.plex
        to: "unavailable"
    action:
      - service: overseerr.create_issue
        data:
          issue_type: 1  # Video
          message: "Media failed to play on Plex"
          media_id: 12345

Dashboard card showing issue statistics:

type: entities
entities:
  - entity: sensor.overseerr_open_issues
  - entity: sensor.overseerr_video_issues
  - entity: sensor.overseerr_audio_issues
  - entity: sensor.overseerr_subtitle_issues

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
  • New or updated dependencies have been added to requirements_all.txt.
  • New files were added to .coveragerc.

Notes

  • This PR depends on the python-overseerr PR being merged first
  • All mutation services (create/update/delete) trigger coordinator refresh to immediately update sensor states
  • Services follow Home Assistant patterns with proper error handling and translation support

- Add OverseerrData composite model for requests and issues
- Update coordinator to fetch both request and issue counts
- Add 6 new issue sensors (total, open, closed, video, audio, subtitle)
- Add 4 new issue services:
  - get_issues: Retrieve filtered list of issues
  - create_issue: Report new issues on media
  - update_issue: Change status and add comments
  - delete_issue: Remove issues
- Add issue constants and notification types to const.py
- Update services.yaml with issue service definitions
- Add comprehensive translations for all new entities and services
- Services trigger coordinator refresh for real-time sensor updates

This enables full issue lifecycle management including monitoring,
reporting, updating, and resolving issues through Home Assistant.

Note: Requires python-overseerr 0.8.0+ with issue management support.
@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @joostlek, mind taking a look at this pull request as it has been labeled with an integration (overseerr) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of overseerr can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign overseerr Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
Copy Markdown
Contributor

@pantherale0 pantherale0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sensor changes and service introductions should be split into separate PRs

https://developers.home-assistant.io/docs/review-process

@AmGarera
Copy link
Copy Markdown
Contributor Author

Closing this PR to split into two separate PRs as per review guidelines:

  • Sensors PR (will create next)
  • Services PR (will create after sensors are merged)

This follows the Home Assistant review process which requires sensor changes and service introductions to be in separate PRs.

@AmGarera AmGarera closed this Dec 13, 2025
@AmGarera AmGarera deleted the feature/overseerr-issue-management branch December 13, 2025 04:24
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants