Control HomeKit from the terminal, scripts, and Stream Deck

Updated 2 July 2026

HomeKit has no public API: Apple's framework is only available to apps, so there is no official way to toggle a light from a shell script, wire your home into IFTTT or n8n, or put a lamp on a Stream Deck key. The gap is real – and the answer is a Mac app that bridges HomeKit to local HTTP.

Itsyhome for macOS runs a built-in webhook server (default port 8423) that exposes your whole home – HomeKit and Home Assistant alike – to anything that can make an HTTP request, plus URL schemes for launcher apps and an official Stream Deck plugin. Everything stays on your local network.

Pick your integration

  • URL schemes – for Shortcuts, Alfred, Raycast: open "itsyhome://toggle/Office/Spotlights" or "itsyhome://scene/Goodnight" from any launcher.
  • Webhook HTTP server – for scripts and automation platforms: curl http://localhost:8423/on/Kitchen/Light, /brightness/50/Office/Lamp, /temp/22/Hallway/Thermostat, /scene/Goodnight, /lock/Front%20Door and more.
  • Query endpoints – /status, /list/rooms, /list/devices, /list/scenes, /info/<device> return JSON, including battery levels for battery-powered accessories.
  • Server-Sent Events – curl -N http://localhost:8423/events streams every real state change as JSON, for dashboards and external automation.
  • CLI – brew install nickustinov/tap/itsyhome for a proper terminal client.
  • Stream Deck – the Itsyhome plugin on the Elgato Marketplace gives you buttons with live state: lights, scenes, locks, blinds, garage doors, thermostats, groups.

Setup

  1. 1

    Enable the webhook server

    In Itsyhome on the Mac, open Settings → Webhooks/CLI and enable the server. The default port is 8423; you can optionally bind it to a single interface (for example a Tailscale IP) so it is reachable only over your private mesh.

  2. 2

    Address devices by room and name

    Targets are human-readable: Room/Device (Office/Spotlights), room-scoped groups (Office/group.All%20Lights), or global groups (group.Office%20Lights). URL-encode spaces as %20.

  3. 3

    Wire it into your tools

    Anything that speaks HTTP works: cron jobs, IFTTT and Zapier webhooks, n8n flows, Home Assistant rest commands, window manager keybindings, or an AI agent. The /events SSE stream lets external systems react to your home in real time.

Why a local bridge instead of a cloud service

Because HomeKit control never needs to leave your network. The webhook server runs on your Mac, talks to accessories over Apple's local HomeKit framework, and answers HTTP on your LAN – no API keys, no third-party cloud, no round trip to someone else's server to turn on your own lamp. It requires the Mac to be awake, which is exactly the machine already running your scripts.

Frequently asked questions

Does HomeKit have an API?

Not a public one – Apple's HomeKit framework is only available inside apps, and there is no official HTTP API. The practical route is a bridge app: Itsyhome on macOS exposes your home over a local webhook server, URL schemes, a CLI, and an SSE event stream.

How do I control HomeKit from a shell script?

Enable Itsyhome's webhook server (Settings → Webhooks/CLI) and use curl: "curl http://localhost:8423/toggle/Office/Spotlights" toggles a device, /brightness/50/... sets brightness, /scene/Goodnight runs a scene. Or install the CLI with "brew install nickustinov/tap/itsyhome".

Can I use HomeKit with IFTTT, Zapier, or n8n?

Yes, via webhooks: point their HTTP actions at Itsyhome's local server (expose it over a VPN such as Tailscale rather than the open internet). For the reverse direction, the /events SSE stream pushes real-time device state changes to your automation platform.

Can I put HomeKit devices on a Stream Deck?

Yes – the Itsyhome Stream Deck plugin (Elgato Marketplace) provides buttons with live state for lights, scenes, locks, blinds, garage doors, thermostats, and groups. It works with both HomeKit and Home Assistant and requires the webhook server to be enabled.

Related guides

Control HomeKit from iPhone, iPad, Mac, and Apple TV

Itsyhome is a fast, native smart home controller with live cameras, sensor history, automations, and Home Assistant support on Mac. Free on Mac, one-time Pro unlock across all platforms – no subscription.

Download Itsyhome