![]()
House Control
你的家作为实时 3D 模型——呈现在 Mac 菜单栏、刘海四周以及你的 iPhone 上——
通过 Smart Life、Home Assistant、Philips Hue 和 Apple Home 控制家中的灯光与空调。

它能做什么
- 常驻菜单栏。 点击房子图标即弹出面板;点击其他任意位置即消失。
- 你的户型图以 3D 呈现。 房间、墙壁、门、窗和家具由一个 JSON 文件构建。灯具像照亮真实房间一样照亮场景;运行中的空调会吹出可见的气流。
- 灯光。 点击开关,在磁贴上横向拖动调光,打开某盏灯可调节亮度、白色色温和颜色。
- 空调。 电源、目标温度、模式和风速,如果配有真实传感器,还能读取房间温度。
- 场景。 一键设定所有灯光和空调——“温馨”、“观影”、“夜间”,或你自己的场景。
- 可视化编辑器。 绘制房间、摆放家具、放置灯具和空调,并将每一个与真实设备关联。
- 你的设备,无论来自哪个生态。 Smart Life / Tuya、Home Assistant(及其支持的数千个品牌)、Philips Hue 和 Apple Home——可在同一个家中自由混用。参见连接真实设备。
- 刘海周围的“岛”。 将指针停在 MacBook 的刘海上,一个小型实时家居模型从中弹出,场景和所有设备一键可达。参见岛。
- AI 访问。 给 ChatGPT、Claude 或任何 AI 助手一个私人链接——或通过 MCP 连接——它就能控制你的灯光和空调,并根据你的照片在 3D 模型中重建房间。由你的 Mac 提供服务;点击 Stop 即结束。参见 AI 访问。
- 小组件与控制。 在 iPhone 主屏幕和 Mac 桌面上以 3D 呈现家居,场景、灯具和空调一键即达,还有锁定屏幕与控制中心控件,以及应用图标上的快捷操作。参见小组件。
- 无需 Mac 的 iPhone 应用。 在手机上绘制户型、连接 Smart Life、Home Assistant、Hue 和 Apple Home 并关联设备,全部在手机上完成。之后配对 Mac,两者保持同步,无论在哪一端编辑。参见 iPhone 应用。
- 无需任何硬件即可使用。 在登录之前,所有设备均为模拟状态,你可以先体验全部功能。
两款应用都是一个轻量原生 Swift 外壳(Mac 上为 AppKit,iPhone 上为 SwiftUI),包裹同一个 Three.js Web UI,并以 Swift 包的形式共享设备客户端与同步逻辑。无框架、无 Electron、无服务器、无需自有账号。
下载
- 从 Releases 获取
HouseControl-<version>.dmg。它可运行于 macOS 13 或更新版本,Apple 芯片和 Intel 芯片均支持。 - 打开它,将 House Control 拖入应用程序。
- 从“应用程序”打开 House Control。首次打开时,macOS 会以“Apple 无法验证……”为由阻止它,因为该应用未使用付费 Apple Developer ID 签名(见原因)。允许一次即可:
- macOS 15 Sequoia 及更新版本: 点击完成,打开系统设置 → 隐私与安全性,向下滚动至“House Control 已被阻止……”,点击仍要打开并用密码确认。
- macOS 13–14: 在“应用程序”中按住 Control 键点击该应用,选择打开,再点一次打开。
- 或者,在终端执行:
xattr -dr com.apple.quarantine "/Applications/House Control.app"
- 在菜单栏中寻找房子图标——没有 Dock 图标,也没有窗口。点击它。
每个版本的新变化见:CHANGELOG.md。
它以一个内置演示户型启动,因此你可以在连接任何设备前先体验全部功能。然后:打造你的家并连接真实设备。要让它随 Mac 启动,请在系统设置 → 通用 → 登录项中添加它。
校验你下载的内容
每个发布镜像均由 GitHub Actions 从打标签的提交构建——而不是在任何人的 Mac 上——并附带 SHA-256 和一份签名的构建来源证明(attestation):
shasum -a 256 -c HouseControl-<version>.dmg.sha256
gh attestation verify HouseControl-<version>.dmg --repo 0xProbabillity/house-control
第二条命令可证明镜像由本仓库的工作流构建,并显示来自哪个提交。从 1.0.0 起的镜像附带证明;0.1.0 是在仓库仍为私有时构建的,当时 GitHub 不为免费账户存储证明,因此只能校验其 SHA-256。
为什么应用未经过公证
公证需要 Apple Developer ID,而该证书会将持有者的法定姓名嵌入应用的每一份副本中。House Control 改为以临时签名(ad hoc)方式发布,并以开源的方式赢得信任:代码全部在此,发布过程公开构建,你也可以在几分钟内自行构建。
移除它
退出应用(右键点击菜单栏图标 → Quit),从“应用程序”中删除 House Control,若还要删除户型和连接配置,再删除 ~/Library/Application Support/HouseControl/。
系统要求
| macOS | 13 Ventura 或更新版本 |
| Xcode 命令行工具 | Swift 5.9 或更新 — xcode-select --install |
| Node.js | 20.19+ 或 22.12+ |
| iPhone 应用 | Xcode 16 或更新,XcodeGen(brew install xcodegen),iOS 17+ |
构建与运行
git clone https://github.com/0xProbabillity/house-control.git
cd house-control
./scripts/build-app.sh
open build/HouseControl.app
该脚本使用 Vite 构建 Web UI,使用 SwiftPM 构建原生外壳,并组装出一个临时签名的 build/HouseControl.app。首次构建会下载 npm 包;之后的构建只需几秒。
应用为临时签名。如果你经常重新构建并使用 iPhone 同步功能,请改用自己的证书签名,这样 macOS 就不会在每次构建后都请求“本地网络”权限:CODESIGN_IDENTITY="Apple Development: you@example.com (ABCDE12345)" ./scripts/build-app.sh。
要保留它,将 build/HouseControl.app 拖入 /Applications。要让它随 Mac 启动,在菜单栏图标的右键菜单(或面板的齿轮菜单)中开启 Open at Login;它会出现在系统设置 → 通用 → 登录项中,也可在那里关闭。
没有 Dock 图标,也没有主窗口:请在菜单栏寻找房子图标。
使用方法
| 操作 | 效果 |
|---|---|
| 点击菜单栏图标 | 打开或关闭面板 |
| 右键点击菜单栏图标 | 编辑房屋、加载户型图、显示户型文件、显示设备日志、显示岛、登录时打开、配对 iPhone、AI 访问、重新加载、退出 |
| 点击 3D 视图中的灯或其磁贴 | 开关它 |
| 在灯光磁贴上横向拖动 | 调光 |
| 点击灯光磁贴上的滑块图标 | 亮度、白色色温、颜色 |
| 点击空调或其磁贴 | 打开其页面:温度、模式、风速 |
| 点击某个房间 | 放大到该房间,并仅列出其中的设备 |
| 拖动 3D 视图 / 在其上滚动 | 旋转 / 缩放 |
Esc | 先返回,再关闭 |
菜单栏图标会显示已开灯的数量和运行中空调的目标温度,例如 6 · 23°。
面板中的齿轮按钮可在你的家和两个内置演示户型——Apartment(公寓)和 Studio(工作室)——之间切换。
岛(Island)

