Repository navigation
IP Camera
iOS 10 added support for IP Camera to HomeKit. HAP-NodeJS updated to support IP Camera with v0.4.0.
To use IP Camera with HAP-NodeJS, you will need construct a camera object and invoke Accessory. configureCameraSource(camera) to inform HAP-NodeJS the accessory supports IP Camera. You can use Camera.js as the reference and modify from there.
Please notice that due to protocol limitation, it's not possible to expose multiple cameras via a single HAP Endpoint. Aka trying to add a camera to a bridged accessory may result unexpected behavior.
A camera object in HAP-NodeJS must implements the following:
- services
Array of
Service
iOS expects a
CameraControlservice and aCameraRTPStreamManagementservice. The accessory can provide multipleCameraRTPStreamManagementservices to iOS. To simplify the stream parameter negotiation, HAP-NodeJS provides a helper classStreamControllerwhich handles the stream request from iOS device.
The number of
CameraRTPStreamManagementservices determines the number of concurrent streams the accessory can support. Apple recommends accessory to support at least two concurrent streams.
- handleSnapshotRequest(request, callback(error, snapshot))
This method will be invoked when iOS device requests snapshot from the accessory. The
requestcontainswidthandheightof the requested snapshot. Thecallbackis a function that expectserrororsnapshotimage buffer.
iOS expects the snapshot to be under JPEG format. Please try to honor the requested
widthandheightand not send a huge snapshot back to callback. HomeKit on iOS may crash when it receives a huge snapshot.
- prepareStream(request, callback(response))
This method will be invoked when iOS device tries to start video stream. The
requestcontains information likesessionID,targetAddressand other informations that will be used to setup RTP/RTCP stream. Thecallbackexpects a response which contains information supplied by accessory to setup RTP/RTCP stream. For more information about request and response, please refer to section Prepare Stream.
- handleStreamRequest(request)
This method will be invoked when iOS device requests accessory to start, stop or reconfigure the RTP stream. The request will contain basic information like
sessionIDalong with other parameters that will be helpful for streaming. For more information about handling stream request, please refer to section Handle Stream Request.
- Raspberry Pi
- Debian, Ubuntu
- CentOS, Fedora, Red Hat
- Arch, Manjaro
- Docker
- Virtual Machine (Windows & macOS)
- Windows
- macOS
- Synology DSM 7
- Other Platforms
- Basic Troubleshooting
- Backup and Restore
- Child Bridges
- Config File
- Connect To HomeKit
- FFmpeg for Homebridge
- HomeKit Glossary of Terms
- iOS Apps
- mDNS Options
- Remote Access
- Useful Links
- Basic Troubleshooting
- Config Options
- Enabling Accessory Control
- Enabling UI with Docker
- Homebridge Service Command
- Manual Configuration
- Reverse Proxy: Apache
- Reverse Proxy: Nginx and SSL
- Manage Homebridge Version
- Manage Homebridge UI Version
- Manage Plugin Version
- Manage Node Version
- Updating To Homebridge v2
Raspberry Pi Image
- Pi Image Home
- Getting Started
- Supported Raspberry Pi Models
- Find the IP Address
- Connect Via SSH
- Connect Via VNC (old)
- Set the Date and Time
- SSL / HTTPS Access
- Disable the WiFi Setup Portal
- Reset WiFi
- Upgrade to the Latest Image
- Update Homebridge and Node.js
- Enable Debug or Insecure Mode
- Install Pi-hole
- Install AdGuard Home
- Install deCONZ (ConBee / RaspBee)
- Migrate From HOOBS
- Fix Eero Router Connectivity
Docker
Synology Package
HAP-NodeJS
- Developer Docs
- API Reference
- Plugin Templates
- Other Links (Internal)
- Other Links (External)