-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Updating To Homebridge v2.0
To write...
-
What would happen if I update to Homebridge v2 and run a plugin that needs updating?
- If you run the plugin in a child bridge, Homebridge will still load correctly. The plugin's child bridge process would likely continually restart as the error is created each time the plugin tries to load.
- If you are not running the plugin in a child bridge, then the Homebridge process will likely continually crash and restart.
- Note that in either case, the Homebridge UI would still be fully accessible to disable specific plugins if needed.
-
Will plugins updated for Homebridge v2 still work with Homebridge v1?
- Yes.
-
Do all plugins need to be updated for Homebridge v2?
- No, most plugins probably won't need any changes and will work properly. Just some plugins that make use of old functions will need updating.
- A non-exhaustive list of plugins that need updating can be seen below:
Plugin Problematic Versions Fixed Versions Open Issue PR for Fix homebridge-BOMgovau <=0.1.6
#14 homebridge-broadlink-rm <=4.4.17
4.4.18-beta.0
#722 homebridge-cmd4 <=7.1.0
#146 homebridge-cmdswitch2-no-logs <=0.3.6
0.4.0
homebridge-homekit-control <=0.2.6
#24 homebridge-nest <=4.6.9
4.6.10-beta.0
#663 homebridge-webos-tv <=2.4.4
#537 homebridge-xiaomi-roborock-vacuum <=0.31.1
#958
- With Homebridge v2,
avahi
is now the defaultMDNSAdvertiser
if available; otherwise,ciao
will be used. If you experience any issues withno response
devices, you can set your default advertiser back toBonjour HAP
in the Homebridge UI → Settings → mDNS Advertiser.- If you have already set a specific mDNS advertiser, this will continue to be used.
- If you do not already have a specific mDNS advertiser set and wish to continue using Bonjour HAP, then you should use the Homebridge settings to choose this option before you update to Homebridge v2.
You may need to change your plugins because of the breaking changes in HAP-NodeJS v1.
To see the complete set of changes between v0.12.3
and v1.0.0
, see the version file differences.
- Common long-deprecated code patterns that may need updating:
-
BatteryService
has been removed in favour ofBattery
- Use of enums off the
Characteristic
class is no longer supported:- Instead of
const Units = Characteristic.Units;
you will need to useconst Units = api.hap.Units;
- Instead of
const Formats = Characteristic.Formats;
you will need to useconst Formats = api.hap.Formats;
- Instead of
const Perms = Characteristic.Perms;
you will need to useconst Perms = api.hap.Perms;
- Instead of
-
Characteristic.getValue()
has been removed in favour ofCharacteristic.value
-
Accessory.getServiceByUUIDAndSubType()
has been removed: you can swap this forAccessory.getServiceById()
-
Accessory.updateReachability()
has been removed: reachability in general is no longer supported -
Accessory.setPrimaryService(Service)
has been removed: useService.setPrimaryService()
instead - Remove the long-deprecated init().
- Deprecate Core, BridgedCore and legacy Camera characteristics
- For deprecated Core and BridgedCore see: https://github.com/homebridge/HAP-NodeJS/wiki/Deprecation-of-Core-and-BridgeCore
- For deprecated
storagePath
switch toHAPStorage.setCustomStoragePath
- For
AudioCodec
switch to AudioStreamingCodec - For
VideoCodec
switch to H264CodecParameters - For
StreamAudioParams
switch to AudioStreamingOptions - For
StreamVideoParams
switch to VideoStreamingOptions - For
cameraSource
switch toCameraController
- Other deprecated code to highlight removed:
useLegacyAdvertiser
,AccessoryLoader
- For Fix: Naming for
Characteristic.ProgramMode
has been corrected fromPROGRAM_SCHEDULED_MANUAL_MODE_
toPROGRAM_SCHEDULED_MANUAL_MODE
-
You may need to change your plugins because of the breaking changes in Homebridge v2.
Homebridge 2.0 is still in beta. To see the current changes between v1.8.3
and v2.0.0
, see the version file differences.
Once you have tested your plugin(s) function correctly on Homebridge v2, you can update your package.json
's engines.homebridge
value to show that your plugin is ready.
"engines": {
"homebridge": "^1.6.0 || ^2.0.0-beta.0",
"node": "^18.20.4 || ^20.15.1 || ^22"
},
Users will see a green tick in the readiness check in the UI once they have installed a version of your plugin with this in the engines
.
Once Homebridge v2 has been released, you can remove the -beta.0
from the homebridge
versions.
- Raspberry Pi
- Debian, Ubuntu
- CentOS, Fedora, Red Hat
- Arch, Manjaro
- macOS
- Windows 10 / 11 (Hyper-V)
- Docker
- 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 Homemanager App
- 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
- Standalone Mode
- Swap From Standalone To Service Mode
- Developer Docs
- API Reference
- Plugin Templates
- Other Links (Internal)
- Other Links (External)