Cov txheej txheem:

Nruab Homebridge ntawm Raspberry Pi thiab Windows: 9 Cov Kauj Ruam
Nruab Homebridge ntawm Raspberry Pi thiab Windows: 9 Cov Kauj Ruam

Video: Nruab Homebridge ntawm Raspberry Pi thiab Windows: 9 Cov Kauj Ruam

Video: Nruab Homebridge ntawm Raspberry Pi thiab Windows: 9 Cov Kauj Ruam
Video: Yasmi - Faus Rau Nruab Siab 2024, Hlis ntuj nqeg
Anonim
Nruab Homebridge ntawm Raspberry Pi thiab Windows
Nruab Homebridge ntawm Raspberry Pi thiab Windows

Cov ntawv qhia no yog rau cov tib neeg uas xav teeb tsa Homebridge ntawm Raspberry Pi thiab Windows.

Thaum pib, phau ntawv qhia no tau sau ua lus Portuguese ntawm no hauv Brazil. Kuv sim kuv qhov zoo tshaj plaws los sau ua lus Askiv. Yog li thov zam txim rau kuv qee qhov yuam kev uas tej zaum yuav tau sau.

Cov lus qhia no tau faib raws li hauv qab no:

Kauj Ruam 1: Homekit yog dab tsi?

Kauj Ruam 2: Homebridge yog dab tsi?

Kauj Ruam 3: Txhim Kho Homebridge ntawm Raspberry Pi

Kauj Ruam 4: Pib Homebridge ntawm Raspbian Boot

Kauj Ruam 5: Txhim Kho Homebridge Config UI X Plugin (Raspberry Pi)

Kauj Ruam 6: Txhim Kho Homebridge ntawm Windows

Kauj Ruam 7: Txhim Kho Homebridge Config UI X Plugin (Windows)

Kauj Ruam 8: Pib Homebridge nrog Windows

Kauj Ruam 9: Txuas Homebridge rau Tsev app

Kauj Ruam 1: Homekit yog dab tsi?

Homekit yog pob txhim kho los ntawm Apple rau cov tsim tawm los tsim Internet ntawm Yam (IoT) cov kev daws teeb meem. Qhov kev txhim kho pob no ua rau Apple ua cov cuab yeej siv (iPhone thiab iPad, piv txwv) los tswj hwm lwm cov khoom siv, xws li cov teeb lossis cov ntaub ntawv ntsuas. Los ntawm iOS 9 thiab Saib OS Homekit tau dhau los ua cov cuab yeej ib txwm muaj, thiab vim txhua lub tshuab siv los ntawm Apple nws muaj peev xwm los tsim cov tshuab siv tshuab yooj yim nrog cov khoom siv no.

Txhawm rau txheeb xyuas cov cuab yeej Homekit-sib xws uas tau ua haujlwm ntawm lub network thiab teeb tsa thiab tswj cov cuab yeej no, koj yuav tsum muaj Lub Tsev app teeb tsa ntawm ib qho khoom siv Apple (iPhone, iPad, iPod kov, Apple Watch, Apple TV, HomePod, lossis Mac). Cov cuab yeej siv ua ke nrog Tsev app tuaj yeem muaj QR code uas tso cai ua khub nrog Tsev app ntawm koj lub Apple ntaus ntawv.

Tom qab teeb tsa lub cuab yeej hauv Tsev app, tus neeg siv tuaj yeem tswj lub cuab yeej los ntawm kev luv luv uas tau tsim los ntawm lub vijtsam tseem ceeb ntawm lub app lossis siv Siri (lub suab pab los ntawm Apple) thiab xa lub suab hais kom ua rau lub cuab yeej.

Apple kho vajtse thiab software xav tau rau Homekit siv yog:

- iPhone, iPad, lossis iPod kov (khiav iOS 10 lossis tom qab);

- Apple Watch (khiav WatchOS 3 lossis tom qab);

- Apple TV (tiam 4);

- Apple HomePod;

- Macs (khiav macOS 10.14 Mojave lossis tom qab);

Thaum nws los txog rau kev siv tshuab hauv tsev thiab IoT, muaj ntau qhov kev daws teeb meem tus nqi ntawm kev ua lag luam, txawm li cas los xij, feem coob tsis yog Apple-ntawv pov thawj thiab yog li ntawd tsis yog ib txwm sib xws nrog Homekit. Yog tias koj nkees nkees tos Apple kom lees paub cov kev daws teeb meem no rau siv nrog Homekit, koj yuav tsum siv Homebridge.

Kauj Ruam 2: Homebridge yog dab tsi?

Tsim los ntawm Nick Farina, Homebridge yog NodeJS server uas ua raws Homekit API thiab ua rau nws muaj peev xwm siv tsis-Apple ntawv pov thawj khoom siv nrog Lub Tsev app thiab Siri. Tus neeg rau zaub mov yog lub teeb yuag, tuaj yeem ua haujlwm ntawm lub tsev sib txuas thiab yog hloov pauv, txhais tau tias nws txhawb nqa ntau lub plugins tsim thiab ua kom muaj los ntawm cov zej zog tsis tshua muaj neeg txhawb nqa lub cuab yeej.

Cov plugins tau teeb tsa ntawm Homebridge thiab feem ntau ntawm lawv tau npaj los ua Homekit sib xws nrog cov khoom siv uas tsis yog Apple. Plugins rau siv nrog Homebridge tau teeb tsa ncaj qha los ntawm NPM lub vev xaib.

Kev teeb tsa Homebridge tuaj yeem ua tiav ntawm ntau lub tshuab, txawm li cas los xij, rau qhov kev qhia no yuav siv Raspberry Pi 3 Qauv B + khiav Raspbian kev ua haujlwm, thiab kuv tseem yuav piav qhia yuav ua li cas rau nruab rau ntawm Windows.

Kauj Ruam 3: Txhim Kho Homebridge ntawm Raspberry Pi

