(eu version - lumi.gateway.mieu01)
In this post I will tell you how you can collect BLE data and transfer via MQTT to smart home systems, for example, HomeAssistant.
How it all began?
: . root , miio HA openwrt . , , .
zigbee2mqtt . zigbee-herdsman, @xiaomi_gw_hack openwrt , ( RGB, , , wi-fi ).
@lenz1986, @Alx2000y, @belokobylskiy!
, wifi rtl8723bs bluetooth BLE.
bluetooth. uart, — . @lenz1986
, 4 UART . uart bluetooth wifi rtl8723bs. uart DTB, openwrt . @lenz1986 !
! openwrt . uart . ( @divanikus)
Bluetooth rtk_hciattach . hciconfig
2 , bluetooth .
hciconfig hci0 up
AutoEnable
/etc/bluetooth/main.conf
true
. . hcitool lescan
BLE
BLE , - zigbee2mqtt. Node.Js, node-red. EspruinoHub. ( , )
mqtt , CLI web LYWSDCGQ ( ) .
, , raw . .
Xiaomi bluetooth BLE Advertising Packet, , . , .
MiBand .
xiaomi, BLE fe95. . github . espruino , hannseman/homebridge-mi-hygrothermograph. .
Xiaomi, fe95. (, , ), .
EspruinoHub , . , bindKey . bindKey miHome.
MQTT Discovery - Home Assistant
, HomeAssistant. EspruinoHub , . , config homeassistant mqtt
.
raw ( ).
LYWSDCGQ - " ". mqtt discovery HA
LYWSD02 - ,
LYWSD03MMC - , ( bindKey). 2 , . pvvx. . , .
MI SCALE - 181d v1 - ( ) - ( ) - . 181b v2 , . -
Mi band 3 fee0 . MiFit.
, . Amazfit GTS
HHCCJCY01 MiFlora, Huahuacaocao - temperature, moisture, illuminance, conductivity, battery_level
. , mqtt bindKey .
YEERC - esp32 tasmota , . YEELIGHT, 32 bindKey . , . ( event counter ) - . . .
EspruinoHub Xiaomi OpenWrt ?
git / npm, EspruinoHub
opkg
https://openlumi.github.io/openwrt-packages/
.
opkg update opkg install node-espruinohub
- mqtt . mqtt, /etc/espruinohub/config.json
! . ( )
. "only_known_devices": true
, .
HomeAssistant json , . .
"mqtt_format_json": true,
"homeassistant": true,
"mqtt_cache_state": true
rssi . rssi .
: BLE, Bluetooth . .
opensource BLE
devbis/ble2mqtt - python bleak, , .
Beetle-II/lumi - hannseman/homebridge-mi-hygrothermograph, bindKey . raw mqtt. + BLE.
, !
, .