{"id":48026928,"url":"https://github.com/devinslick/home-assistant-sonicbit","last_synced_at":"2026-04-04T13:51:36.484Z","repository":{"id":341082557,"uuid":"1168782287","full_name":"devinslick/home-assistant-sonicbit","owner":"devinslick","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-07T22:07:02.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-08T03:51:42.239Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devinslick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-27T19:43:12.000Z","updated_at":"2026-03-07T22:07:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devinslick/home-assistant-sonicbit","commit_stats":null,"previous_names":["devinslick/home-assistant-sonicbit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devinslick/home-assistant-sonicbit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinslick%2Fhome-assistant-sonicbit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinslick%2Fhome-assistant-sonicbit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinslick%2Fhome-assistant-sonicbit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinslick%2Fhome-assistant-sonicbit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devinslick","download_url":"https://codeload.github.com/devinslick/home-assistant-sonicbit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinslick%2Fhome-assistant-sonicbit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T13:51:35.968Z","updated_at":"2026-04-04T13:51:36.479Z","avatar_url":"https://github.com/devinslick.png","language":"Python","readme":"# SonicBit Media Sync\n\n[![hacs_badge](https://img.shields.io/badge/HACS-Custom-orange.svg)](https://github.com/hacs/integration)\n[![GitHub Release](https://img.shields.io/github/release/devinslick/home-assistant-sonicbit.svg)](https://github.com/devinslick/home-assistant-sonicbit/releases)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nA [Home Assistant](https://www.home-assistant.io/) custom integration that automatically syncs completed torrents from your [SonicBit](https://sonicb.it/) seedbox to local storage, then removes the cloud copy once the transfer is verified.\n\n## Features\n\n- **Automatic polling** — checks SonicBit every 60 seconds for completed torrents\n- **Streaming downloads** — files are streamed in 8 MB chunks so multi-gigabyte transfers never spike HA's RAM\n- **Atomic writes** — files land as `.tmp` and are renamed to their final name only after a size check passes, so DLNA/media scanners never index a partial file\n- **Safe deletion** — the cloud copy is only deleted after every file in a torrent transfers successfully; failed downloads are retried on the next poll\n- **Auto-delete toggle** — a switch entity lets you enable or disable seedbox cleanup without reconfiguring the integration\n- **Four entities** — a storage sensor, a status sensor, a force-sync button, and an auto-delete switch\n\n## Entities\n\n| Entity | Type | Default | Description |\n|---|---|---|---|\n| `sensor.sonicbit_storage` | Sensor | — | Cloud storage used (%) |\n| `sensor.sonicbit_status` | Sensor | — | `Idle`, `Downloading`, or `Error` |\n| `button.sonicbit_force_sync` | Button | — | Trigger an immediate sync |\n| `switch.sonicbit_auto_delete` | Switch | On | Delete the seedbox copy after a successful download |\n\n### Auto-Delete Switch\n\nWhen **on** (default), the integration deletes each torrent and its cloud files from SonicBit immediately after all local files are verified. When **off**, files are still downloaded to local storage but the seedbox copy is left untouched.\n\nTurning the switch back **on** will cause any already-downloaded-but-not-yet-deleted torrents to be cleaned up on the next poll (within 60 seconds) — no manual action required.\n\nThe switch state is persisted across Home Assistant restarts.\n\n## Requirements\n\n- Home Assistant 2024.1 or newer\n- A [SonicBit](https://sonicb.it/) account\n- The `/media` folder (or your chosen path) must be writable by the Home Assistant process\n\n## Installation\n\n### Via HACS (recommended)\n\n1. In Home Assistant, open **HACS → Integrations**.\n2. Click the three-dot menu in the top-right corner and select **Custom repositories**.\n3. Add `https://github.com/devinslick/home-assistant-sonicbit` with category **Integration**.\n4. Search for **SonicBit Media Sync** and click **Download**.\n5. Restart Home Assistant.\n\n### Manual\n\n1. Download the [latest release](https://github.com/devinslick/home-assistant-sonicbit/releases/latest).\n2. Copy the `custom_components/sonicbit_sync` folder into your HA `config/custom_components/` directory.\n3. Restart Home Assistant.\n\n## Configuration\n\n1. Go to **Settings → Devices \u0026 Services → Add Integration**.\n2. Search for **SonicBit Media Sync**.\n3. Enter your SonicBit **email**, **password**, and the **local storage path** where downloaded files should be saved (default: `/media/sonicbit`).\n\nHA will verify your credentials before saving the entry. Once set up, the integration begins polling immediately.\n\n## How It Works\n\n```\nPoll (every 60 s)\n  └─ list_torrents()\n       └─ filter progress == 100\n            └─ for each completed torrent:\n                 get_torrent_details(hash)   ← fetch per-file download URLs\n                 for each file:\n                   stream to \u003cpath\u003e/\u003ctorrent\u003e/\u003cfile\u003e.tmp\n                   verify size\n                   rename .tmp → final name\n                 if ALL files OK:\n                   delete_torrent(hash, with_file=True)\n```\n\n## Storage Path Notes\n\nOn **Home Assistant OS** the `/media` folder is the standard location for user media and is accessible to the DLNA/media server. The default path `/media/sonicbit` maps to `/media/sonicbit` on the host.\n\nIf you run HA in **Docker** or **supervised**, ensure the path you configure is bind-mounted into the container.\n\n## Troubleshooting\n\n| Symptom | Fix |\n|---|---|\n| Status sensor stuck on `Error` | Check **Settings → System → Logs** for `sonicbit_sync` entries |\n| Files not appearing | Confirm the storage path exists and is writable: `ls -la /media/sonicbit` |\n| Credentials rejected | Re-authenticate via the integration's **Configure** button in Devices \u0026 Services |\n| Partial `.tmp` files | A previous download was interrupted; they will be cleaned up on the next successful run |\n| Cloud copy not deleted | Check that `switch.sonicbit_auto_delete` is **on**; also check logs for deletion errors |\n\n## Contributing\n\nPull requests and issues are welcome at [github.com/devinslick/home-assistant-sonicbit](https://github.com/devinslick/home-assistant-sonicbit/issues).\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n## Acknowledgements\n\nBuilt on the [sonicbit-python-sdk](https://github.com/viperadnan-git/sonicbit-python-sdk) by [@viperadnan-git](https://github.com/viperadnan-git).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinslick%2Fhome-assistant-sonicbit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevinslick%2Fhome-assistant-sonicbit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinslick%2Fhome-assistant-sonicbit/lists"}