Qhov zoo tshaj, Homebridge yuav tsum muaj txhua lub sijhawm koj xav tau, yog li koj yuav tsum tawm ntawm lub server khiav 24/7. Txog qhov no koj tuaj yeem teeb tsa tus neeg rau zaub mov ntawm Raspberry Pi thiab ua haujlwm tas li ntawm koj lub tsev network.

Yog tias koj tsis muaj Raspbian teeb tsa thiab teeb tsa ntawm daim npav nco, Kuv pom zoo kom koj nyeem Cov Lus Qhia Nruab thiab teeb tsa Raspbian ntawm Raspberry Pi, ua raws cov theem hauv qab no thiab tom qab ntawd rov qab mus txuas ntxiv.

Nrog koj Raspberry Pi khiav Raspbian, hauv qhov system tsev tshuaj ntsuam qhib lub davhlau ya nyob twg:

Duab
Duab
Duab
Duab

Ntawm lub davhlau ya nyob twg, ntaus thawj lo lus txib hauv qab no, nias nkag mus, thiab yog tias tau txais kev pom zoo kom lees paub hom kev ua Y thiab nias nkag mus. Hom kev lees paub no feem ntau tshwm thaum tshem tawm lossis teeb tsa pob khoom. Tom qab ntawv ntaus ob lo lus txib, nkag mus, lees paub cov lus txib yog hais kom sai, thiab tos. Cov lus txib no tshuaj xyuas thiab hloov kho kab ke yog tias tsim nyog:

sudo apt-tau hloov tshiab

sudo apt-tau hloov tshiab

Ntaus cov lus txib hauv qab no ntawm lub davhlau ya nyob twg thiab ntaus nkag:

ifconfig

Qee cov ntaub ntawv yuav raug xa rov qab. Yog tias koj siv lub network cable los muab kev sib txuas network rau koj li Raspberry Pi, mus rau cov ntaub ntawv tom qab "eth0:" thiab saib rau yim-tus lej network card's MAC chaw nyob thiab nws yuav yog tom qab lo lus "ether" Yog tias koj tab tom siv Wi-nkaus txuas mus rau lub network txuas rau koj daim npav, mus rau cov ntaub ntawv ib feem tom qab "wlan0:" thiab nrhiav MAC chaw nyob ntawm yim-tus lej daim npav network uas tseem yuav tom qab lo lus "ether":

Duab
Duab
Duab
Duab

Luam yim tus lej MAC chaw nyob rau koj daim npav network thiab khaws nws hauv Notepad, vim qhov chaw nyob no yuav xav tau tom qab.

Raws li kuv tau tshaj tawm ua ntej, Homebridge yog NodeJS server thiab cov plugins rau nws tau teeb tsa ncaj qha los ntawm NPM qhov chaw. Raspbian feem ntau tuaj nrog NodeJS thiab NPM pob khoom teeb tsa, txawm li cas los xij, tej zaum yuav muaj qhov tsis sib xws ntawm cov ntawv ntawm ob pob, yog li nws yog qhov zoo tshaj rau tshem tawm ob qho kev teeb tsa thiab tom qab ntawd rov nruab dua.

Txhawm rau tshem tawm NPM, ntaus cov lus txib hauv qab no ntawm lub davhlau ya nyob twg, nkag mus, lees paub cov lus txib yog hais kom sai, thiab tos kom tshem tawm pob kom tiav:

sudo apt --auto-tshem tawm tshem tawm npm

Txhawm rau tshem tawm NodeJS, ntaus cov lus txib hauv qab no ntawm lub davhlau ya nyob twg, nkag mus, paub meej tias cov lus txib yog hais kom sai, thiab tos kom tshem tawm pob kom tiav:

sudo apt --auto-tshem tawm tshem tawm nodejs

Tom qab tshem NodeJS thiab NPM, peb tuaj yeem npaj rau nruab pob tshiab. Txhawm rau nruab NodeJS, ntaus cov lus txib hauv qab no rau hauv lub davhlau ya nyob twg, nkag mus, lees paub cov lus txib yog hais kom sai, thiab tos rau pob teeb tsa ua kom tiav:

sudo apt nruab nodejs

Txhawm rau nruab NPM, ntaus cov lus txib hauv qab no rau hauv lub davhlau ya nyob twg, nkag mus, lees paub cov lus txib yog tias tau hais kom sai, thiab tos kom lub pob teeb tsa ua tiav:

curl -L https://www.npmjs.com/install.sh | sudo sh ib

Ntaus txhua cov lus txib hauv qab no thiab nias sau tom qab txhua qhov kom paub meej tias kev teeb tsa pob tau ua tiav. Cov lus txib no xa rov qab cov version ntawm txhua pob uas nyuam qhuav tau teeb tsa:

node -v

npm -v

Nruab Avahi thiab nws qhov kev cia siab. Nkag mus rau cov lus txib hauv qab no, nkag mus, lees paub cov lus txib yog hais kom ua, thiab tos kom kev teeb tsa ua tiav:

sudo apt-tau nruab libavahi-compat-libdnssd-dev

Tom qab cov txheej txheem no tiav peb tuaj yeem teeb tsa Homebridge. Nkag mus rau cov lus txib hauv qab no, nkag mus, lees paub cov lus txib yog hais kom ua, thiab tos kom kev teeb tsa ua tiav:

sudo npm nruab -g -tsis muaj kev nyab xeeb -perm homebridge

Tom qab ntawv ntaus cov lus txib hauv qab no thiab ntaus nkag mus rau khau raj Homebridge:

tsev

Homebridge yuav xa qee cov ntaub ntawv:

Duab
Duab

1) Cov ntaub ntawv config.json tsis pom los ntawm Homebridge. Cov ntaub ntawv no muab cov kev teeb tsa yooj yim rau kev khiav Homebridge thiab ib qho teeb tsa plugins. Tom qab ntawd peb yuav tsim cov ntawv config.json thiab nws cov chaw.

2) Tsis muaj plugins ntsia. Homebridge tsis muaj plugins teeb tsa yog siv tsis tau kiag li.

Duab
Duab

3) Txhawm rau txuas cov cuab yeej rau Tsev app koj tuaj yeem nyeem QR code uas muab cov ntaub ntawv koj xav tau rau khub. Txij li cov ntaub ntawv config.json tsis tau tsim thiab teeb tsa, thiab tsis muaj lub plugin teeb tsa, tam sim no QR code tsis zoo, txawm hais tias hauv Tsev app koj yuav muaj peev xwm pom Homebridge muaj rau txuas, tab sis tsis ua.

4) Lwm txoj hauv kev los txuas cov cuab yeej rau Lub Tsev app yog los ntawm "Ntxiv Cov Khoom Siv", "Kuv Tsis Muaj Tus lej lossis Tsis tuaj yeem luam theej duab" xaiv, thiab hauv qab "Cov Khoom Siv Nyob ze" lub cuab yeej raug xaiv thiab tom qab ntawd koj yuav raug ceeb toom rau teeb teeb. Nco ntsoov tias lub davhlau ya nyob twg tau qhia tus lej lej lej thiab yuav tsum tau nkag mus kom haum rau daim ntawv thov.

Tom qab ntawv koj tuaj yeem siv tus lej QR lossis tus lej lej tus lej los txuas Homebridge mus rau Lub Tsev app ntawm koj lub Apple ntaus ntawv.

Nias lub CTRL + C yuam sij ntawm lub davhlau ya nyob twg kom Homebridge kaw thiab cov lus "Tau SIGINT, kaw Homebridge …" yuav rov qab los.

Txhawm rau tsim cov ntaub ntawv config.json ntaus cov lus txib hauv qab no hauv lub davhlau ya nyob twg thiab nias sau. Cov ntaub ntawv khoob yuav qhib:

sudo nano ~/.homebridge/config.json

Rub cov ntawv hauv qab no. Qhib cov ntawv no, luam cov ntsiab lus thiab muab tso rau hauv cov ntawv uas tau qhib hauv lub davhlau ya nyob twg:

ntawv 01

Duab
Duab

1) Hauv "username" rho tawm ntu XX: XX: XX: XX: XX: XX thiab nkag mus rau yim tus lej MAC chaw nyob ntawm daim npav network uas koj tau sau tseg yav tas los. Cov ntawv ntawm qhov chaw nyob koj yuav tsum yog txhua tus ntawv loj.

2) Hauv "tus pin" koj tuaj yeem khaws yim tus lej lossis koj tuaj yeem hloov pauv mus rau ntu uas koj xav tau, nco ntsoov khaws tib hom kev sib cais nrog cov cim. Qhov no yuav yog tus lej koj yuav tsum nkag mus thaum lub sijhawm koj txuas Homebridge mus rau Home app.

Lwm cov ntaub ntawv cov ntaub ntawv koj tuaj yeem khaws tau, zoo li koj ntxiv cov plugins thiab khoom siv ntxiv koj tuaj yeem nkag mus rau cov ntaub ntawv xav tau.

Txhawm rau khaws cov ntawv kho kom raug nyem CTRL + O, nias nkag mus thiab tom qab ntawd CTRL + X kom kaw cov ntawv.

Kauj Ruam 4: Pib Homebridge ntawm Raspbian Boot

Pib Homebridge manually txhua lub sijhawm koj qhib koj li Raspberry Pi tsis muaj txiaj ntsig, yog li nws yog qhov zoo tshaj kom cov neeg rau zaub mov khiav tam sim tom qab Raspbian pib.

Ntaus cov lus txib hauv qab no ntawm lub davhlau ya nyob twg thiab ntaus nkag. Cov ntaub ntawv khoob yuav qhib:

sudo nano/etc/default/homebridge

Rub cov ntawv hauv qab no. Qhib cov ntawv no, luam cov ntsiab lus thiab muab tso rau hauv cov ntawv uas tau qhib hauv lub davhlau ya nyob twg:

ua file02

Txhawm rau khaws cov ntaub ntawv kho kom raug nyem CTRL + O, nias nkag mus thiab tom qab ntawd CTRL + X kom kaw cov ntawv.

Ntaus cov lus txib hauv qab no ntawm lub davhlau ya nyob twg thiab ntaus nkag. Cov ntaub ntawv khoob yuav qhib:

sudo nano /etc/systemd/system/homebridge.service

Rub cov ntawv hauv qab no. Qhib cov ntawv no, luam cov ntsiab lus thiab muab tso rau hauv cov ntawv uas tau qhib hauv lub davhlau ya nyob twg:

fwb 03

Txhawm rau khaws cov ntaub ntawv kho kom raug nyem CTRL + O, nias nkag mus thiab tom qab ntawd CTRL + X kom kaw cov ntawv.

Txhawm rau tsim tus neeg siv uas yuav ua haujlwm pabcuam thaum pib thiab muab kev tso cai tsim nyog rau lawv, ntaus ib qho ntawm cov lus txib hauv qab no thiab nias nkag mus tom qab txhua:

sudo useradd --system homebridge

sudo mkdir /var /homebridge

sudo cp ~/.homebridge/config.json/var/homebridge/

sudo cp -r ~/.homebridge/persist/var/homebridge

sudo chmod -R 0777 /var /homebridge

sudo systemctl daemon-reload

sudo systemctl pab kom homebridge

sudo systemctl pib homebridge

Txhawm rau rov pib dua lub system ntaus cov lus txib hauv qab no thiab nias nkag mus:

sudo rov pib dua

Tom qab lub kaw lus rov pib dua, qhib lub davhlau ya nyob twg dua, ntaus cov lus txib hauv qab no thiab nias nkag mus xyuas yog tias qhov kev pabcuam twb tau ua haujlwm lawm:

