
In frĂŒheren Folgen habe ich:
- Ich habe bei Xiaomi GerĂ€te fĂŒr ein Smart Home gekauft und sie mit einem Lötkolben auf unterhaltsame Weise zum Laufen gebracht - ohne native Server ĂŒber den Home Assistant ( Link zum Beitrag ).
- Wickelte die WeboberflĂ€che vom Heimassistenten in Elektron ( Link zum Beitrag ) mit UnterstĂŒtzung fĂŒr Benachrichtigungen, MenĂŒs, Tokenbar usw. (Code hier).
- miio ( ) xiaomi_miio.
, . "" IoT lisp-, . .
Xiaomi:
- udp
- ,
- ,
Home Assistant:
- ,
- , Home Assistant
- Single Point of Failure
home assistant â . ~1000, Home Assistant Raspberry PI ~4000, Home Assistant - . .
, CPU, , " â , â " . Home Assistant.
xiaomi , - , json-based dsl ( ).
"" , . zigbee/ble esp32/nrf51 , âŠ
.
Xiaomi CO2, , home assistant , , âŠ.
, , , , , arduino-ide ( -), , , , "" .

Proof of concept:
- CO2 â 1
- â 1
- â 2
- home assistant â 1
- cli â 1
- ,
home-assistant Xiaomi "chuangmi.plug.v3 1.3.0_92 ESP8266 detected". , ESP8266 â (~100/) , . Wi-Fi, I2C/SPI/UART/GPIO. ESP8266 Xtensa 80/160Mhz 32- 112 Tensilica ( - , tensilica 2013, esp8266 2014), 1 , .
. ESP8266 . esp201 â , 2.54mm. arduino âŠ
âŠ
ESP8266. Xtensa Wi-Fi â , - . nrf51 (~150/). , . .
CO2
aliexpress CO2 ( ). CCS811 ( ). (~500/) , CO2 TVOC , , 60, CCS811 .
LED 8x8 max7219 (~100/). ...
hlk-pm03 (~200/). 4- ; 220v AC, 3.3v DC esp8266.
, . . ( - â ).
:
- SensorPack â CCS811 ESP201 I2C ( , )
- Pixel â LED 8x8, max7219 ESP201 SPI
SensorPack

Pixel :

:
- USB/UART
- UART "Hello world!"
- Wi-Fi
- CCS811 UART
- / led
20-50 . .
, :
- /
- /
- DSL /
udp , Xiaomi wi-fi , . â udp , ip/ â udp . â . , â xiaomi , ( ), , / "Faster! Harder! Scooter!" " â !".
python.
python , .
, aes128-cbc :
- 128 â Initialization Vector (IV) aes128
- â , aes128
, IV python arduino api.
python
IV, , replay attack. , xiaomi replay attack, :) , IV IV , . ...
?
, , python-, , . , -. ? FLOPS , , , . , ?! , led , n â .
JS . ESP8266 JS, . Lua, NodeMCU ESP8266. , lua .
lua âŠ
, :
- 1 esp201 lua
- NodeMCU lua , . , , âŠ
lua , .
uLisp
" ?â â , lisp. , , ---- lisp esp8266, uLisp. c â @technoblogy :
- udp
- ulisp
- s-expression
- ip/
- api ulisp CCS811 Max7219
Lua , ulisp arduino ulisp . ulisp , , C++. , lisp arduino.
:
192.168.2.99 â IP SensorBoard
192.168.2.174 â IP Pixel
:
python tools/client.py --ip 192.168.2.99 --message '(+ 1 2)' --key YOUR_AES128_HEX_KEY
>> (+ 1 2)
<< 3
discovery. , ulisp.
python tools/client.py --ip 192.168.2.99 --message '(discovery)' --key YOUR_AES128_HEX_KEY
>> (discovery)
<< ("light-read" "co2-read" "tvoc-read" "humidity-read" "temperature-read")
CCS811
python tools/client.py --ip 192.168.2.99 --message '(list (co2-read) (tvoc-read))' --key YOUR_AES128_HEX_KEY
>> (list (co2-read) (tvoc-read))
<< (840 67)
REPL,
python tools/client.py --ip 192.168.2.174 --message '(discovery)' --key YOUR_AES128_HEX_KEY
>> (discovery)
<< ("show" "request")
show â led
request â , , ,
# led 30
(defun show_sensor (x)
(show
(format nil "CO2=~a TVOC=~a"
(first x)
(second x))
30000))
# 33 , show_sensor
(periodic 33000
(quote
(request
"192.168.2.99"
54321
(quote (list
(co2-read)
(tvoc-read)))
'show_sensor)))
Pixel
$ python tools/client.py --ip 192.168.2.174 --mfile ulisp_scripts/red.ulisp --key YOUR_AES128_HEX_KEY
Pixel SensorPack
lisp . Raspberry PI â . , - Home Assistant lisp . SPoF, Home Assistant.
SensorPack USB Wi-Fi

, , , dsl, lisp . , s-expression ( json, , lisp â s-expression).
Ich werde mehr andere GerÀte nach dem gleichen Protokoll modellieren, als nÀchstes folgen ESP32 und NRF51 ...
Und gleichzeitig werde ich die Firmware in einen Lebensmittelzustand versetzen. Wenn Sie plötzlich interessiert sind, schlieĂen Sie sich mir an !
PS Alle Angriffe auf Home Assistant werden mit groĂer Liebe ausgefĂŒhrt. Ich bin dort sogar ein bisschen komisch.