Skip to content

Bundle Homebridge plugins and fix HomeKit pairing issues - #300

Open
krugerfreya wants to merge 9 commits into
homebridge:latestfrom
krugerfreya:claude/hopeful-mendel-s0y9a8
Open

Bundle Homebridge plugins and fix HomeKit pairing issues#300
krugerfreya wants to merge 9 commits into
homebridge:latestfrom
krugerfreya:claude/hopeful-mendel-s0y9a8

Conversation

@krugerfreya

Copy link
Copy Markdown

♻️ Current situation

Describe the current situation. Explain current problems, if there are any. Be as descriptive as possible (e.g., including examples or code snippets).

💡 Proposed solution

Describe the proposed solution and changes. How does it affect the project? How does it affect the internal structure (e.g., refactorings)?

⚙️ Release Notes

Provide a summary of the changes or features from a user's point of view. If there are breaking changes, provide migration guides using code examples of the affected features.

➕ Additional Information

If applicable, provide additional context in this section.

Testing

Which tests were added? Which existing tests were adapted/changed? Which situations are covered, and what edge cases are missing?

Reviewer Nudging

Where should the reviewer start? what is a good entry point?

krugerfreya and others added 9 commits June 13, 2026 12:11
Add empty "Icon\r" placeholder files across multiple directories. These are macOS Finder metadata files that were inadvertently committed to the repo. Consider adding a .gitignore entry (for example "Icon\r" or "Icon?") or using .git/info/exclude to avoid committing these files in the future.
Bundle the homebridge-ring plugin into the built VM image so Ring
devices are available out of the box, rather than requiring a manual
install from the Homebridge UI after first boot.

- Track the pinned plugin version in each release stream's package.json
  stub (stable/beta/alpha), matching the existing convention for
  homebridge-apt-pkg and ffmpeg-for-homebridge.
- Read the version in build-debian-image.sh and export it into the
  staged asset chroot environment.
- Install it during the Homebridge stage via `hb-service add`, which
  resolves the apt package's custom plugin path automatically. The step
  is skipped when no version is configured.
- Surface the plugin version in the generated package manifest.
Bundle the homebridge-ring plugin into the built VM image so Ring
devices are available out of the box, rather than requiring a manual
install from the Homebridge UI after first boot.

- Track the pinned plugin version in each release stream's package.json
  stub (stable/beta/alpha), matching the existing convention for
  homebridge-apt-pkg and ffmpeg-for-homebridge.
- Read the version in build-debian-image.sh and export it into the
  staged asset chroot environment.
- Install it during the Homebridge stage via `hb-service add`, which
  resolves the apt package's custom plugin path automatically. The step
  is skipped when no version is configured.
- Surface the plugin version in the generated package manifest.
The VM image runs avahi-daemon, which owns mDNS port 5353 and provides
the .local UI address. Homebridge's default bundled advertiser
(bonjour-hap/ciao) also binds 5353, so the two conflict: the bridge is
discoverable in the Home app but pairing fails or times out.

Point Homebridge at the system Avahi advertiser instead:

- Add hb-service prestart hook 10-hb-mdns-advertiser. When config.json
  already exists it sets bridge.advertiser to "avahi" only if the user
  hasn't chosen one. On first boot (no config yet) it seeds a valid
  default config with a per-VM bridge identity and avahi already
  selected, so pairing works from the very first start.
- Install the hook in assets/01-homebridge/00-run.sh and explicitly
  enable avahi-daemon so advertising and the .local address work.
- Correct the stale avahi references in copilot-instructions.md to
  describe the real mechanism (the prior docs pointed at a
  50-avahi.service file that does not exist).
Bundle the homebridge-tuya-api plugin into the built VM image alongside
homebridge-ring, following the same mechanism: track the pinned version
in each release stream's package.json stub, read and export it in
build-debian-image.sh, install it in the chroot via `hb-service add`,
and record it in the package manifest. The step is skipped when no
version is configured.
Generalize the bundled-plugin mechanism so the Tuya plugin (and any
future plugin) installs automatically with no per-plugin code:

- build-debian-image.sh now extracts every dependency named homebridge-*
  from the stream's package.json into a single HOMEBRIDGE_PLUGINS list of
  name@version specs, passes it into the chroot, and emits one manifest
  row per plugin.
- assets/01-homebridge/00-run.sh installs the list in a loop via
  `hb-service add`, replacing the hard-coded per-plugin blocks.
- Register homebridge-ring and homebridge-tuya-api in the
  homebridge-dependency-bot configs for all three streams so the daily
  cron keeps their versions current and rebuilds the images.
Swap the bundled Tuya plugin to the official, maintained
homebridge-tuya-platform (v1.5.0, by the Tuya developer team) in all
three release-stream package.json stubs and the dependency-bot configs.
No build-script changes needed thanks to the generic plugin mechanism.
…el-s0y9a8

# Conflicts:
#	alpha/package.json
#	assets/01-homebridge/00-run.sh
#	beta/package.json
#	build-debian-image.sh
#	stable/package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants