iobroker–mqtt DC1接入homekit

毛主席曾說過“吃水不忘挖井人”,這可不?感謝萝卜和各位大神帶我入iobroker坑
这“坑”可浅呀~~~又是HA又是IOB又是NR :dizzy_face: :dizzy_face: :dizzy_face:,越玩越“深”,可谓是玩得出(zhan)神(dian)入(pi)化(mao) :yum:
今天刚收到超级好心网友“帮买帮刷”的斐讯遗产——DC1排插
下面秀出“DC1”排插本体了,

  • 1个总开关、
  • 3个国产插孔(带独立开关)、
  • 4个USB普通充电口…
    性价比杠杆的~

废话不多讲,接下来直奔“煮”题 :see_no_evil: :see_no_evil: :see_no_evil:
本文主要阐述“iobroker–mqtt DC1接入homekit ”的方式方法

前提条件

  • 动手能力 x1
  • 已刷好mqtt 排插 x1(或若干)
  • mqtt服务器已搭建 x1
  • 安卓手机或安卓模拟器 x1
  • iobroker智能家居系统平台 x1

接入教程
前往iobroker 平台 ip:8081,在左侧的菜单栏,点击“适配器”,然后点击‘切换“老司机”模式’(专家模式模式),在筛选框框内搜索“ham” 回车 然后点击 加号,添加下载ham插件,详细见下图

配置ham插件,主要有4点

  • Homebridge适配器模式,选择本地模式
  • 添加额外的npm模块:homebridge-mqtt-zdc1
  • 勾选从npm更新
  • 填写配置文件


配置文件详细参数(部分参数,依自己情况修改)
{
“bridge”: {
“name”: “HBDimmer_test”,
“username”: “88:00:00:00:00:8”,
“port”: 59000,
“pin”: “888-88-888”
},
“accessories”: [
{
“accessory”: “phicommdc1”,
“name”: “斐讯排插”,
“model”:“phicomm_dc1”,
“manufacturer”:“phicomm”,
“serial”:“hassbian-ABC”,
“mac”: “xxxxxxxxxxxxx”,
“url”: “mqtt://10.0.0.50:1883”,
“username”: “iob”,
“password”: “Password123”
}
]
}
或者前往DC1配置文件模板 参照配置文件进行修改

最后保存且关闭,重启插件就 OK 了。(重启后的状态变成绿色开始按钮)


iobroker的配置就到这里了就完成了

HomeKit配置

  1. 打开Homekit家庭
  2. 点击右上角“+”加入或掃描配件
  3. 点击‘我没有代码或者无法扫描’
  4. 选择“相对应的桥”
  5. 点击“仍然添加”
  6. 输入配置文件中设定好的Pin码
  7. 成功识别DC1配件
  8. 点击“下一步”
  9. 最后就完成了~~~

详见下图

接入就是那么简单~~~
DC1还可以接入Home Assistant呢,还想折腾的大佬可以前往
homeassistant接入DC1排插 地址继续折腾~~~ :ghost: :ghost: :ghost:

附上本人的DC1接入Home Assistant的效果图,让大家笑纳了 :crazy_face: :crazy_face: :crazy_face:

总结
写帖子真累,完~~~ :sleepy: :sleepy: :sleepy:

zDC1前今天刚更新1.0.0版本
v1.0.0及之后的版本 与之前的版本通信协议不一样 应该不能共用 这个应该对应1.0.0版本吧?
所以配置的时候注意下固件版本

我查看了下DC1的固件是1.0.0版本 :sweat_smile: :sweat_smile: :sweat_smile: @a2633063 zip大佬?

没有玩三木大神的固件呀

恭喜恭喜,HB的插件已经更新了,1.0的固件更新后我就请abcdefg大佬更新了HB的插件 :sweat_smile:

刷入mqtt固件版本可以接入iob吧?

DC1固件1.0.0版本 目前abc大佬的固件还可以正常使用呀

