{"id":13588511,"url":"https://github.com/moeiscool/homebridge-shinobi","last_synced_at":"2025-04-30T22:26:19.759Z","repository":{"id":35177596,"uuid":"213086072","full_name":"moeiscool/homebridge-shinobi","owner":"moeiscool","description":"A Homebridge plugin integrating Shinobi for motion detector cameras","archived":false,"fork":false,"pushed_at":"2024-12-06T16:19:06.000Z","size":725,"stargazers_count":11,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T19:58:49.651Z","etag":null,"topics":["homebridge","homebridge-plugin","homebridge-shinobi","shinobi-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/moeiscool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["moeiscool"]}},"created_at":"2019-10-05T23:46:55.000Z","updated_at":"2024-11-27T19:48:52.000Z","dependencies_parsed_at":"2024-09-06T09:33:36.778Z","dependency_job_id":"beb08f55-8cb7-4f02-8236-69d19ad9939e","html_url":"https://github.com/moeiscool/homebridge-shinobi","commit_stats":{"total_commits":72,"total_committers":4,"mean_commits":18.0,"dds":"0.41666666666666663","last_synced_commit":"47b75af042806d3b5753aa98e7db10af0a31bfdf"},"previous_names":["moeiscool/homebridge-shinobi","vectronic/homebridge-shinobi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeiscool%2Fhomebridge-shinobi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeiscool%2Fhomebridge-shinobi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeiscool%2Fhomebridge-shinobi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeiscool%2Fhomebridge-shinobi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moeiscool","download_url":"https://codeload.github.com/moeiscool/homebridge-shinobi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251790784,"owners_count":21644288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["homebridge","homebridge-plugin","homebridge-shinobi","shinobi-api"],"created_at":"2024-08-01T15:06:45.734Z","updated_at":"2025-04-30T22:26:19.740Z","avatar_url":"https://github.com/moeiscool.png","language":"TypeScript","funding_links":["https://github.com/sponsors/moeiscool"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003e ⚠️ Recently this repository was transferred to Shinobi Systems (moeiscool). We do not have complete understanding of its operation and welcome anyone to join us in maintaining it. Please send us any Pull Requests and we will present it to the community for additional review. If the overall consensus is positive (with test results) we will merge those changes.\n\u003e Join our Discord to discuss with the community! https://shinobi.community/\n\u003e\n\u003e Latest npmjs module is at https://www.npmjs.com/package/homebridge-shinobi-official\n\nThis document was revised by Shamim Shihab Akhtar, Developer at Shinobi Systems\n\nOld README can be found here https://github.com/moeiscool/homebridge-shinobi/blob/master/README.old.md\n\n# Homebridge-Shinobi Plugin Documentation\n\n## Overview\nHomebridge-Shinobi is a plugin designed to integrate Shinobi security cameras with HomeKit-compatible systems through Homebridge. Homebridge itself is a lightweight Node.js-based server that allows non-HomeKit devices to be compatible with Apple's Home app by emulating the HomeKit API.\n\nWith this plugin, users can seamlessly integrate their Shinobi cameras into the Apple HomeKit ecosystem. This enables them to view live camera feeds and receive motion detection alerts directly within the Apple Home app, enhancing the functionality of their security system within the HomeKit environment.\n\n## Features\n### 1. Fetching and Managing Cameras\n- The plugin communicates with the Shinobi API to fetch camera data and either registers new cameras or restores cached ones during Homebridge restarts.\n- The plugin sets up each camera accessory by fetching essential details like the manufacturer, model, and serial number. The camera name is set to the monitor ID, identifying the motion sensor in HomeKit.\n- Each camera is assigned a unique identifier (UUID) to track its registration status in HomeKit.\n\n### 2. Motion Detection\n- The plugin handles motion detection by adding a motion sensor service to the Shinobi camera.\n- Whenever motion is detected by a Shinobi camera, the plugin notifies HomeKit, allowing users to receive alerts.\n- The motion detection state is automatically reset after a brief delay to ensure timely updates without lingering detections.\n\n### 3. Video Streaming with FFmpeg\n- The plugin configures and manages real-time video streaming from Shinobi cameras to work seamlessly within HomeKit using FFmpeg.\n- The video feed is streamed with H.264 for video compression and encrypted using SRTP (Secure Real-Time Transport Protocol) to ensure secure transmission.\n- The resolution, frame rate, and bitrate are dynamically adjusted based on HomeKit’s requirements to ensure optimal performance.\n- FFmpeg is utilized to handle the real-time streaming of video from the Shinobi cameras, ensuring the video feed conforms to HomeKit's specifications.\n- When Homebridge shuts down, the plugin ensures that streams are properly stopped, providing a smooth and reliable shutdown process without interruptions.\n\n### 4. Snapshots\n- The plugin fetches snapshots from Shinobi cameras via the API and delivers them to HomeKit when requested.\n\n### 5. Stream Management\n- It processes streaming requests from HomeKit, spawning FFmpeg for starting streams, terminating processes to stop streams, and reconfiguring if needed.\n\n### 6. Substream Management\n- It activates or deactivates low-resolution substreams from Shinobi cameras if available, enabling efficient streaming.\n- Automatically toggles substream activation based on active streaming sessions.\n\n## Instructions to Set Up and Run Homebridge with the Shinobi Plugin\nTo install, configure, and run Homebridge with the Shinobi plugin, follow the steps below to integrate Shinobi cameras into Apple's HomeKit using Homebridge.\n\n### 1. Clone the Homebridge-Shinobi Plugin\nBegin by cloning the plugin's repository from GitHub. In the terminal, enter the following command:\n\u003e git clone https://github.com/moeiscool/homebridge-shinobi.git\n\n### 2. Install Plugin Dependencies\nNavigate into the plugin's directory and install the required dependencies using npm:\n\u003e npm install\n\n### 3. Ensure FFmpeg is Installed\nEnsure that `ffmpeg` is installed and accessible in the system's PATH. If it is not, install it using the method appropriate for the operating system.\n\u003e For macOS, install it via Homebrew with the command: `brew install ffmpeg`  \n\u003e For Windows, download and install `ffmpeg` from [ffmpeg.org](https://ffmpeg.org).\n\n### 4. Install Homebridge\nInstall Homebridge globally using npm:\n\u003e npm install -g homebridge\n\n### 5. Install the Homebridge-Shinobi Plugin\nInstall the Homebridge-Shinobi plugin globally using npm:\n\u003e npm install -g homebridge-shinobi-official\n\n### 6. Update the Configuration File\nUpdate the configuration file (`config.json`) with the correct settings for the Shinobi plugin. Below is an example configuration:\n\n```\n{\n  \"platforms\": [\n    {\n      \"platform\": \"Shinobi\",\n      \"shinobi_api\": \"http://your.shinobi.server\",\n      \"api_key\": \"your_api_key_here\",\n      \"group_key\": \"your_group_key_here\",\n      \"monitors\": [\n        {\n          \"monitor_id\": \"monitor_1_id\",\n          \"use_substream\": false\n        },\n        {\n          \"monitor_id\": \"monitor_2_id\",\n          \"use_substream\": true\n        },\n        {\n          \"monitor_id\": \"monitor_3_id\",\n          \"use_substream\": true\n        }\n      ],\n      \"web_hook_port\": \"your_webhook_port\",\n      \"https_key_path\": \"/path/to/https/key.pem\",\n      \"https_cert_path\": \"/path/to/https/cert.pem\",\n      \"ffmpeg_input_args\": \"-fflags +genpts\",\n      \"ffmpeg_process_args\": \"-vsync drop -vcodec copy -an\"\n    }\n  ]\n}\n\n```\n\n### 7. Link the Plugin for Local Development (Optional)\nTo link the plugin with Homebridge for local development and testing, use the following command:\n\u003e npm link\n\n### 8. Build the Plugin\nBuild the plugin from its TypeScript source files. This command compiles the code into JavaScript:\n\u003e npm run build\n\n### 9. Run Homebridge\nOnce everything is installed and built, start Homebridge:\n\u003e homebridge\n\n## Shinobi Camera and Apple HomeKit Integration Overview\nThis setup relies on several key components that facilitate communication between Shinobi cameras and Apple HomeKit devices. Shinobi-managed cameras provide live video streaming and snapshots to the Shinobi Server, which centrally manages these camera feeds.\n\nThe Homebridge server, with the Shinobi-Homebridge plugin, acts as a bridge between the Shinobi system and Apple's HomeKit ecosystem, enabling seamless integration.\n\n## Potential New Features for Future Development\n1. **Snapshot Capture on Motion Detection:** Automatically capture and deliver a snapshot to HomeKit whenever motion is detected.\n2. **Access to Recorded Video:** Integrate access to recorded videos stored in Shinobi’s system directly through the Home app.\n3. **Scheduling Motion Detection Notifications:** Allow scheduling of motion detection notifications for specific times.\n4. **Enhanced Shinobi Camera Status Information:** Retrieve and display more detailed camera status information in HomeKit.\n5. **Motion Detection History and Timeline:** Provide a history of motion detection events within the Home app.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoeiscool%2Fhomebridge-shinobi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoeiscool%2Fhomebridge-shinobi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoeiscool%2Fhomebridge-shinobi/lists"}