- 积分
- 364
- 金钱
- 323
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 364
- 金钱
- 323
- HASS币
- 0
|
本帖最后由 HeroYu920 于 2018-5-7 23:33 编辑
1. 下载Docker镜像
首先,登入您的Synology DSM,打开Docker并从注册表中下载:marcoraddatz / homebridge。
2. 准备脚本
通过DSM File Station创建一个文件夹/volume1/docker/ homebridge,并将config.json和package.json或install.sh(推荐)放在那里。 如果您想开发自己的插件或调试Homebridge,请复制.env文件。
下面是两个设置文件的示例:
package.json
{
"name": "DiskStationHomeBridge",
"description": "HomeKit support for the impatient.",
"version": "0.1.1",
"license": "ISC",
"dependencies": {
"homebridge-harmonyhub": "0.2.0-alpha",
"homebridge-netatmo": "^0.0.4",
"homebridge-nukiio": "^0.0.3",
"homebridge-synology": "^0.1.0"
}
}
install.sh
#!/bin/bash
npm install -gs homebridge-harmonyhub
npm install -gs homebridge-netatmo
npm install -gs homebridge-nukiio
npm install -gs homebridge-synology
以下是我的config.json文件
{
"bridge": {
"name": "Homebridge",
"username": "00:00:00:00:00:00",
"port": 51826,
"pin": "478-00-730"
},
"platforms": [
{
"platform": "HomeAssistant",
"name": "HomeAssistant",
"host": "http://192.168.123.208:8123",
"password": "",
"supported_types": ["fan", "binary_sensor", "sensor", "garage_door", "input_boolean", "light", "lock", "media_player", "rollershutter", "scene", "switch"]
}
]
}
3. 启动Docker容器
链接/volume1/docker/homebridge到/root/.homebridge,否则,配置文件将不会被加载(在DSM内,路径只显示为/docker/homebridge。
下面是填坑时间,上述操作后会出现
[size=0.875]Error: The requested platform 'HomeAssistant' was not registered by any plugin. stdout
[size=0.875]
Docker会意外终止的问题:
在终端机里新增-通过命令启动-输入sh
输入: npm install -g homebridge-homeassistant 回车即可解决问题
|
|