没有三木大佬的固件,我为了统一,之前3个TC1都是用的zip大佬的固件,所以DC1也用了Zip大佬的固件 :sweat_smile: :sweat_smile: :sweat_smile:

:+1: 可以说明下 旧版本不能使用的…

大佬,还能联系上那个超级好心网友吗?我买了个a1的插排,还需要买个烧录器 :joy:想一步到位的

1 扫地机可以正确使用了,可是DC1开关控制排插没反应?

看看mac地址 mqtt账号信息是否正确? :slightly_smiling_face:

mac后面的“:”是英文,不是中文

ham.0 2020-04-05 00:10:03.902 info npm install homebridge-mqtt-zdc1 --production --prefix “/opt/iobroker/node_modules/iobroker.ham” (System call)
ham.0 2020-04-05 00:10:03.902 info Install/Update homebridge-mqtt-zdc1
ham.0 2020-04-05 00:10:03.901 info Install/Update the following Libraries: homebridge-mqtt-zdc1
ham.0 2020-04-05 00:10:03.839 info found 0 vulnerabilities
ham.0 2020-04-05 00:10:03.834 info + homebridge@0.4.50 updated 1 package and audited 7056 packages in 41.971s
ham.0 2020-04-05 00:09:46.727 info WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
ham.0 2020-04-05 00:09:46.725 info npm
ham.0 2020-04-05 00:09:18.464 info npm install homebridge@0.4.50 --production --prefix “/opt/iobroker/node_modules/iobroker.ham” (System call)
ham.0 2020-04-05 00:09:18.462 info Need to install/update homebridge@0.4.50
ham.0 2020-04-05 00:09:18.406 info starting. Version 1.1.2 in /opt/iobroker/node_modules/iobroker.ham, node: v8.16.0
host.aml 2020-04-05 00:09:17.074 info instance system.adapter.ham.0 started with pid 4922
host.aml 2020-04-05 00:09:17.060 info object change system.adapter.ham.0
host.aml 2020-04-05 00:09:15.084 info Restart adapter system.adapter.ham.0 because enabled
host.aml 2020-04-05 00:09:15.083 error instance system.adapter.ham.0 terminated with code 0 (OK)
Caught 2020-04-05 00:09:15.083 error by controller[2]: at writeOrBuffer (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:227:5)
Caught 2020-04-05 00:09:15.083 error by controller[2]: at doWrite (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:237:10)
Caught 2020-04-05 00:09:15.083 error by controller[2]: at Writable.writable._write (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/lib/client.js:248:5)
Caught 2020-04-05 00:09:15.082 error by controller[2]: at process (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/lib/client.js:238:12)
Caught 2020-04-05 00:09:15.082 error by controller[2]: at MqttClient._handlePacket (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/lib/client.js:282:12)
Caught 2020-04-05 00:09:15.082 error by controller[2]: at MqttClient._handlePublish (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/lib/client.js:792:12)
Caught 2020-04-05 00:09:15.082 error by controller[2]: at MqttClient.emit (events.js:217:7)
Caught 2020-04-05 00:09:15.081 error by controller[2]: at emitThree (events.js:136:13)
Caught 2020-04-05 00:09:15.081 error by controller[2]: at MqttClient. (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-mqtt-zdc1/index.js:81:17)
Caught 2020-04-05 00:09:15.081 error by controller[2]: at JSON.parse ()
Caught 2020-04-05 00:09:15.081 error by controller[2]: SyntaxError: Unexpected end of JSON input
Caught 2020-04-05 00:09:15.080 error by controller[1]: [2020-4-5 00:09:11] Plugin /opt/iobroker/node_modules/homebridge-plugin-wrapper package.json does not contain the keyword ‘homebridge-plugin’.
Caught 2020-04-05 00:09:15.079 error by controller[0]: [2020-4-5 00:09:10] Plugin /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper package.json does not contain the keyword ‘homebridge-plugin’.
mqtt.0 2020-04-05 00:09:15.073 info Client [mqttjs_eb5bb167] connection closed: closed
ham.0 2020-04-05 00:09:14.846 warn Exception: SyntaxError: Unexpected end of JSON input
ham.0 2020-04-05 00:09:14.827 info cleaned everything up…
ham.0 2020-04-05 00:09:14.824 error at writeOrBuffer (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:227:5)
ham.0 2020-04-05 00:09:14.824 error at doWrite (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:237:10)
ham.0 2020-04-05 00:09:14.824 error at Writable.writable._write (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/lib/client.js:248:5)
ham.0 2020-04-05 00:09:14.824 error at process (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/lib/client.js:238:12)
ham.0 2020-04-05 00:09:14.824 error at MqttClient._handlePacket (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/lib/client.js:282:12)
ham.0 2020-04-05 00:09:14.824 error at MqttClient._handlePublish (/opt/iobroker/node_modules/iobroker.ham/node_modules/mqtt/lib/client.js:792:12)
ham.0 2020-04-05 00:09:14.824 error at MqttClient.emit (events.js:217:7)
ham.0 2020-04-05 00:09:14.824 error at emitThree (events.js:136:13)
ham.0 2020-04-05 00:09:14.824 error at MqttClient. (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-mqtt-zdc1/index.js:81:17)
ham.0 2020-04-05 00:09:14.824 error at JSON.parse ()
ham.0 2020-04-05 00:09:14.824 error SyntaxError: Unexpected end of JSON input
ham.0 2020-04-05 00:09:14.823 error uncaught exception: Unexpected end of JSON input
ham.0 2020-04-05 00:09:14.361 info updateState 斐讯排插.斐讯排插s3.Name: value = /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.360 info updateState 斐讯排插.斐讯排插s3.Outlet-In-Use: value = false /common= {“type”:“boolean”,“read”:true,“write”:false,“role”:“sensor”,“name”:“Outlet In Use”,“unit”:""}
ham.0 2020-04-05 00:09:14.360 info updateState 斐讯排插.斐讯排插s3.On: value = false /common= {“type”:“boolean”,“read”:true,“write”:true,“role”:“switch”,“name”:“On”,“unit”:""}
ham.0 2020-04-05 00:09:14.359 info updateState 斐讯排插.斐讯排插s3.Name: value = 斐讯排插s3 /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.358 info updateChannel 斐讯排插.斐讯排插s3: name = 斐讯排插s3
ham.0 2020-04-05 00:09:14.357 info updateState 斐讯排插.斐讯排插s2.Name: value = /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.357 info updateState 斐讯排插.斐讯排插s2.Outlet-In-Use: value = false /common= {“type”:“boolean”,“read”:true,“write”:false,“role”:“sensor”,“name”:“Outlet In Use”,“unit”:""}
ham.0 2020-04-05 00:09:14.356 info updateState 斐讯排插.斐讯排插s2.On: value = false /common= {“type”:“boolean”,“read”:true,“write”:true,“role”:“switch”,“name”:“On”,“unit”:""}
ham.0 2020-04-05 00:09:14.355 info updateState 斐讯排插.斐讯排插s2.Name: value = 斐讯排插s2 /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.355 info updateChannel 斐讯排插.斐讯排插s2: name = 斐讯排插s2
ham.0 2020-04-05 00:09:14.354 info updateState 斐讯排插.斐讯排插s1.Name: value = /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.353 info updateState 斐讯排插.斐讯排插s1.Outlet-In-Use: value = false /common= {“type”:“boolean”,“read”:true,“write”:false,“role”:“sensor”,“name”:“Outlet In Use”,“unit”:""}
ham.0 2020-04-05 00:09:14.353 info updateState 斐讯排插.斐讯排插s1.On: value = false /common= {“type”:“boolean”,“read”:true,“write”:true,“role”:“switch”,“name”:“On”,“unit”:""}
ham.0 2020-04-05 00:09:14.352 info updateState 斐讯排插.斐讯排插s1.Name: value = 斐讯排插s1 /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.351 info updateChannel 斐讯排插.斐讯排插s1: name = 斐讯排插s1
ham.0 2020-04-05 00:09:14.350 info updateState 斐讯排插.斐讯排插.Name: value = /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.350 info updateState 斐讯排插.斐讯排插.Outlet-In-Use: value = false /common= {“type”:“boolean”,“read”:true,“write”:false,“role”:“sensor”,“name”:“Outlet In Use”,“unit”:""}
ham.0 2020-04-05 00:09:14.349 info updateState 斐讯排插.斐讯排插.On: value = false /common= {“type”:“boolean”,“read”:true,“write”:true,“role”:“switch”,“name”:“On”,“unit”:""}
ham.0 2020-04-05 00:09:14.348 info updateState 斐讯排插.斐讯排插.Name: value = 斐讯排插 /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.347 info updateChannel 斐讯排插.斐讯排插: name = 斐讯排插
ham.0 2020-04-05 00:09:14.346 info updateState 斐讯排插.Accessory-Information.Accessory-Flags: value = 0 /common= {“type”:“number”,“min”:0,“max”:4294967295,“read”:true,“write”:false,“role”:“value”,“name”:“Accessory Flags”,“unit”:""}
ham.0 2020-04-05 00:09:14.345 info updateState 斐讯排插.Accessory-Information.Hardware-Revision: value = /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Hardware Revision”,“unit”:""}
ham.0 2020-04-05 00:09:14.345 info updateState 斐讯排插.Accessory-Information.Firmware-Revision: value = 1.0 /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Firmware Revision”,“unit”:""}
ham.0 2020-04-05 00:09:14.344 info updateState 斐讯排插.Accessory-Information.Serial-Number: value = hassbian-ABC /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Serial Number”,“unit”:""}
ham.0 2020-04-05 00:09:14.343 info updateState 斐讯排插.Accessory-Information.Name: value = 斐讯排插 /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Name”,“unit”:""}
ham.0 2020-04-05 00:09:14.342 info updateState 斐讯排插.Accessory-Information.Model: value = phicomm_dc1 /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Model”,“unit”:""}
ham.0 2020-04-05 00:09:14.341 info updateState 斐讯排插.Accessory-Information.Manufacturer: value = phicomm /common= {“type”:“string”,“read”:true,“write”:false,“role”:“text”,“name”:“Manufacturer”,“unit”:""}
ham.0 2020-04-05 00:09:14.340 info updateState 斐讯排插.Accessory-Information.Identify: value = false /common= {“type”:“boolean”,“read”:false,“write”:true,“role”:“button”,“name”:“Identify”,“unit”:""}
ham.0 2020-04-05 00:09:14.335 info updateChannel 斐讯排插.Accessory-Information: name = undefined
ham.0 2020-04-05 00:09:14.331 info updateDev 斐讯排插: name = 斐讯排插 /type= 1
mqtt.0 2020-04-05 00:09:14.727 info Client [mqttjs_eb5bb167] publishOnSubscribe
mqtt.0 2020-04-05 00:09:14.726 info Client [mqttjs_eb5bb167] subscribes on “mqtt.0.device.zdc1.84f3ebbaad13.state”
ham.0 2020-04-05 00:09:09.153 info All Libraries installed/updated
ham.0 2020-04-05 00:09:09.152 info Install/Update homebridge-mqtt-zdc1
ham.0 2020-04-05 00:09:09.151 info Install/Update the following Libraries: homebridge-mqtt-zdc1
ham.0 2020-04-05 00:09:09.147 info Need to install/update homebridge@0.4.50
mqtt.0 2020-04-05 00:09:14.643 info Client [mqttjs_eb5bb167] connected with secret 1586016554556_1033
ham.0 2020-04-05 00:09:09.093 info starting. Version 1.1.2 in /opt/iobroker/node_modules/iobroker.ham, node: v8.16.0
host.aml 2020-04-05 00:09:07.661 info instance system.adapter.ham.0 started with pid 4888

把日志贴出来了,这是错误在哪里呀?

请问这个还需要域名劫持吗?

不需要域名劫持,我是直接刷机的

你好,这个是刷的哪个大神的固件呢