一个黑色小舌从 MacBook 的刘海中生长出来。在没有刘海的显示器上,它绘制在菜单栏中间。
| 操作 | 效果 |
|---|---|
| 看着它 | 已开灯的数量,以及运行中空调的目标温度 |
| 指针悬停其上 | 它如弹簧般展开:3D 模型、场景、空调和灯光 |
| 点击模型中的灯或其胶囊 | 开关它;在胶囊上拖动可调光 |
| 点击模型中的房间 | 放大到该房间 |
| 移开指针 | 它收起 |
当其他地方发生变化——在面板中选择了某个场景、从手机上切换了某盏灯——岛会短暂探出,说明发生了什么。它绝不会从你正在使用的应用中抢走键盘焦点。菜单栏图标右键菜单中的 Show Island 可将其关闭。
AI 访问

右键点击菜单栏图标 → AI Access… → Start AI Access,然后把私人链接交给一个助手:
- 任意聊天: 将其粘贴到 ChatGPT、Claude、Gemini 或 Perplexity 中并附上你的请求——“把客厅调暗到 30%”。该链接会打开一篇专为 AI 助手撰写的指南,其中包含它能执行的每项操作的链接。
- 连接器: 在 Claude 或 ChatGPT 中将 MCP 地址添加为自定义连接器(或在 Claude Code 中执行
claude mcp add),助手还能更改家居本身:“这是我客厅的照片——在 3D 中重建它”。 - 你自己的智能体: 以普通 HTTP + JSON 的形式提供相同的工具,并附有 OpenAPI 描述。
这一切由你的 Mac 提供服务:House Control 仅监听 127.0.0.1,并通过一条仅在 AI 访问开启期间存在的 Cloudflare 快速隧道访问(若选择 This Mac only,则完全不对外)。链接携带 128 位密钥,你可以选择助手能做什么,每个请求都会实时显示在窗口中,户型编辑可以撤销,而 Stop——或自动停止计时器——会让该地址消失。设备 ID 和登录凭据绝不会离开你的 Mac。
详情、所有工具及隐私模型:[docs/ai-access.md](docs/ai-a
ccess.md).
iPhone app

