Cov txheej txheem:

XiaoMi Lub Tshuab Nqus Tsev + Amazon Khawm = Dash Ntxuav: 5 Kauj Ruam (nrog Duab)
XiaoMi Lub Tshuab Nqus Tsev + Amazon Khawm = Dash Ntxuav: 5 Kauj Ruam (nrog Duab)

Video: XiaoMi Lub Tshuab Nqus Tsev + Amazon Khawm = Dash Ntxuav: 5 Kauj Ruam (nrog Duab)

Video: XiaoMi Lub Tshuab Nqus Tsev + Amazon Khawm = Dash Ntxuav: 5 Kauj Ruam (nrog Duab)
Video: ЛУЧШИЙ БЕСПРОВОДНОЙ ПЫЛЕСОС | Dyson Total Clean V10 Cyclone: ​​инструкции и обзор 2024, Kaum ib hlis
Anonim
XiaoMi Lub Tshuab Nqus Tsev + Amazon Button = Dash Cleaning
XiaoMi Lub Tshuab Nqus Tsev + Amazon Button = Dash Cleaning

Cov lus qhia no yuav piav qhia yuav siv koj li cas seem Amazon Dash Buttons los Tswj XiaoMi Lub Tshuab Nqus Tsev.

Kuv tau txais ib pawg ntawm Amazon khawm tso los ntawm lub sijhawm lawv yog $ 1 thiab kuv tsis tau siv lawv. Tab sis ntawm qhov tau txais lub tshuab nqus tsev Robot tshiab kuv txiav txim siab tias yuav yooj yim heev los siv cov nyees khawm no los tswj lub tshuab nqus tsev.

Nias Ziploc khawm thiab nws yuav nqus chav pw.

Nias Glad khawm thiab nws yuav nqus lub Chav Nyob.

Nias Fiji.. zoo koj tau txais lub tswv yim.

Nws txoj haujlwm no suav nrog ntau hacks los ntawm internet. Kuv txaus siab rau txoj haujlwm ntau tus neeg tau ua thiab xav tias kuv yuav tsum qhia kuv qhov kev tiv thaiv me me raws li lawv cov kev tshawb fawb.

Kev tsis lees paub: Txhua kauj ruam hauv qab no koj ua ntawm koj tus kheej txoj kev pheej hmoo! Yog tias koj ua raws cov theem ua tib zoo muaj lub sijhawm tsawg heev uas koj tuaj yeem ua rau qee yam puas. Tab sis sh#t tshwm sim! Thiab kuv tsis muaj lub luag haujlwm ntawm nws. BTW txhua kauj ruam tuaj yeem thim rov qab yog li muaj peev xwm tsis muaj kev lav phib xaub lav. Tab sis ntawm chav kawm - YMMV

Lub hauv paus ntsiab lus yog peb ntes lub khawm tsoo ntawm lub router thiab xa webhook mus rau Lub Tshuab Nqus Tsev es tsis txhob yuav khoom ntawm Amazon.

Koj yuav xav tau dab tsi:

  • Router nrog kev cai firmware uas tuaj yeem tswj DHCP, sau cov ntawv thiab ua tiav tau | tshaj tawm cov lus nug. Mikrotik, DD-WRT, OpenWRT, Txiv lws suav thiab lwm yam..
  • XiaoMi lub tshuab nqus tsev. v1o2v ua
  • Amazon Dash Buttons

Tshwj xeeb qhov kuv siv:

  • Mikrotik
  • XiaoMi v2 Nqus Roborock S50
  • Pawg ntawm Amazon Dash Buttons

Nov yog txheej txheem

  1. Peb paus lub tshuab nqus tsev
  2. Nruab thiab teeb tsa cov pob khoom tsim nyog hauv qab hauv paus ntawm lub tshuab nqus tsev
  3. Teeb Amazon Dash khawm
  4. Teeb Router kom ntes khawm thov thiab tswj lub tshuab nqus tsev

