|
本帖最后由 mstsc 于 2019-10-27 17:28 编辑 . z' h, }. t' P
: K; a9 ?" W! z' w6 r+ F2 \' k% x& ~ @
之前安装了domoticz和mqtt,现在安装homebridge实现siri控制0 e5 z4 ]% s! v0 J9 O2 R9 t5 s8 b
猫盘群晖安装domoticz和mqtt实现智能家居控制7 j, f" o2 C5 p" `& G: o
准备工作( j# B n7 ]. L: Q* ?
群晖套件中心安装Node.js v89 b- @4 l% C# j5 N+ s5 f" O5 L% P
, k" F7 s3 V2 L9 v* n# L7 ?
安装bootstrap
, F- o8 b6 C5 x9 o* u! A, A& r. l: W$ u8 a, m
- sudo -i T; Z' P& C1 z2 c0 a! `
- cd /volume1/@tmp2 @' H& H. H' y3 L, o* t. E) q" A2 t
- /usr/bin/wget http://ipkg.nslu2-linux.org/optware-ng/bootstrap/buildroot-armeabihf-bootstrap.sh$ K. H! t0 K* `: X8 f" g
- chmod +x /volume1/@tmp/buildroot-armeabihf-bootstrap.sh
- t' ?- \9 Q; ^3 H+ L9 L6 R - /volume1/@tmp/buildroot-armeabihf-bootstrap.sh
7 U2 }* \( r" W; |, I+ ~" c, @: [ - export PATH=$PATH":/opt/bin" //添加环境变量
复制代码 继续
* Z/ B4 t3 ]) J2 \. ~1 S- ipkg update2 B# H9 {0 N2 J! c- q* e0 R
- ipkg install gcc- r# O9 z& O$ X# t5 b
- ipkg install automake2 W5 G# Z h6 ^6 Q; x9 u
- ipkg install dbus8 R" B9 k: }6 K. h8 i
- ipkg install avahi3 z- k4 n X3 `+ K" o. g ?
- ipkg install nano
复制代码
( M7 i# D$ ^$ z& L# V$ s, F) R安装homebridge和edomoticz插件
% o6 ~ Z; K3 G. {- cd /volume1/@appstore/Node.js_v8/usr/local/bin$ m7 P4 q; s. @( u( [% o: u
- npm install -g npm
5 y9 v, l( c4 f3 P, n - npm install -g --unsafe-perm homebridge1 P1 K9 \* [( p1 B" Z0 z. v
- npm install -g homebridge-edomoticz
复制代码 . p9 O1 U$ N7 ^6 |0 n6 _2 S7 m I
配置domoticz2 Z% S) H3 t2 Y' @6 T% r, N5 p
在 Domoticz 中添加房间区域,点设置 → 更多选项 → 平面图/区域图 → 房间区域,添加一个“客厅”,记录客厅的IDX,并在客厅中添加开关; j* x: Y( C2 P) b& |4 ~1 n" D
7 k# U1 ~, H# s& t* j! \! M F
配置homebridge6 j2 Q- M$ x, W1 {# z: [- ]
- touch /root/.homebridge/config.json //创建配置文件5 c: ]9 K( k ~0 U$ L) n
- nano /root/.homebridge/config.json //修改配置文件,添加以下内容
复制代码 {
5 \2 M9 a2 d F9 h8 e7 _ "bridge": {
8 @7 B$ A* B/ A, I+ ]2 s1 P "name": "Homebridge",
3 O) B2 n( M9 y' f- f; ? "username": "CC:22:3D:E3:CE:30",
+ [7 n E6 W! E2 N, |! x# h "port": 51826,( e" S/ N3 I8 k5 n
"pin": "031-45-154" ~" \0 h4 Y! X$ D+ R3 h2 Z M
},) J2 B$ F/ H6 J& Y
"description": "Configuration file for (e)xtended Domoticz platform.",# W# O+ e0 l& S, y
"platforms": [
# g. O a' |6 b; b6 Z( |+ p e$ l {8 w0 M1 Y& Q. N% s
"platform": "eDomoticz",
2 P' |" }$ k& V y, ?* y "name": "eDomoticz",
% [% M2 ~8 Z% J7 l% W0 U "server": "127.0.0.1",( t+ q }8 ]6 I4 O) `! ^2 t7 e
"port": "8000",
8 e% i4 i! e0 t' Y "ssl": 0,4 ?9 m0 D6 Q- h/ g' K9 {4 c
"roomid": 2,
9 ? J5 W9 S4 R/ } "mqtt": 1,' f* M$ t7 ^7 ? {- Z8 u
"excludedDevices": [, U, I) y: O# }$ A, R' y& j
10 H1 P" Z" o6 |4 ?( |% p) v& [
]3 S4 d$ h6 X C% B% N
}
! Y$ g+ O+ z% x% n& B. f ],
. \* Q# I: n% |: N' c1 N "accessories": []2 k$ q" Y+ H6 k
}
: X4 {# @6 E- ]* f) p }) x! C& F- o* U A/ W
运行homebridge
. L, U( Q) A" a5 h* m7 t+ A* s- /volume1/@appstore/Node.js_v8/usr/local/bin/homebridge
复制代码 打开iphone—家庭—添加扫码即可,siri就可以控制开关了
$ D& n; N1 X, ^3 A- G L% W |
评分
-
查看全部评分
|