Passerelle BLE de Xiaomi Gateway DGNWG05LM * sans BLE

(version européenne - lumi.gateway.mieu01)

Dans cet article, je vais vous expliquer comment collecter des données BLE et les transférer via MQTT vers des systèmes de maison intelligente, par exemple HomeAssistant.





Comment tout a commencé?

: . root , miio HA openwrt . , , .





zigbee2mqtt . zigbee-herdsman, @xiaomi_gw_hack openwrt , ( RGB, , , wi-fi ).





@lenz1986, @Alx2000y, @belokobylskiy!





, wifi rtl8723bs bluetooth BLE.





bluetooth. uart, — . @lenz1986





Plusieurs tableaux ont beaucoup aidé à comprendre le monde intérieur de la passerelle.
Voici à quoi ressemble la carte sans processeur)
)

, 4 UART . uart bluetooth wifi rtl8723bs. uart DTB, openwrt . @lenz1986 !









! openwrt . uart . ( @divanikus)





https://openlumi.github.io/





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 ( ) .





J'avais l'habitude de les écouter sur esp32 via esphome.  Une petite comparaison des données reçues d'un thermomètre.
esp32 esphome. .

, , raw . .





exemple d'interface cli avec état des appareils disponibles
cli

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





témoignage avant

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 .





les données des appareils volent assez souvent s'ils sont en ligne de mire.
.

: BLE, Bluetooth . .





opensource BLE

  • devbis/ble2mqtt - python bleak, , .





  • Beetle-II/lumi - hannseman/homebridge-mi-hygrothermograph, bindKey . raw mqtt. + BLE.





, !





, .








All Articles