HomeKit Proxy is a lightweight, self-hosted bridge that exposes your shell commands as HomeKit accessories. It allows you to control your custom devices and scripts through Apple's Home app and Siri.
- HomeKit Bridge: Exposes shell commands as HomeKit accessories.
- Device Configuration: Configure devices and their characteristics using a simple YAML file (
device.yaml). - Automations: Schedule shell commands to run at specific times using cron expressions (
automation.yaml). - Web UI: A simple web interface to view the status of your accessories and automations, and to manually trigger automations.
- Action Log: Logs all actions to a SQLite database for auditing and debugging.
- Configuration Hot-Reload: Automatically reloads the server when configuration files are changed.
- Customizable: Customize network interface, address, and PIN code.
HomeKit Proxy works by creating a virtual HomeKit bridge. You define your accessories and their characteristics in a device.yaml file. For each characteristic, you specify shell commands to get or set its value. The proxy then exposes these accessories to your HomeKit network.
When you interact with an accessory in the Home app (e.g., turn on a light), HomeKit Proxy executes the corresponding shell command. It can also periodically poll the get command to keep the state of the accessory up-to-date.
- Go 1.18 or later
-
Clone the repository:
git clone https://github.com/waynezhang/homekit-proxy.git cd homekit-proxy -
Build the binary:
make build
The binary will be located in the
bindirectory.
-
Create a
configdirectory:mkdir config
-
Create a
device.yamlfile in theconfigdirectory. See the device.sample.yaml for an example. -
Create an
automation.yamlfile in theconfigdirectory. See the automation.sample.yaml for an example.
./bin/homekit-proxy serve --config ./config --db ./dbThis will start the HomeKit Proxy server. You can then add the bridge to your Home app by scanning the QR code displayed in the console or by entering the PIN code.
See config/device.sample.yaml and config/automation.sample.yaml.
| Name | Description |
|---|---|
HOMEKIT_PROXY_USER |
The username for the web UI. |
HOMEKIT_PROXY_PASSWORD |
The password for the web UI. |
HOMEKIT_PROXY_BINDADDR |
The address and port to bind the HomeKit proxy to. |
HOMEKIT_PROXY_IFACE |
The network interface to use for the HomeKit proxy. |
HOMEKIT_PROXY_NTFY_TOPIC |
The ntfy.sh topic to send notifications to when an automation is triggered. |
HomeKit Proxy provides a simple web UI to view the status of your accessories and automations. You can access it at http://bindaddr.
The web UI also allows you to manually trigger automations.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is licensed under the MIT License. See the LICENSE file for details.