systemctl xwm txheej homebridge

Duab
Duab

Yog tias txhua yam ua tau zoo qhov kev pabcuam yuav ua haujlwm thiab koj tuaj yeem pom sau "nquag (ua haujlwm)" thiab qis dua yim tus lej lej uas tau nkag yav dhau los hauv config.json.

Nias CTRL + C yuam sij ntawm lub davhlau ya nyob twg. Ntaus cov lus txib hauv qab no thiab nias nkag mus txhawm rau txheeb xyuas cov ntaub ntawv nkag mus:

journalctl -f -u homebridge

Nias CTRL + C yuam sij ntawm lub davhlau ya nyob twg.

Kauj Ruam 5: Txhim Kho Homebridge Config UI X Plugin (Raspberry Pi)

Txhawm rau ua kom pom qhov teeb tsa ntawm lub plugin ntawm Homebridge Kuv tau xaiv los siv Homebridge Config UI X. Lub plugin no tso cai los ntawm qhov browser kom tuaj yeem teeb tsa, saib xyuas, thaub qab thiab rov pib dua Homebridge.

Txhawm rau teeb tsa lub plugin ntaus cov lus txib hauv qab no rau hauv lub davhlau ya nyob twg, nkag mus, lees paub cov lus txib yog hais kom sai thiab tos rau kev teeb tsa kom tiav:

sudo npm nruab -g-tsis muaj kev nyab xeeb-perm homebridge-config-ui-x

Ntaus cov lus txib hauv qab no ntawm lub davhlau ya nyob twg thiab ntaus nkag. Ib daim ntawv yuav qhib:

sudo nano /thiab /sudoers

Siv cov keyboard qis los yog rub tus nas, txav mus rau qhov kawg ntawm cov ntawv thiab ntxiv kab hauv qab no:

homebridge TXHUA = (TXHUA) NOPASSWD: TXHUA

Duab
Duab

Txhawm rau khaws cov ntaub ntawv nyem CTRL + O thiab tom qab ntawd CTRL + X kom kaw cov ntawv.

Ntaus cov lus txib hauv qab no ntawm lub davhlau ya nyob twg thiab ntaus nkag. Ib daim ntawv yuav qhib:

sudo nano/etc/default/homebridge

Siv cov xub tuav, txav mus rau qhov kawg ntawm kab HOMEBRIDGE_OPTS = -U /var /homebridge, muab qhov chaw thiab ntxig:

-Ib

Duab
Duab

Txhawm rau khaws cov ntaub ntawv nyem CTRL + O thiab tom qab ntawd CTRL + X kom kaw cov ntawv.

Tam sim no koj yuav tsum hloov kho config.json thiab ntxiv cov ntaub ntawv txuas ntxiv rau Homebridge.

Yog tias koj ua ntu 4 kom Homebridge khiav tam sim tom qab Raspbian pib, ntaus cov lus txib hauv qab no thiab ntaus nkag mus:

sudo nano /var/homebridge/config.json

Yog tias koj tsis tso Homebridge pib nrog Raspbian, ntaus cov lus txib hauv qab no thiab ntaus nkag mus:

sudo nano ~/.homebridge/config.json

Config.json yuav qhib:

Duab
Duab

Tsis pub dhau lub "platform" qauv, txhua plugins uas tau teeb tsa ntawm Homebridge yuav tsum tau qhia.

Txog Homebridge Config UI X, koj yuav tsum ntxiv cov cai hauv qab no uas yog hauv cov ntawv hauv qab no. Rub tawm nws, qhib nws, luam cov ntsiab lus thiab muab tso rau hauv cov ntawv uas tau qhib ntawm lub davhlau ya nyob twg:

fwb 04

Siv cov xub tuav, mus rau "platform" thiab nkag mus rau qhov chaws koj tau theej los ntawm cov ntawv. Hauv cov duab hauv qab no koj tuaj yeem pom dab tsi "qauv" qauv yuav zoo li tom qab ntxiv cov ntaub ntawv:

Duab
Duab

Yog tias koj xav kom txheeb xyuas tus qauv ntawm koj cov cai tom qab kho, tsuas yog mus rau JSONLint qhov chaw, muab tag nrho cov teeb tsa.json code, nyem rau "Validate JSON" thiab yog txhua yam ua tau zoo cov lus "Siv tau JSON" yuav rov qab los. Yog tias koj cov cai muaj qhov yuam kev yuav raug taw qhia rau kab nrog qhov yuam kev thiab xa cov lus piav qhia qhov ua yuam kev:

jsonlint.com/

Txhawm rau khaws cov ntaub ntawv nyem CTRL + O thiab tom qab ntawd CTRL + X kom kaw cov ntawv.

Rov pib dua lub system los ntawm kev ntaus cov lus txib hauv qab no, ntaus nkag thiab tos kom rov pib dua:

sudo rov pib dua

Txhawm rau qhib Homebridge Config UI X los ntawm qhov browser ncaj qha hauv Raspberry Pi koj yuav tsum nkag mus rau qhov chaw nyob:

localhost: 8080/

Yog tias koj xav qhib Homebridge Config UI X hauv qhov browser los ntawm lwm lub khoos phis tawj txuas nrog tib lub network zoo li lub rooj tsavxwm, yooj yim hloov lo lus localhost los ntawm qhov chaw nyob saum toj no nrog koj li Raspberry Pi's IP. Txhawm rau txheeb xyuas tus IP tau muab rau koj Raspberry Pi, nkag mus rau lub davhlau ya nyob twg, nkag mus rau cov lus txib hauv qab no thiab nkag mus:

ifconfig

Tej zaum tus IP tau muab rau koj Raspberry Pi pib nrog "192.168 …".

Hauv kuv qhov xwm txheej, pawg thawj coj yog IP 192.168.2.129, yog li tsuas yog nkag mus rau URL hauv qab no hauv computer hauv kuv lub network:

192.168.2.129:8080/

Ib nplooj ntawv zoo ib yam li cov duab hauv qab no yuav qhib thiab koj yuav raug hais kom nkag mus thiab tus lej nkag. Rau ob qho tib si nkag mus thiab tus password, ntaus admin thiab nkag mus nkag:

Duab
Duab
Duab
Duab

Thov nco ntsoov tias ntawm lub vev xaib tau qhia pom tus lej QR thiab hauv qab nws tus lej 8 tus lej uas tuaj yeem siv los txuas Homebridge rau Tsev app. Hauv "Config" kev xaiv ntawm lub cuab yeej, koj tuaj yeem nkag mus rau config.json, hloov kho yog tias koj xav tau thiab tom qab ntawd txuag.

Xauj los ntawm cov yam ntxwv muaj nyob hauv Homebridge Config UI X thiab paub koj tus kheej nrog cov cuab yeej.

Txhawm rau nres qhov kev ua tiav ntawm Homebridge koj tuaj yeem siv cov lus txib hauv qab no hauv lub davhlau ya nyob twg:

sudo kev pabcuam homebridge nres

Txhawm rau rov pib Homebridge koj tuaj yeem siv cov lus txib hauv qab no:

sudo kev pabcuam homebridge rov pib dua

Txhawm rau pib ua tiav Homebridge koj tuaj yeem siv cov lus txib hauv qab no:

sudo kev pabcuam homebridge pib

Nrog tus neeg rau zaub mov khiav mus rau qib 9 txuas ntxiv txuas Homebridge nrog Tsev app ntawm koj lub Apple ntaus ntawv.

Kauj Ruam 6: Txhim Kho Homebridge ntawm Windows

Yog tias koj tsis muaj Raspberry Pi lossis lwm lub platform uas tuaj yeem khiav Homebridge, koj tuaj yeem tso koj lub server khiav ntawm Windows.

Koj yuav tsum tau teeb tsa NodeJS thiab lwm txoj kev hloov kho ntawv rau Windows Notepad.

Rub tawm NodeJS los ntawm ib qhov txuas hauv qab no thiab tom qab ntawd nruab nws:

nodejs.org/en/download/

Thaum lub sijhawm teeb tsa txheeb xyuas lub npov uas tso cai rau koj kom ua tiav nruab cov cuab yeej tsim nyog:

Duab
Duab

NodeJS tsis yog qhov program graphical interface, yog li txhua qhov kev ua tiav ntawm nws los ntawm kev hais kom ua sai.

Rub tawm Notepad ++ los ntawm ib qhov txuas hauv qab no thiab tom qab ntawd nruab nws:

notepad-plus-plus.org/downloads/

Hauv Windows cov ntawv qhia zaub mov thaum txoj nyem rau ntawm ib daim ntawv twg yuav tshwm sim qhov kev xaiv "Kho nrog Notepad ++" thiab koj tuaj yeem xaiv qhov kev xaiv no thaum twg koj xav tau kho qee cov ntawv sau lossis ntawv Homebridge.

Mus rau Windows "Pib" ntawv qhia zaub mov, ntaus thiab tshawb rau "Chaw" thiab thaum pom nkag mus rau qhov kev xaiv. Nyem rau ntawm "Network & Internet" thiab tom qab ntawv nyem rau "Network and Sharing Center." Hauv qab "Access Type" nyem rau ntawm koj qhov kev sib txuas nquag, nyem "Paub meej" thiab luam tawm yim tus lej MAC chaw nyob rau koj daim npav network thiab txuag nws hauv notepad, vim qhov chaw nyob no yuav xav tau tom qab:

Duab
Duab
Duab
Duab
Duab
Duab
Duab
Duab
Duab
Duab

Hauv Windows "Start" ntawv qhia zaub mov, ntaus thiab tshawb rau "cmd" (Command Prompt) thiab thaum koj pom nws, nyem rau nws thiab xaiv "Run as administrator":

Duab
Duab

Nrog lub davhlau ya nyob twg qhib, ntaus txhua cov lus txib hauv qab no thiab nias nkag mus tom qab txhua qhov kom paub meej tias NodeJS / NPM kev teeb tsa tau ua tiav. Cov lus txib no xa rov qab cov version ntawm txhua pob khoom uas tau teeb tsa:

node -v

npm -v

Tom qab cov txheej txheem no tiav peb tuaj yeem teeb tsa Homebridge. Nkag mus rau cov lus txib hauv qab no, nkag mus thiab tos rau kev teeb tsa kom tiav:

npm nruab -g -tsis muaj kev nyab xeeb -perm homebridge

Tom qab ntawv ntaus cov lus txib hauv qab no thiab ntaus nkag mus rau khau raj Homebridge:

tsev

Homebridge yuav xa qee cov ntaub ntawv:

Duab
Duab

1) Cov ntaub ntawv config.json tsis pom los ntawm Homebridge. Cov ntaub ntawv no muab cov kev teeb tsa yooj yim rau kev khiav Homebridge thiab ib qho teeb tsa plugins. Tom qab ntawd peb yuav tsim cov ntaub ntawv config.json thiab nws cov chaw.

2) Tsis muaj plugin teeb tsa. Homebridge tsis muaj plugins teeb tsa yog siv tsis tau kiag li.

Duab
Duab

3) Txhawm rau txuas cov cuab yeej rau Tsev app koj tuaj yeem nyeem QR code uas muab cov ntaub ntawv koj xav tau rau khub. Txij li cov ntaub ntawv config.json tsis tau tsim thiab teeb tsa, thiab tsis muaj lub plugin teeb tsa, tam sim no QR code tsis zoo, txawm hais tias hauv Tsev app koj yuav tuaj yeem pom Homebridge muaj rau txuas, tab sis tsis ua.

