所有教程所有教程All guides

使用教程使用教程Guide

本地 Bridge / Docker 部署 本地 Bridge / Docker 部署 Local Bridge on Docker

ZoneFoundry 大部分功能纯 Wi-Fi 就能用。想再进一步——任意歌名搜索、更复杂的场景与定时长期稳定跑在家里——可以用一条 Docker 命令,在 NAS、Unraid、群晖或任何常开的机器上跑一个本地 Bridge,把这些高级控制放回你自己的本地网络。Bridge 是增强,不是必需。 ZoneFoundry 大部分功能純 Wi-Fi 就能使用。想再進一步——任意歌名搜尋、更複雜的場景與定時長期穩定跑在家裡——可以用一條 Docker 命令,在 NAS、Unraid、群暉或任何常開的機器上跑一個本地 Bridge,把這些進階控制放回你自己的本地網絡。Bridge 是增強,不是必需。 Most of ZoneFoundry works on Wi-Fi alone. To go further — search any song by name, run richer scenes and schedules reliably around the clock — you can run a local Bridge with a single Docker command on a NAS, Unraid, Synology or any always-on machine, keeping that advanced control on your own local network. The Bridge is an enhancement, not a requirement.

难度 · 进阶難度 · 進階Level · Advanced 约 8 分钟約 8 分鐘~8 min Docker · NAS · Unraid

先搞清楚:你需要 Bridge 吗?播放、分组、逐房音量、语音、收藏与资料库浏览、播报后自动恢复——这些纯 Wi-Fi 都能用,不需要 Bridge。只有当你想要「任意歌名的云端搜索」和「长期常驻的复杂自动化」时,本地 Bridge 才派上用场。如果暂时用不上,大可跳过这篇。先搞清楚:你需要 Bridge 嗎?播放、分組、逐房音量、語音、收藏與資料庫瀏覽、播報後自動恢復——這些純 Wi-Fi 都能使用,不需要 Bridge。只有當你想要「任意歌名的雲端搜尋」和「長期常駐的複雜自動化」時,本地 Bridge 才派上用場。如果暫時用不上,大可跳過這篇。First: do you even need the Bridge? Playback, grouping, per-room volume, voice, favorites and library browsing, announce-then-restore — all work on Wi-Fi alone, no Bridge required. The local Bridge only matters when you want "search any song from the cloud" and "always-on complex automation". If that's not you yet, feel free to skip this.

开始前你需要開始前你需要Before you start

  • 一台常开、装了 Docker 的机器:NAS(群晖、威联通)、Unraid、迷你主机或旧电脑都行,和 Sonos 在同一个本地网络一台常開、裝了 Docker 的機器:NAS(群暉、威聯通)、Unraid、迷你主機或舊電腦皆可,和 Sonos 在同一個本地網絡An always-on machine with Docker: a NAS (Synology, QNAP), Unraid, mini-PC or an old computer — on the same local network as your Sonos
  • ZoneFoundry iPhone app,已经能正常看到并控制你的 Sonos 房间ZoneFoundry iPhone app,已能正常看到並控制你的 Sonos 房間The ZoneFoundry iPhone app, already seeing and controlling your Sonos rooms

步骤步驟Steps

1

用 Docker 跑起 Bridge 容器用 Docker 跑起 Bridge 容器Run the Bridge container with Docker

Bridge 要用 host 网络模式(它靠本地网络发现你的 Sonos 音箱),并挂一个目录存配置。在你的机器上跑:Bridge 需要用 host 網絡模式(它靠本地網絡發現你的 Sonos 音箱),並掛載一個目錄存放設定。在你的機器上執行:The Bridge needs host network mode (it discovers your Sonos speakers over the local network) and a folder to store its config. On your machine, run:

docker run -d \
  --name zonefoundry-bridge \
  --network host \
  --restart unless-stopped \
  -v /path/to/zf-bridge:/config \
  zonefoundry/bridge:latest

/path/to/zf-bridge 换成你机器上真实的配置目录。群晖/Unraid 用图形界面装容器时,照上面这几项设:host 网络、重启策略、映射 /config 卷即可。/path/to/zf-bridge 換成你機器上真實的設定目錄。群暉/Unraid 用圖形介面安裝容器時,照上面這幾項設定:host 網絡、重啟策略、映射 /config 卷即可。Replace /path/to/zf-bridge with a real config folder on your machine. On Synology/Unraid's container UI, mirror the same settings: host network, restart policy, and a mapped /config volume.

占位图 1:Unraid / 群晖 容器设置界面,host 网络 + /config 卷佔位圖 1:Unraid / 群暉 容器設定介面,host 網絡 + /config 卷Placeholder 1: the Unraid / Synology container setup with host network + /config volume
2

在 app 里连上这台 Bridge在 app 裡連接這台 BridgeConnect the app to this Bridge

容器跑起来后,打开 ZoneFoundry,到「设置 → 桥接」。同一网络下 app 通常会自动发现这台 Bridge;没自动出来就手动填它的本地 IP。连上后,状态会显示「已连接」。容器跑起來後,打開 ZoneFoundry,前往「設定 → 橋接」。同一網絡下 app 通常會自動發現這台 Bridge;沒有自動出現就手動填入它的本地 IP。連接後,狀態會顯示「已連接」。Once the container is up, open ZoneFoundry and go to Settings → Bridge. On the same network the app usually finds it automatically; if not, enter its local IP by hand. Once linked, the status shows "Connected".

占位图 2:设置→桥接页,显示已连接的本地 Bridge佔位圖 2:設定→橋接頁,顯示已連接的本地 BridgePlaceholder 2: the Settings → Bridge page showing a connected local Bridge
3

确认高级功能已解锁確認進階功能已解鎖Confirm the advanced features are unlocked

连上后,原本纯 Wi-Fi 做不到的能力会开放:在搜索页搜任意歌名、跑更复杂的常驻自动化。Bridge 常开着,这些就一直可用;哪天关掉 Bridge,app 会自动退回纯 Wi-Fi 的基础控制,不会卡死。連接後,原本純 Wi-Fi 做不到的能力會開放:在搜尋頁搜尋任意歌名、執行更複雜的常駐自動化。Bridge 常開著,這些就一直可用;哪天關掉 Bridge,app 會自動退回純 Wi-Fi 的基礎控制,不會卡住。Once connected, capabilities that Wi-Fi alone can't do open up: search any song by name and run more complex always-on automation. Keep the Bridge running and they stay available; turn it off someday and the app falls back to Wi-Fi-only basic control gracefully.

连不上?先确认三件事:① 容器是用 --network host 跑的(桥接网络发现不到 Sonos);② Bridge 机器和 Sonos、你的 iPhone 在同一个局域网、同一网段;③ 机器防火墙没挡住本地发现。三样齐了,自动发现基本都能成。連不上?先確認三件事:① 容器是用 --network host 跑的(橋接網絡發現不到 Sonos);② Bridge 機器和 Sonos、你的 iPhone 在同一個區域網、同一網段;③ 機器防火牆沒有擋住本地發現。三樣齊全,自動發現基本都能成功。Can't connect? Check three things: ① the container runs with --network host (bridge networking can't discover Sonos); ② the Bridge machine, your Sonos and your iPhone are on the same LAN and subnet; ③ the machine's firewall isn't blocking local discovery. With all three in place, auto-discovery almost always works.