npm homebridge 2.0.0

6 hours ago

⚠️ Breaking Changes

  • For Users:

    • Before upgrading, you will want to ensure that the plugin(s) you are using are compatible with this new version of Homebridge. If you are unsure, see the link below or open an issue with the developer of your plugin(s) in question.
    • Node.js v18 and v20 are no longer supported. Homebridge v2 requires Node.js v22 or v24.
  • For Plugin Developers:

    • HAP-NodeJS rename + major upgrade. The dependency was renamed from hap-nodejs to @homebridge/hap-nodejs and bumped from 0.14.x to 2.x. Plugins importing directly from hap-nodejs must update both the package name and adjust to the v2 API. The recommended path is to import HAP types from homebridge (which re-exports them) rather than depending on @homebridge/hap-nodejs directly.
    • ESM-only. The published package is now ESM ("type": "module"). Plugins authored as CommonJS that load homebridge via require() will not work; use import syntax. Plugins must publish ESM (or dual ESM/CJS) builds.
    • Output directory renamed lib/dist/. Plugins doing dirty-imports like homebridge/lib/api must switch to the public exports (import { API } from 'homebridge').
    • bin/homebridgebin/homebridge.js. The bin entry now includes the .js extension (ESM requires it). The npm-managed homebridge shim is unaffected; only hardcoded paths to the script need updating.
    • Legacy deprecation cleanup (#3648). The following were removed in v2:
      • Module-level withPrefix, setDebugEnabled, setTimestampEnabled, forceColor exports from homebridge. Use Logger.withPrefix(...), Logger.setDebugEnabled(...), etc. on the Logger class.
      • PlatformAccessory.reachable, PlatformAccessory.updateReachability, PlatformAccessory.getServiceByUUIDAndSubType, PlatformAccessory.configureCameraSource. Use getServiceById and standard HAP camera registration patterns.
      • API.publishCameraAccessories. Use API.publishExternalAccessories (this is what the deprecated method delegated to internally).
      • HomebridgeConfig.mdns field is no longer forwarded to child bridges and is ignored. Use bridge.advertiser instead.
  • Please visit the following link to learn more about the changes and how to prepare:

Added

  • set debug -D setting per child bridge
  • feat: matter implementation
    • fix: matter fix [1] - matter cache getter (@talrhv)
    • fix: matter fix [2] - various fixes
    • fix: matter fix [3] - combined devices
    • fix: matter fix [4] - general fixes
    • fix: matter fix [5] - expose WaterValve device (#3909) (@donavanbecker)
    • fix: matter fix [6] - crash when bridge bind is set (#3910) (@gtalusan)
    • fix: matter fix [7] - fix level control for non-lighting devices
    • fix: add powerSource to clusterNames and ClusterStateMap (#3912) (@gtalusan)
    • fix: enable Rechargeable feature for PowerSource cluster when batChargeState is provided (#3914) (@gtalusan)
    • fix: remove API event listeners in Matter manager teardown (#3915) (@gtalusan)
    • fix: remove stateChange/commissioning listeners from MatterServer on teardown (#3916) (@gtalusan)
    • fix: remove duplicate API event listeners from Server (#3917) (@gtalusan)
    • fix: remove process message listener on IpcService teardown (#3918) (@gtalusan)
    • fix: bind MdnsService to bridge.bind interface (#3920) (@gtalusan)
    • fix: matter fix [15] - various enhancements
    • fix: Add GenericSwitch to api.matter.deviceTypes (#3923) (@donavanbecker)
    • refactor(matter): namespace switch helper as api.matter.switch.emit

Changed

  • Address legacy deprecation cleanup (#3648) (@hjdhjd)
  • general code modernisation:
    • ⚠️ move from commonjs to esm modules
    • use lint rules from @antfu/eslint-config
    • migrate from jest to vitest for testing
    • ⚠️ drop support for node v18 and 20
  • fix(server): wire bridge.hap=false through

Removed

  • ⚠️ remove deprecated --remove-orphans flag

Homebridge Dependencies

  • @homebridge/hap-nodejs @ v2.1.4

Don't miss a new homebridge release

NewReleases is sending notifications on new releases.