NB: Qhov tseeb koj tsis tas yuav muaj hauv paus koj lub tshuab nqus tsev los tswj nws. Yog tias koj muaj lwm tus neeg rau zaub mov ntawm koj lan (lossis txhua qhov chaw) leej twg tuaj yeem khiav nab hab sej lossis php koj tuaj yeem ncaj qha webhooks rau lawv. Tab sis kuv tsis ua Thiab kuv xav kom nws huv si thiab cog ntawm lub tshuab nqus tsev nws tus kheej. Yog li yog tias koj tsis nyiam kuv txoj hauv kev Kuv xav tias koj tuaj yeem txiav txim siab teeb tsa koj tus kheej nruab nrab txiv neej server li cas los ntawm kev nyeem no. Tsuas yog mus ncaj qha rau taw tes 2.

Ok ntawm no peb mus …

Kauj Ruam 1: Tau txais lub Token thiab Lub Tshuab Nqus Tsev

Tau txais Token thiab Lub Tshuab Nqus Tsev
Tau txais Token thiab Lub Tshuab Nqus Tsev
Tau txais Token thiab Root Vacuum
Tau txais Token thiab Root Vacuum
Tau txais Token thiab Lub Tshuab Nqus Tsev
Tau txais Token thiab Lub Tshuab Nqus Tsev
Tau txais Token thiab Lub Tshuab Nqus Tsev
Tau txais Token thiab Lub Tshuab Nqus Tsev

Txhua qhov software, fimware thiab qhia rau rooting tau los ntawm: https://4pda.ru/forum/index.php? Showtopic = 881982

Yog tias koj muaj OS tsis yog Windows thiab xov tooj uas tsis yog Android (koj tuaj yeem siv virtual nrog nox) thov ua raws qhov txuas saum toj no (siv Google Txhais Lus) thiab nyeem cov lus qhia txwv tsis pub ua raws nrog phau ntawv qhia no.

Txhawm rau hauv paus peb yuav tsum tau txais tus IP chaw nyob thiab lub cim ntawm koj lub tshuab nqus tsev.

Unpack hauv paus. 7z.

Thov nruab Mihome los ntawm Vevs ntawm koj Android. Koj tuaj yeem siv ib qho los ntawm Cov Ntawv Sau lossis yog tias cov ntawv qhia no yog hnub tim, tom kawg ntawv tuaj yeem tau txais los ntawm nws lub vev xaib (https://www.kapiba.ru/2017/11/mi-home.html) lossis nws Google Drive (https://drive.google.com/drive/folders/1IyjvIWiGaeD7iLWWtBlb6jSEHTLg9XGj)

Nkag mus rau koj MiHome. Koj yuav tsum teeb tsa Tuam Tshoj Mainland ntawm koj tus lej nyiaj thiab ntxiv Nqus rau nws).

Coj mus rhaub rau lub tshuab nqus tsev icon Chaw (Peb lub teev nyob rau sab xis) General Chaw Network cov ntaub ntawv

Sau tus IP chaw nyob thiab token hauv win-mirobo/win-mirobo.ini

Lov tes taw firewall hauv windows. Tua tawm win-mirobo.bat thiab nyem lub firmware.

!!!!!!!!! V1 yog rau v1 Lub Tshuab Nqus Tsev thiab V2 yog rau v2 Lub Tshuab Nqus Tsev (Roborock S50) !!!!!!! Yog tias koj flashed tsis raug FW - mus rau 4pda txuas (thawj zaug hauv qib no) thiab nyeem yuav rov qab li cas.

Arter Vacuum reboots - koj tau ua tiav hauv paus koj lub tshuab nqus tsev thiab tam sim no koj tau nkag mus rau nws ntawm ssh!

SSH rau nws (nrog Putty) nrog lub tshuab nqus tsev/ntxhua khaub ncaws. Hloov mus rau koj tus password nrog passwd

Kauj Ruam 2: Txhim Kho thiab Kho Kom Tsim Nyog Cov Pob Yuav Tsum Tau Ua Hauv Hauv paus ntawm Lub Tshuab Nqus Tsev

Qhov chaw