The iPhone app is the panel made for a thumb: tap a lamp in the 3D view or its tile, drag across a tile to dim, touch and hold a light for brightness and colour, pinch the model to zoom, swipe in from the left edge to go back.
It needs no Mac. Everything is set up on the phone, under Settings (the sliders button):
- New home starts your own plan — one room, or the Studio or Apartment layout to adapt — and opens the editor.
- Edit floor plan is the Mac’s editor laid out for a finger: tap a room, lamp or AC to select it, drag what is selected, drag anywhere else to pan, pinch to zoom. Its details come up in a sheet from the bottom; Add, Items, 3D and Home sit along the bottom edge. Save keeps the plan on the phone (and sends it to a paired Mac).
- Devices lists every lamp and AC of the plan by room; tap one and pick its real device from everything your connected platforms have, or Add devices to a room to put several in at once, already linked.
- Smart Life, Home Assistant, Philips Hue and Apple Home connect right there. Home Assistant servers and Hue Bridges on the Wi-Fi are found by themselves.
Try it in the simulator:
./scripts/ios-sim.sh
To put it on a phone, write your Apple developer team into ios/Config/Local.xcconfig
(DEVELOPMENT_TEAM = ABCDE12345), run cd ios && xcodegen generate --spec project-smartlife.yml, open
ios/HouseControl.xcodeproj and run it on your device. ./scripts/build-ios.sh --upload archives it and sends it to
TestFlight; the script lists what it needs.
The iPhone app comes in two editions, built from the same code:
| Edition | What it has | Built from |
|---|---|---|
| App Store | Home Assistant, Philips Hue, Apple Home | ios/project.yml · EDITION=appstore |
| Smart Life | all of the above plus Smart Life / Tuya, for TestFlight and your own phone | ios/project-smartlife.yml (the scripts’ default) |
Smart Life is reached through the sign-in Home Assistant’s Tuya integration uses, not through an API Tuya offers to
apps, so it stays out of the App Store edition entirely: its code lives in its own module (core/Sources/HouseSmartLife)
that only the Smart Life edition and the Mac app link, and build-ios.sh refuses an App Store archive that contains it.
The two editions are separate apps (bundle id and App Group), so both can sit on one phone.
Sync with the Mac
Optional. Pair a Mac and your floor plan — rooms, furniture, lamps, scenes and the links to real devices — plus the Home Assistant and Hue connections stay the same on both, whichever one you set up or edit first.
- On the Mac: right-click the menu bar icon → Pair iPhone…. A QR code appears. macOS asks once whether House Control may find devices on your local network: allow it.
- On the iPhone: Settings (the sliders button) → Pair with Mac, and point the camera at the code. Or press Copy Pairing Link on the Mac and paste it on the phone.
From then on, whenever both are on the same Wi-Fi and the app is open, a plan saved on one reaches the other a moment later. A home set up on the phone first goes to the Mac when you pair them. If both changed the plan while apart, the phone asks which one to keep. A Home Assistant or Hue Bridge connected, or disconnected, on either side is the newest one on both.
Nothing goes through a server. The Mac advertises itself with Bonjour and the two talk over TLS with a pre-shared key that only the QR code carries, so a device that never saw the code cannot connect. Reset Pairing… in the pairing window issues a new key.
Real devices on the iPhone
In the Smart Life edition the phone signs in to Smart Life on its own: Settings → Connect Smart Life. The User Code is filled in from the Mac if you are signed in there. The sign-in code has to be scanned by the Smart Life app, which is on the very phone you are holding. So Save code to Photos, then in Smart Life tap + → Scan and open the picture from its photo button. A paired Mac also puts the code on its screen for you, and Share code sends it to any other screen.
The session is kept in the iPhone’s Keychain and never leaves the device.
Widgets

Every widget is live: tap a lamp, a scene or an AC and it switches without opening the app.
- Home — your home as a small 3D model, every lamp glowing in its own colour; scenes, the climate strip and tappable lamps in the bigger sizes (extra large on the Mac).
- Scenes, Light (one lamp you pick), Room (its lamps; the large size shows the room alone in 3D) and Climate (an AC’s dial with the room temperature, power and − / +).
- Lock Screen: Home Status, Light and Climate as circles, rectangles and an inline line.
- Controls for Control Center, the Lock Screen and the Action button (iOS 18, macOS 26): All Lights, a Light, a Scene, an Air Conditioner.
- Quick actions: press and hold the app icon on the iPhone. Choose which scenes, lamps and ACs it offers in Settings → Quick Actions.
On the Mac they need the app running in the menu bar (it carries out what you tap); on the iPhone the widget talks to Home Assistant, Hue and Smart Life itself, and Apple Home devices switch when the app next opens. How it fits together, and how to build and try it: docs/widgets.md.
Make it your home
Right-click the icon and choose Edit Home…

- Drag rooms to move them and drag a corner to resize; everything snaps to 5 cm.
- Where two rooms touch, the wall between them appears by itself. Walls facing the camera are cut away.
- Add doors, windows, furniture, lamps and air conditioners from the list on the left.
- Save & apply writes the plan and reloads the panel.
The plan is a single JSON file, ~/Library/Application Support/HouseControl/plan.json. You can write it by hand,
export it, or import someone else’s: see docs/floor-plan.md for every field.
The demo plans in web/public/plans are good starting points.
Connect real devices

Right-click the icon → Edit Home… → Connections, and connect what you have:
| Platform | How | Details |
|---|---|---|
| Smart Life / Tuya | Scan a QR code with the Smart Life app. No Tuya developer account | docs/smart-life.md |
| Home Assistant | Found on your network by itself; paste a long-lived access token | docs/connections.md |
| Philips Hue | Found on your network by itself; press the button on the bridge | docs/connections.md |
| Apple Home | Allow access on your iPhone; its devices are listed on the Mac for linking | docs/connections.md |
Then select a lamp or an AC on the plan, choose its device under Real device (lamps take over what the device can do), and press Save & apply. From then on the panel controls the real device. Changes made elsewhere show up at once from Home Assistant and Hue, and within 12 seconds from Smart Life.
Your iPhone receives the Home Assistant and Hue connections from the Mac with the floor plan, and switches
Apple Home devices itself. Why there is no Google Home or Alexa yet, and how to get Tuya devices into Apple Home:
docs/connections.md. No hardware at hand? tools/lab has pretend
versions of Home Assistant, a Hue Bridge and a HomeKit bridge.
Privacy
House Control talks to the platforms you connect — Tuya’s servers for Smart Life, your own Home Assistant, your Hue Bridge, Apple Home on the iPhone — and to nothing else. There is no telemetry and no backend of its own. The one exception is yours to switch on: AI Access opens a Cloudflare tunnel to your Mac while it is on.
Everything personal stays in ~/Library/Application Support/HouseControl/ on your Mac:
| File | Contents |
|---|---|
plan.json | Your floor plan, including the IDs of the devices you linked |
settings.json | Which plan is active |
smartlife.json | The Smart Life session tokens. Readable only by you (mode 600) |
tuya.json | Tuya Cloud project credentials, only if you use that option. Mode 600 |
homeassistant.json | Your Home Assistant’s address and access token. Mode 600 |
hue.json | Your Hue Bridge’s address, the key it issued and its certificate’s fingerprint. Mode 600 |
homekit-devices.json | The Apple Home devices your iPhone listed for the editor: names and ids |
events.log | Commands sent to real devices and the cloud’s answers. No tokens |
sync.json | The key your paired iPhones use. Only there once you paired one. Mode 600 |
cloudflared.yml, bin/cloudflared | An empty config for AI Access’s tunnel, and Cloudflare’s connector if you let the app download it |
None of these are part of this repository, and the build does not embed them in the app.
Sign out in the editor deletes smartlife.json. Deleting the folder resets the app to the demo plan.
On the iPhone the floor plan lives in the app’s own folder, and the Smart Life session, the pairing key and the Home Assistant and Hue connections the Mac shared in the Keychain.
Development
web/ the UI: Three.js scene, panel, island, editor, AI Access window and the AI tools (Vite, plain ES modules)
core/ what both apps share: plan store, device platforms, Mac ⇄ iPhone sync, the AI gateway, and the Smart Life
and Tuya clients as a separate module (SwiftPM, with tests)
macos/ the Mac shell: menu bar item, panel, island and editor windows (SwiftPM)
ios/ the iPhone shell: SwiftUI, generated into an Xcode project by XcodeGen
scripts/ build-app.sh, build-ios.sh and ios-sim.sh build the apps, release-mac.sh makes the .dmg,
make-icon.swift and make-dmg-background.swift draw the icon and the disk image's window
tools/lab pretend Home Assistant, Hue Bridge and HomeKit bridge for testing without hardware
docs/ floor plan reference, connection guides, screenshots
The shared package has unit tests, including the sync over a real TLS connection:
cd core && swift test
Work on the UI in a browser with hot reload — the native bridge is a no-op there and all devices are simulated:
cd web
npm install
npm run dev
Then open http://localhost:5199/. Add ?plan=studio for the second demo plan, ?mode=editor for the editor,
?mode=island for the island, ?mode=agent for the AI Access window (with a simulated link), ?platform=ios for the iPhone layout, or ?device=living.ac to start on a
device’s sheet. Set PORT to use another port.
Environment variables understood by the app:
| Variable | Effect |
|---|---|
HOUSE_DEV_URL=http://localhost:5199/ | Load the UI from the dev server instead of the bundle |
HOUSE_WEB_DIR=/path/to/dist | Load the UI from another folder |
HOUSE_DATA_DIR=/some/folder | Keep plan, session and log there instead of Application Support, and do not persist panel state. Handy for a clean test run |
HOUSE_OPEN_ON_LAUNCH=1 | Open the panel at launch |
HOUSE_OPEN_EDITOR=1 | Open the editor at launch (connections, smartlife, homeassistant, hue or homekit opens it on that screen) |
HOUSE_OPEN_DEVICE=<id> | Start the panel on that light’s or AC’s sheet |
HOUSE_PIN=1 | Keep the panel open when it loses focus |
HOUSE_DOCK=1 | Show a Dock icon, so UI automation tools can see the app |
HOUSE_ISLAND=0 | Run without the island (1 forces it on) |
HOUSE_ISLAND_EXPANDED=1 | Keep the island open |
HOUSE_OPEN_PAIRING=1 | Open the Pair iPhone window at launch |
HOUSE_COMPUTER_NAME="Studio Mac" | The name paired iPhones see, instead of the Mac’s own (screenshots) |
HOUSE_SNAPSHOT_DIR=/some/folder | Write panel.png and island.png there a few seconds after launch |
HOUSE_RENDER_HIDDEN=1 | Keep drawing while the screen is locked, for unattended captures |
HOUSE_OPEN_AGENT=1 | Open the AI Access window at launch (start also starts the link) |
HOUSE_AGENT_REACH=local | Serve AI Access on this Mac only for one run (internet for the tunnel) |
HOUSE_AGENT_LINK_FILE=/some/file | Write the live AI Access link there, for scripted tests |
HOUSE_EVAL_DIR=/some/folder | Scripted UI checks: a panel.js / editor.js / island.js dropped there runs in that page (as an async function body) and its result is written to <mode>.json |
The iPhone app understands HOUSE_DATA_DIR, HOUSE_OPEN_DEVICE, HOUSE_SYNC_ENDPOINT=host:port (a Mac test instance
without Bonjour) and HOUSE_SCREEN=home|settings|connections|pairing|smartlife|homeassistant|hue|devices|newhome|editor|welcome;
scripts/ios-sim.sh passes any HOUSE_* variable on to the simulator.
For example, a throw-away instance on the demo plan, pinned open:
HOUSE_DATA_DIR=/tmp/house-demo HOUSE_PIN=1 HOUSE_OPEN_ON_LAUNCH=1 build/HouseControl.app/Contents/MacOS/HouseControl
The binary has a few offline self-checks and one read-only diagnostic:
| Command | Prints |
|---|---|
HouseControl --selftest-mapper | The Tuya commands built for typical light and AC actions |
HouseControl --selftest-infrared | The key presses sent to an infrared AC, against a simulated cloud remote |
HouseControl --selftest-transport | The Smart Life request envelope for fixed inputs, to compare with the reference SDK |
HouseControl --diagnose <device id>… | What Smart Life reports for those devices. Reads only; sends nothing |
Releasing the Mac app
Set MARKETING_VERSION in ios/Config/Base.xcconfig, add a ## <version> — <date> section to
CHANGELOG.md (it becomes the release notes), commit, then tag and push:
git tag v1.0.0 && git push origin v1.0.0
release.yml builds the universal app on a GitHub macOS runner
(UNSIGNED=1 ./scripts/release-mac.sh), attests its provenance and opens a draft release with the disk image
and its SHA-256. Check it, then publish the draft. Running the workflow by hand from the Actions tab builds the same
image as a downloadable artifact without a release.
With an Apple Developer ID of your own, ASC_KEY_ID=… ASC_ISSUER_ID=… ./scripts/release-mac.sh --publish builds a
signed and notarized image locally instead; the script lists what it needs.
Limitations
- The iPhone app is not on the App Store yet (it is on TestFlight for the author’s testers).
- The Mac and the iPhone sync only while both are on the same network; there is no cloud in between.
- Rooms are axis-aligned rectangles. An L-shaped room is two rooms.
- Apple Home devices are switched by the iPhone app only: macOS gives HomeKit to App Store apps only.
- Smart Life devices are reached through Tuya’s cloud, not over the local network, so they need an internet connection (Home Assistant and Hue work on your network alone).
- Infrared air conditioners are one-way: the app shows what was last sent, not what the unit is doing.
Support the project
House Control is free and has no ads. If it earned a place in your menu bar, a tip in crypto helps it keep growing: more devices, more platforms, quicker fixes. Thank you! A star, a bug report or a pull request helps just as much.
Scan a code with your wallet, or copy an address with the button in the corner of its box.
[!IMPORTANT] Send each coin only over the network named next to its address. Coins sent over another network may be lost.
BTC · native SegWit (bech32) address | |
One address on all four networks · ETH, BNB, USDT, USDC and other tokens | |
Toncoin and USDT on TON · no memo needed | |
TRX and USDT (TRC-20) |
Acknowledgements and disclaimer
The Smart Life sign-in is a Swift port of Tuya’s open-source
tuya-device-sharing-sdk, the library behind the Tuya
integration in Home Assistant, and identifies itself to Tuya the same way. The 3D view is built with
Three.js; the icons are from Lucide, the network logos under
Support the project from Web3 Icons (MIT).
This project is not affiliated with or endorsed by Tuya, Smart Life or Home Assistant. It relies on an interface Tuya can change at any time. Use it at your own risk.