先安装插件
sudo npm install -g homebridge-mqttswitch然后把我的附件解压替换到homebridge-mqttswitch里面去,也就是替换index.js 一般安装的路径就在/usr/lib/node_modules/ 如果不是自己找
{
"bridge": {
"name": "Hass1",
"username": "B5:57:BD:43:FA:4E",
"port": 51988,
"pin": "123-11-678"
},
"accessories": [
{
"accessory": "mqttswitch",
"name": "Desk Lamp",
"type": "outlet",
"url": "mqtt://192.168.1.200:1883",
"username": "pi",
"password": "raspberry",
"caption": "Office Light",
"topics": {
"statusGet": "home/Bed_room/6/stat",
"statusSet": "home/Bed_room/6"
},
"onValue": "on",
"offValue": "off"
}
]
}
type: 可以是outlet switch lightbulb ,分别对于插座 开关 灯泡
|