Hloov chaw webhooks MiVacuum siv cov txheej txheem miio zoo ib yam li txhua XiaoMi IoT khoom siv. Yog li peb yuav tsum kawm nws kom nkag siab webhooks. Peb xav tau tus txiv neej nruab nrab uas tuaj yeem ntes webhook thiab txhais nws rau miio raws tu qauv rau ntaus ntawv. Muaj lub tsev qiv ntawv nab nab (https://github.com/rytilahti/python-miio) tab sis peb siv tsis tau nws ntawm lub tshuab nqus tsev vim tias tsis muaj chaw txaus rau Python 3.5+ ntawm lub Tshuab Nqus Tsev.

Tab sis ua tsaug muaj php-miio tsev qiv ntawv (https://github.com/skysilver-lab/php-miio) uas yog qhov sib piv zoo heev thiab qhov no yog qhov peb yuav siv (btw nws kuj tseem siv hauv win-mirobo saum toj no). Tus uas tuav lub webhook yog webhook daemon (https://github.com/adnanh/webhook) uas sau tsab ntawv rau php ntawm webhook tuaj.

SSH rau koj lub tshuab nqus tsev (nrog Putty):

#Ua hauv paus. Yog kuv paub tias nws tsis muaj kev nyab xeeb dab tsi.sev su #Ntawm no peb nruab txhua qhov xav tau apt-tau nruab -y wget php5-cli nano #Txhua yam ntxiv yog mus /xaiv cd /xaiv

#Rub tawm php-miio

#Txheeb xyuas qhov tseeb ntawm github. Kho cov kab hauv qab no raws li qhov tseeb wget https://github.com/skysilver-lab/php-miio/archive/v.0.2.6.tar.gz tar -xzvf v.0.2.6.tar.gz mv php- miio-v.0.2.6 php-miio rm -f v.0.2.6.tar.gz

#Rub tawm webhooks daemon

#Txheeb xyuas qhov tseeb ntawm github. Kho kab hauv qab no raws li qhov tseeb wget https://github.com/adnanh/webhook/releases/download/2.6.8/webhook-linux-arm.tar.gz tar -xzvf webhook-linux-arm.tar.gz mv webhook-linux-arm webhook rm -f webhook-linux-arm.tar.gz

#Tsim cov chaw rau webhook

nano /opt/webhook/hooks.json #Nkag mus hooks.json cov ntsiab lus ntawm no. Txoj cai nyem rau hauv putty. #Ctr+X Txuag Y.

#Tsim cov ntawv rau hu php-miio

nano /opt/webhook/mirobo.sh #Nkag mus mirobo.sh cov ntsiab lus ntawm no. Txoj cai nyem rau hauv putty. # Ctr +X Txuag Y. # Ua kom ua tiav chmod +x /opt/webhook/mirobo.sh

#Tsim cov ntawv autostart pib thiab txuas ntxiv teeb tsa

ncha "/opt/webhook/webhook -hooks /opt/webhook/hooks.json" >> /etc/init.d/webhook.sh chmod ugo+x /etc/init.d/webhook.sh hloov tshiab -rc.d webhook.sh defaults

#Rov pib dua lub system

rov pib dua

Tom qab reboot sim tawm koj cov chaw hauv browser:

192.168.your.ip: 9000/hooks/mirobo? method = find_me

method - hais kom ua

Parameter - cov ntaub ntawv

Txhua txoj hauv kev (cov lus txib) thiab qhov ntsuas koj tuaj yeem pom ntawm no:

github.com/marcelrv/XiaomiRobotVacuumProtocol

Cov ntsiab lus ntawm hooks.json

Hloov koj lub cim-ntawm no rau koj lub cim ntawm lub tshuab nqus tsev.

Kho tus IP-whitelist rau koj lub network hauv zej zog lossis tshem tawm tag nrho yog tias koj khiav koj cov hooks los ntawm lwm qhov (tsis nyab xeeb).

[{"id": "mirobo", "execute-command": "/opt/webhook/mirobo.sh", "command-working-directory": "/opt/webhook", "teb-lus": "Ua tiav mirobo tsab ntawv "," suav nrog-hais kom ua-tawm-hauv-teb ": tsis tseeb," dhau-ib puag ncig-rau-hais kom ua ": [{" qhov chaw ":" hlua "," envname ":" token "," npe ": "your-token-here"}], "pass-arguments-to-command": [{"source": "url", "name": "method"}, {"source": "url", "name ":" params "}]," txhais txoj cai ": {" phim ": {" hom ":" ip-whitelist "," ip-range ":" 192.168.1.0/24 "}}}]

mirobo.sh cov ntsiab lus. Tsuas yog luam-muab tshuaj txhuam. Tsuas muaj ob kab (tsis yog 3).

#!/bin/bashphp /opt/php-miio/miio-cli.php --ip '127.0.0.1' --bindip '127.0.0.1' --token $ token --sendcmd '{"id":' $ RANDOM ', "txoj kev": "' $ 1 '", "params": [' $ 2 ']}'

Kauj Ruam 3: Teeb Amazon Dash Buttons

Qhib koj Amazon App. Mus rau Dash Devices. Ntxiv khawm tsoo tshiab li qub. Ntawm qhov kev cog lus xaiv cov khoom TSIS TXHOB. Kaw lub app. Koj ua tiav.

Kauj Ruam 4: Teeb Router kom Txais Khawm Thov thiab Tswj MiVacuum

Teeb Router kom Txais Khawm Thov thiab Tswj MiVacuum
Teeb Router kom Txais Khawm Thov thiab Tswj MiVacuum
Teeb Router kom Tau Txais Khawm Thov thiab Tswj MiVacuum
Teeb Router kom Tau Txais Khawm Thov thiab Tswj MiVacuum
Teeb Router kom Txais Khawm Thov thiab Tswj MiVacuum
Teeb Router kom Txais Khawm Thov thiab Tswj MiVacuum

Qhov no ua haujlwm raws li hauv qab no.

Thaum khawm tau nyem nws tau koom nrog koj lub network thiab nug dhcp server kom muab nws qhov chaw nyob. Peb yuav tsum ntes qhov kev thov ntawd thiab ua lub webhook mus rau lub tshuab nqus tsev. Raws li kev ntsuas kev nyab xeeb ntxiv peb yuav thaiv kev txuas mus rau Amazon kom Amazon tsis paub tias peb txawm nias lub pob thiab tsis muaj peev xwm thawb hloov kho firmware lossis lwm yam.

Feem ntau kuv siv WinBox, tab sis qee lub sij hawm lub davhlau ya nyob twg tsuas yog yooj yim dua.

#Tsim cov phiaj xwm hluav taws xob poob nrog cov npe chaw nyob kom thaiv

/ip firewall lim ntxiv cov saw = rau pem hauv ntej src-address-list = blockdash action = drop comment = "Drop Amazon Dash"

Tom qab ntawd peb yuav tsum tsim txoj cai xauj tsev dhcp rau txhua lub khawm. Yooj yim heev ua hauv winbox.

DHCP Server - Lease

Ib leeg peb nias lub pob ntawv xauj tshiab tshwm. Peb nyem nws zoo li qub thiab teeb tsa cov npe chaw nyob rau 'blockdash', teem sijhawm xauj tsev rau 5 vib nas this (yog li daim ntawv xauj tsev tas sijhawm ua ntej nias tom ntej) thiab luam mac chaw nyob rau tom qab.

#Cov lus txib no tsuas yog siv rau yog tias koj ntxiv xaum hauv winbox tsuas yog hla nws.

/ip dhcp-server xauj ntxiv chaw nyob-npe = blockdash mac-address = XXXXXXXXXX chaw nyob = 192.168.x.x xauj-sijhawm = 5s

Tam sim no peb yuav tsum taw tes rau xaum tsab ntawv.

Qhib DHCP tab thiab ntxiv 'myLeaseScript' raws li daim ntawv xaum ntawm koj lub server dhcp.

Tam sim no qhib Qhov System - Cov ntawv sau thiab ntxiv 'myLeaseScript' nrog nyeem, sim tso cai.

Cov ntsiab lus ntawm myLeaseScript:

#Script hu ua ob zaug xauj (1) thiab tso tawm (0): yog ($ leaseBound = 1) ua = { /log cov ntaub ntawv ("Khiav myLeaseScript. Ib tug neeg nias Dash khawm?")

#Sau txhua qhov ntawm koj cov nyees khawm thiab url kom hu

: cov nyees khawm hauv zos {"XX: XX: XX: XX: XX: XX" = "https://192.168.your.ip: 9000/hooks/mirobo? method = app_zoned_clean¶ms = [19300, 21000, 21200, 23800, 1] "; "YY: YY: YY: YY: YY" = "https://192.168.your.ip: 9000/hooks/mirobo? Method = app_zoned_clean¶ms = [24000, 21500, 26100, 22900, 1]"; "ZZ: ZZ: ZZ: ZZ: ZZ: ZZ" = "https://192.168.your.ip: 9000/hooks/mirobo? Method = app_zoned_clean¶ms = [21400, 24200, 22700, 26200, 1], [24000, 21500, 26100, 22900, 1] "; "AA: AA: AA: AA: AA: AA: AA" = "https://whateveryouwant.com:9000/other?argument=and_values"; };

#Txheeb xyuas lub pob nyem thiab sau url

: foreach mac, url in = $ buttons do = {: if ($ mac = $ leaseActMAC) do = { /log info ("Nias". $ mac. "button") /tool fetch keep-result = tsis muaj hom = https http-txoj kev = tshaj tawm url = $ url}}}

Tam sim no koj tau siv lub tshuab ntxuav koj lub xov tooj ntawm Amazon Dash Button. Muaj kev lom zem

Thov them nyiaj mloog: Nws tsis nyab xeeb heev rau xa webhooks yam tsis tau nkag mus. Webhook tuaj yeem siv encryption, tab sis txawm li cas los kuv tau sim ua kom nws ua haujlwm nws tsuas yog tsis tau tshwm sim. Txij li thaum kuv siv nws tsuas yog hauv kuv lub network hauv zos kuv tsis txhawj xeeb heev. Tab sis yog tias koj xav siv nws hauv is taws nem los txuas rau IFTTT nrog Google Assistant kev koom ua ke thov ua tib zoo mloog qhov tseeb no! Kuv tsis paub meej tias yog vim li cas rau crypto tsis ua tiav hauv kuv kis. Cov ntawv pov thawj tus kheej-Kuv tau ntaus nrog muab los ntawm letencrypt. Kev sib koom ua ke ntau dhau nrog pawg ntawm NATs Kuv raug ntaus nrog ipv6. Tab sis nws zoo li rau kuv webhooks ua haujlwm tsis zoo nrog daim ntawv pov thawj thiab qhov tseeb tsis zoo sau tseg. Thiab zoo li IFTTT tsis ua haujlwm nrog ipv6. Kuv sim txhua yam kuv ua tau, tab sis ua tsis tau. Tej zaum koj yuav muaj hmoov zoo dua. Tsis txhob hnov qab ua tus tshaj tawm.

hloov kho: Kuv muaj lub tswv yim yuav ua li cas kom nws nyab xeeb dua yam tsis muaj encryption. Koj tsim ob peb tsab ntawv rau txhua qhov kev ua uas koj xav ua. Koj hloov kho mirobo.sh kom hu tsab ntawv nrog rau qhov muab ntsuas uas tau xa hauv webhook piv txwv. huv_ chav pw. Qhov ntawd yog nws. Cov neeg feem coob uas siv tus nuv yuav ua yog txhawm rau ntxuav koj chav pw ntau dua…)) Thaum kuv ua qhov ntawd kuv yuav hloov kho cov lus qhia

Kauj Ruam 5: Yuav Npaj Li Cas Koj Daim Ntawv Qhia

Yuav Ua Li Cas Npaj Koj Daim Ntawv Qhia
Yuav Ua Li Cas Npaj Koj Daim Ntawv Qhia

Thaum koj muaj koj daim ntawv qhia tag nrho npaj hauv koj li MiHome app xa koj lub tshuab nqus tsev mus rau qhov chaw tshwj xeeb ntawm 'app_goto' hais kom ua.

Ua ib qho screenshot ntawm daim ntawv qhia tag nrho nrog txoj haujlwm xa thiab hauv paus. Lub hauv paus ntsiab lus tom qab rov pib dua lub tshuab nqus tsev yog txoj haujlwm [25500, 25500] Qhov no tsis yog txoj haujlwm ntawm CHARGING BASE, tab sis yog tias koj rov pib dua lub tshuab nqus tsev thaum them lub hauv paus ces txoj haujlwm them lub hauv paus yuav yog 25500, 25500. Yog li los ntawm txoj haujlwm paub xa thiab txoj haujlwm hauv paus koj tuaj yeem npaj koj daim duab qhia chaw ntawm txhua qhov haujlwm CAD nrog lub screenshot uas koj tau ua. Kuv siv QCAD dawb.

Tom qab kho cov duab rau daim phiaj Kuv siv kab hla chav los ntsuas qhov pib thiab qhov kawg ntawm thaj tsam.

Pom zoo: