Repository navigation
Deprecation of Core and BridgeCore
As of releases before 0.7.0 users were advised to download the HAP-NodeJS repository and startup HAP-NodeJS
using Core.ts and BridgeCore.ts to load accessories located in the accessories folder.
This way of using HAP-NodeJS was deprecated with the release of 0.7.0, and it was removed in v1.0.0 (July 2024).
AccessoryLoader, which turned object literal accessories into real ones, was removed in v1.0.0 too.
The following reasons lead to the decision to deprecate this style of creating accessories:
- It is and was always difficult for users to update to the latest version of
HAP-NodeJS. In certain circumstances merge conflicts could appear making an update even more difficult. - It brought some inflexibility. For example, it is not really possible to delay publishing of the accessory, which is important for some applications where devices need to be discovered on the network first.
- It is hard to share and maintain your custom accessories. For example publishing those to GitHub or releasing them would always require the whole library to be published.
- There is the potential, that users are running an unstable version of
HAP-NodeJSas the default branch may not always be stable and include changes not yet released. - With the latest migration to Typescript it got less straight forward for users to set up and start their accessories.
As a result we strongly encourage users to write their plugins using HAP-NodeJS as a library.
There is a guide to get you started: Beginners guide for using HAP-NodeJS as a library.
First of all, you may have a look at the already mentioned Beginners guide for using HAP-NodeJS as a library.
But in short:
- You will need to set up a new node project. You can choose to write your plugin in JavaScript or Typescript.
- You will need to add
"@homebridge/hap-nodejs"to your list ofdependenciesin yourpackage.json. The easiest way is to runnpm install @homebridge/hap-nodejsin your project folder. - You may need to move your
persistfolder into the new location where your project will be running in order to keep up the pairing between your accessories and your home. - Move your code over to the new project. You can basically keep the code pretty much the same if you are using
standalone accessories (You have to write your own Bridge if you were using the
BridgeCore). You will need to adjust the imports at the top and add aaccessory.publishcall at the bottom.
If you used object literal notation (a plain object describing the accessory), you will need to rewrite it usingnew Accessory(...)andServiceobjects, as shown in the guide, becauseAccessoryLoaderno longer exists.
For further guidance you can refer to the HAP-NodeJS Examples
repository. Please note that it still uses a very old version (hap-nodejs v0.6).
- 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)