4) Lwm txoj hauv kev los txuas cov khoom siv rau Tsev app yog los ntawm "Ntxiv Cov Khoom Siv", "Kuv Tsis Muaj Tus lej lossis Tsis Tuaj yeem Tshawb Xyuas" xaiv, thiab hauv qab "Cov Khoom Siv Nyob ze" lub cuab yeej raug xaiv thiab tom qab ntawd koj yuav raug ceeb toom rau teeb teeb. Nco ntsoov tias lub davhlau ya nyob twg tau qhia tus lej lej lej thiab yuav tsum tau nkag mus kom haum rau daim ntawv thov.

Nias CTRL + C yuam sij ntawm lub davhlau ya nyob twg los kaw Homebridge. Cov lus "Tau SIGINT, kaw Homebridge …" yuav raug xa rov qab thiab koj yuav tau txais kev ceeb toom kom pom tseeb, qhov twg koj yuav tsum ntaus ntawv Y thiab nias nkag mus.

Txhawm rau tsim cov ntawv config.json qhib Notepad ++, nyem rau ntawm cov ntawv qhia zaub mov "Cov Ntaub Ntawv", "Tshiab" thiab lub qhov rai tshiab yuav qhib. Nyem rau ntawm "Lus" cov ntawv qhia zaub mov, txav mus rau tsab ntawv J hauv cov npe, thiab xaiv "JSON."

Rub cov ntawv hauv qab no. Qhib cov ntawv no, luam cov ntsiab lus thiab muab tso rau hauv cov ntawv uas tau qhib hauv Notepad ++:

fwb 05

Duab
Duab

1) Hauv "username" rho tawm ntu XX: XX: XX: XX: XX: XX thiab nkag mus rau yim tus lej MAC chaw nyob ntawm daim npav network uas koj tau sau tseg yav tas los. Cov ntawv ntawm qhov chaw nyob koj yuav tsum yog txhua tus ntawv loj.

2) Hauv "tus pin" koj tuaj yeem khaws yim tus lej lossis koj tuaj yeem hloov mus rau ntu uas koj xav tau, nco ntsoov khaws tib hom kev sib cais nrog cov cim. Qhov no yuav yog tus lej koj yuav tsum nkag mus thaum lub sijhawm koj txuas Homebridge mus rau Home app.

Lwm cov ntaub ntawv cov ntaub ntawv koj tuaj yeem khaws tau, zoo li koj ntxiv cov plugins thiab khoom siv ntxiv koj tuaj yeem nkag mus rau cov ntaub ntawv xav tau.

Nyem rau ntawm cov ntawv qhia zaub mov "Cov Ntaub Ntawv", "Txuag", lub npe cov ntaub ntawv config.json thiab khaws nws mus rau txoj hauv kev "C: / Cov Neeg Siv Koj Lub Npe lossis Cov Ntaub Ntawv \.homebridge":

Duab
Duab
Duab
Duab

Kaw Notepad ++.

Kauj Ruam 7: Txhim Kho Homebridge Config UI X Plugin (Windows)

Txhawm rau ua kom pom qhov teeb tsa ntawm lub plugin ntawm Homebridge Kuv tau xaiv los siv Homebridge Config UI X. Lub plugin no tso cai los ntawm qhov browser kom tuaj yeem teeb tsa, saib xyuas, thaub qab thiab rov pib dua Homebridge.

Txhawm rau teeb tsa lub plugin ntaus cov lus txib hauv qab no rau hauv lub davhlau ya nyob twg, ntaus nkag thiab tos rau kev teeb tsa kom tiav:

npm nruab -g-tsis muaj kev nyab xeeb-perm homebridge-config-ui-x

NCO TSEG: Yog tias thaum lub sijhawm teeb tsa lub plugin koj pom qhov ua yuam kev uas muaj cov ntsiab lus MSBUILD / VCBuild.exe, tsuas yog ua haujlwm txhua qhov ntawm cov lus txib hauv qab no ntawm nws tus kheej thiab tom qab ntawd sim teeb tsa dua los ntawm cov lus txib saum toj no:

npm nruab -g node -gyp

npm nruab-ntiaj teb-tsim tawm windows-build-tools

npm nruab-ntiaj teb-tsim tawm windows-build-tools --vs2015

Tam sim no koj yuav tsum hloov kho config.json thiab nkag mus rau cov ntaub ntawv txuas ntxiv rau Homebridge. Mus rau txoj hauv kev "C: Cov Neeg Siv Koj Lub Npe lossis Cov Ntaub Ntawv \.homebridge" thiab los ntawm Notepad ++ qhib config.json uas tau tsim ua ntej:

Duab
Duab

Tsis pub dhau lub "platform" qauv, txhua plugins uas tau teeb tsa ntawm Homebridge yuav tsum tau qhia.

Txog Homebridge Config UI X, koj yuav tsum ntxiv cov cai hauv qab no uas yog hauv cov ntawv hauv qab no. Rub tawm, qhib, luam cov ntsiab lus thiab muab tso rau hauv cov ntawv uas tau qhib hauv Notepad ++:

fwb 06

Mus rau "platforms" thiab nkag mus rau qhov chaws uas koj tau theej los ntawm cov ntawv. Hauv cov duab hauv qab no koj tuaj yeem pom dab tsi "qauv" qauv yuav zoo li tom qab ntxiv cov ntaub ntawv:

Duab
Duab

Yog tias koj xav kom txheeb xyuas tus qauv ntawm koj cov cai tom qab kho, tsuas yog mus rau JSONLint qhov chaw, muab tag nrho cov teeb tsa.json code, nyem rau "Validate JSON" thiab yog txhua yam ua tau zoo cov lus "Siv tau JSON" yuav rov qab los. Yog tias koj cov cai muaj qhov yuam kev yuav raug taw qhia rau kab nrog qhov yuam kev thiab xa cov lus piav qhia qhov ua yuam kev:

jsonlint.com/

Txuag cov ntawv, kaw Notepad ++, thiab rov pib dua Windows.

Txhawm rau qhib Homebridge Config UI X los ntawm qhov browser mus rau:

localhost: 8080/

Ib nplooj ntawv zoo ib yam li cov duab hauv qab no yuav qhib thiab koj yuav raug hais kom nkag mus thiab tus lej nkag. Rau ob qho tib si nkag mus thiab tus password, ntaus admin thiab nkag mus nkag:

Duab
Duab
Duab
Duab

Thov nco ntsoov tias ntawm lub vev xaib tau qhia pom tus lej QR thiab hauv qab nws tus lej 8 tus lej uas tuaj yeem siv los txuas Homebridge rau Tsev app. Hauv "Config" kev xaiv ntawm lub cuab yeej, koj tuaj yeem nkag mus rau config.json, hloov kho yog tias koj xav tau thiab tom qab ntawd txuag.

Xauj los ntawm cov yam ntxwv muaj nyob hauv Homebridge Config UI X thiab paub koj tus kheej nrog cov cuab yeej.

Kauj Ruam 8: Pib Homebridge Nrog Windows

Homebridge Config UI X muab cov lus txib uas tuaj yeem siv los teeb tsa Homebridge ua qhov kev pabcuam kom cov neeg rau zaub mov tuaj yeem pib ua ke nrog Windows. Ntawm qhov hais kom sai ntaus cov lus txib hauv qab no, nkag mus thiab tos rau kev teeb tsa kom tiav:

hb-service nruab

NCO TSEG: Yog tias koj lub Windows firewall thov tso cai nkag mus rau lub network ntiag tug, tso cai rau nws

Tom qab kev teeb tsa tiav, kaw qhov hais kom sai thiab rov pib dua Windows.

Tom qab lub khau raj kaw lus, nias CTRL + ALT + DEL kom qhib Windows Task Manager. Mus rau "Cov Kev Pabcuam" tab, saib rau Homebridge hauv cov npe thiab pom tias "xwm txheej" yog "Khiav":

Duab
Duab

Txoj cai nyem rau ntawm qhov kev pabcuam Homebridge yuav qhib qhov kev xaiv uas koj tuaj yeem nres qhov kev pabcuam, rov pib dua thiab yog tias qhov kev pabcuam raug tso tseg koj tuaj yeem pib:

Duab
Duab

Yog tias koj xav tshem Homebridge los ntawm Windows pib, yooj yim nkag mus rau cov lus txib hauv qab no, nkag mus thiab tos rau qhov tshem tawm kom tiav:

hb-kev pabcuam tshem tawm

NCO TSEG: Nyob ntawm seb hom tshuaj tua kab mob twg koj siv koj yuav muaj teeb meem nrhiav Homebridge los ntawm koj lub xov tooj ntawm tes. Txog kev ntsuas lub hom phiaj, thaum nws txog sijhawm txuas Homebridge mus rau Lub Tsev app, yog tias tsis pom lub server nyob hauv ob feeb, kaw koj lub antivirus, xiam Windows Defender, rov pib Homebridge kev pabcuam los ntawm Windows Task Manager, thiab sim dua kom pom tus neeg rau zaub mov los ntawm Home app

Kauj Ruam 9: Txuas Homebridge rau Tsev App

Cov lus qhia hauv qab no siv tau rau ob qho tib si Homebridge khiav ntawm Raspberry Pi thiab Windows. Nco ntsoov tias lub server ua haujlwm zoo li Home app yuav tsuas pom Homebridge yog tias nws online.

Kuv siv iPhone 8 Ntxiv rau qhov tshaj tawm no, yog li ntawm no cov kauj ruam yuav yog iOS raws. Txog lwm yam Apple Homekit cov khoom siv sib xws, Kuv qhia koj kom txheeb xyuas cov ntawv qhia rau cov kev xaiv hauv qab no.

Mus rau koj lub iPhone lub vijtsam hauv tsev thiab nrhiav lub Tsev app los ntawm cov apps. Yog tias koj tsis pom nws, mus rau App Store thiab teeb tsa lub app:

Duab
Duab

Nrog Lub Tsev app qhib nyem rau ntawm "Ntxiv Cov Khoom Siv":

Duab
Duab

Ntawm lub vijtsam uas qhib nyem rau "Kuv Tsis Muaj Tus lej lossis Tsis tuaj yeem luam theej duab?":

Duab
Duab

Hauv "Cov Khoom Siv Nyob ze" koj yuav pom Homebridge. Nyem rau nws kom qhib qhov screen pairing:

Duab
Duab

Cov lus yuav qhib thiab koj yuav tsum nyem "Ntxiv Xwb":

Duab
Duab

Koj yuav raug ceeb toom rau "Homebridge Setup Code". Sau tus lej (PIN) koj teeb tsa hauv config.json thiab tos:

Duab
Duab

Yog tias txhua yam mus zoo koj yuav pom lub vijtsam hais tias Homebridge tau ntxiv thiab npaj rau siv:

Duab
Duab

NCO TSEG: Yog tias koj tau txais cov lus hais tias tsis tau txais txoj cai lossis tsis tuaj yeem ntxiv, kaw lub Tsev app, rov pib dua Homebridge, thiab sim cov kauj ruam ntxiv

Ntawm lub vijtsam tom ntej koj yuav pom cov lus "Yuav tsum teeb tsa ntxiv" vim tias tseem tsis muaj Homebridge ntaus ntawv. Nyem Ua tiav thiab lub app yuav rov qab mus rau lub vijtsam hauv tsev:

Duab
Duab

Ntawm lub vijtsam hauv tsev nyem rau ntawm lub cim tsev, ntawm lub vijtsam tom ntej nyem rau ntawm "Hubs & Bridges", nyem rau ntawm Homebridge ntxiv tshiab thiab koj yuav pom qee cov ntaub ntawv, thiab yog tias tom qab koj xav tau tshem Homebridge txuas, tsuas yog Nyem rau " Tshem Choj Los Ntawm Tsev ":

Duab
Duab
Duab
Duab
Duab
Duab
Duab
Duab

Yog tias koj tshem Homebridge los ntawm Lub Tsev app thiab xav ntxiv nws ntxiv, koj yuav tsum tau rho tawm “cov khoom siv ntxiv” thiab “mob ntxiv” cov ntawv tais ceev tseg los ntawm lub server.

Hauv Raspberry Pi:

Txiav Homebridge los ntawm kev ntaus cov lus txib hauv qab no rau hauv lub davhlau ya nyob twg thiab nias nkag mus:

sudo kev pabcuam homebridge nres

Yog tias koj ua ntu 4 kom Homebridge khiav tam sim tom qab Raspbian pib, ntaus cov lus txib hauv qab no thiab ntaus nkag mus:

cd /var /homebridge

Yog tias koj tsis tso Homebridge pib nrog Raspbian, ntaus cov lus txib hauv qab no thiab ntaus nkag mus:

cd.homebridge/

Ntaus ib qho ntawm cov lus txib hauv qab no thiab nias nkag mus tom qab txhua tus kom tshem tawm "cov khoom siv ntxiv" thiab "mob siab" cov ntawv tais ceev tseg:

sudo rm -r tseem/

sudo rm -r accessories/

Digite o comando abaixo no terminal e dê enter para iniciar o Homebridge:

sudo kev pabcuam homebridge pib

Ua cov kauj ruam ntxiv los txuas Homebridge rau Home app.

Hauv Windows:

Nres Homebridge cov kev pabcuam los ntawm Windows Tus Thawj Saib Xyuas Haujlwm, mus rau txoj hauv kev "C: / Cov Neeg Siv Koj Lub Npe lossis Cov Ntaub Ntawv \.homebridge", thiab rho tawm "cov khoom siv ntxiv" thiab "khaws cov nplaub tshev. Pib Homebridge cov kev pabcuam los ntawm Windows Task Manager.

Ua cov kauj ruam ntxiv los txuas Homebridge rau Home app.

Nws yog ib qho tseem ceeb kom nco ntsoov tias ib lub cuab yeej twg tsim los rau hauv lub Tsev app tau siv hluav taws xob hauv zos. Txhawm rau tuaj yeem tswj hwm Lub Tsev app li ntawm lub network sab nraud (piv txwv li 3G / 4G, piv txwv li), koj yuav tsum teeb tsa lub tshuab thev naus laus zis los ntawm ib qho ntawm Apple cov cuab yeej hauv qab no: iPad (khiav iOS 10 lossis tom qab), Apple TV (Tiam 4), lossis HomePod. Txoj kev no, txawm tias nyob deb ntawm tsev koj yuav tuaj yeem tswj hwm koj lub cuab yeej thiab IoT nyob deb uas tau koom ua ke nrog Home app los ntawm Homebridge lossis Homekit.

Los ntawm kev txuas Homebridge mus rau Lub Tsev Ua tiav koj tuaj yeem tshawb xyuas cov haujlwm ntawm cov cuab yeej zoo no. Hauv qhov txuas hauv qab no koj tuaj yeem pom cov npe plugins muaj rau siv nrog Homebridge thiab nyem rau ntawm txhua tus koj tuaj yeem pom lawv cov ntaub ntawv thiab yuav teeb tsa li cas:

www.npmjs.com/search?q=homebridge-plugin

Yog tias koj muaj IoT lossis lub cuab yeej siv hauv tsev thiab xav ua ke nrog Homebridge, tsuas yog tshawb nrhiav yog tias muaj lub plugin twb tau tsim lawm uas yuav tso cai rau koj siv lub cuab yeej no hauv Tsev app.

Txij li tus neeg siv hauv paus tsis tau qhib rau ntawm Raspbian, rau kev teeb tsa txuas ntxiv ib txwm nco ntsoov siv lo lus sudo ua ntej lub davhlau ya nyob twg nruab hais kom ua. Yog tias koj tsis siv sudo lub kaw lus ib txwm hais kom koj nkag mus rau lo lus zais system kom ua qhov kev nqis tes lossis koj tuaj yeem xa cov lus hais tias koj tsis tau tso cai.

Ntawm Windows, qhov hais kom ua sai yuav tsum tau ua tus thawj coj kom muaj peev xwm ua cov kab hais kom ua, thiab koj yuav tsum tsis txhob siv lo lus sudo vim nws yuav tsis raug lees paub los ntawm lub kaw lus.

Thaum twg los xij koj nruab ib lub plugin, nco ntsoov ntxiv nws cov ntaub ntawv hauv config.json thiab rov pib dua Homebridge kom lub Tsev app tuaj yeem hloov kho nrog cov ntaub ntawv los ntawm cov plugins ntxiv. Ib yam nkaus, txhua lub sijhawm koj tshem tawm Homebridge plugin, nco ntsoov tshem lub plugin cov teeb tsa.json cov ntaub ntawv, zoo li yog koj tsis tshem tawm cov server koj yuav muaj teeb meem pib.

Hauv qab no yog qee qhov txuas uas yuav pab tau nrhiav cov ntaub ntawv ntau ntxiv txog Homebridge thiab Homekit:

homebridge.io/

github.com/nfarina/homebridge

support.apple.com/pt-br/HT204893

Yog tias koj muaj Sonoff cov cuab yeej thiab xav siv lawv nrog Tsev app thiab Siri, Kuv pom zoo kom koj nyeem cov ntawv qhia ua ke Sib Koom Sonoff Nrog Tsev Hauv Tsev (Apple IPhone IOS).

Pom zoo: