Passive BLE Monitor integration (Xiaomi Mijia BLE MiBeacon monitor)

That’s what I have been doing but it did not work. But I missed that on the first page, Passive BLE Monitor options, before selecting a device there is also a Number of Decimals change line. I set that to 3 and it worked. The 4 devices I have are all set now to default for their individual devices settings.
Thanks
So I have 4 devices, Mi-1 to Mi-4. After doing this Mi-4 Battery Voltage is back to Unknown, the other values for Mi-4 are reading normally.
Mi-1 to Mi-3 are reading Voltage to 3 places.
Just info: I did notice that if the voltage has a third digit of “0”, the “0” is dropped.
i.e. 2.960 shows as 2.96. When that unit’s voltage dripped to 3.959 it was back to three decimals.
Thanks again for the help.

The first page is the “overall” setting. The second devices page you can overrule certain settings for individual sensors. But good to hear that it works!

I did an update of my Raspbian Supervised system and it completely upset this integration. Thanks to @Ernst in helping fix it.

If you do an apt upgrade on your system, check all the Bluetooth packages are still there with a dry run install.

sudo apt install bluetooth pi-bluetooth bluez blueman bluez-hcidump --dry-run

If they are not and you are having issues (for me HCI Interface kept crashing), install them and reboot. Solved it for me :slight_smile:

[edit]

Yes see above :slight_smile:

Today, 1.0.3 has been released. Several new sensors have been added since 1.0.0.

  • Xiaomi Philips Bluetooth Night Light (MUE4094RT)
  • Xiaomi Miaomiaoce MMC-T201-1 Digital Baby Thermometer (read the disclaimer)
  • Qingping CGP1W weather station
  • Qingping CGG1 and CGD1 sensor without using an encrypting key (using the Qingping advertisements)

And a bug fix.

  • Fixes a small bug for the reset_timer in combination with MJYD02YL motion sensors.

Can somehow make a step by step guide for the LYWSD03MMC ?
ive been trying many diffrent things and guides but i cant get it to work at all.

Tried the normal one and the flashed version with custom software but nothing seems to show up in HA.
By the way its on a pi4 so witout a ESP in between

if you integrate xiaomi cloud login you can read encryption key from the cloud.

Thanks for the reply, very much appreciated! :+1:

But that would install a lot of things? Can this be correct:

bluez ist schon die neueste Version (5.50-1.2~deb10u1+rpt2).
bluez wurde als manuell installiert festgelegt.
pi-bluetooth ist schon die neueste Version (0.1.15).
Die folgenden zusätzlichen Pakete werden installiert:
  adwaita-icon-theme at-spi2-core bluez-obexd dbus-user-session
  dconf-gsettings-backend dconf-service fontconfig fontconfig-config
  fonts-dejavu-core gir1.2-appindicator3-0.1 gir1.2-atk-1.0 gir1.2-freedesktop
  gir1.2-gdkpixbuf-2.0 gir1.2-gtk-3.0 gir1.2-notify-0.7 gir1.2-pango-1.0
  glib-networking glib-networking-common glib-networking-services
  gnome-icon-theme gsettings-desktop-schemas gtk-update-icon-cache
  hicolor-icon-theme libaom0 libappindicator3-1 libasound2-plugins libasyncns0
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3
  libavcodec58 libavresample4 libavutil56 libcairo-gobject2 libcairo2
  libcodec2-0.8.1 libcolord2 libcroco3 libcups2 libdatrie1 libdbusmenu-glib4
  libdbusmenu-gtk3-4 libdconf1 libdrm-amdgpu1 libdrm-common libdrm-nouveau2
  libdrm-radeon1 libdrm2 libepoxy0 libflac8 libfontconfig1 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgl1 libgl1-mesa-dri
  libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libgraphite2-3 libgsm1
  libgtk-3-0 libgtk-3-bin libgtk-3-common libharfbuzz0b libical3 libice6
  libindicator3-7 libjack-jackd2-0 libjbig0 libjson-glib-1.0-0
  libjson-glib-1.0-common liblcms2-2 libllvm9 libltdl7 libmp3lame0 libnotify4
  libogg0 libopenjp2-7 libopus0 liborc-0.4-0 libpango-1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpixman-1-0
  libproxy1v5 libpulse-mainloop-glib0 libpulse0 libpulsedsp librest-0.7-0
  librsvg2-2 librsvg2-common libsbc1 libsensors-config libsensors5 libshine3
  libsm6 libsnappy1v5 libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libsoxr0
  libspeex1 libspeexdsp1 libswresample3 libtdb1 libthai-data libthai0
  libtheora0 libtiff5 libtwolame0 libva-drm2 libva-x11-2 libva2
  libvdpau-va-gl1 libvdpau1 libvorbis0a libvorbisenc2 libvpx5 libwavpack1
  libwayland-client0 libwayland-cursor0 libwayland-egl1 libwebp6 libwebpmux3
  libwebrtc-audio-processing1 libx11-xcb1 libx264-155 libx265-165
  libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0
  libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcomposite1 libxcursor1
  libxdamage1 libxfixes3 libxft2 libxi6 libxinerama1 libxkbcommon0 libxrandr2
  libxrender1 libxshmfence1 libxtst6 libxvidcore4 libxxf86vm1 libzvbi-common
  libzvbi0 mesa-va-drivers mesa-vdpau-drivers notification-daemon pulseaudio
  pulseaudio-module-bluetooth pulseaudio-utils python3-cairo python3-gi-cairo
  rtkit va-driver-all vdpau-driver-all x11-common

It’s the same here, my hci interface lasts for ten to fifteen minutes, than it needs a restart…

EDIT: I’ll give it a try without blueman, seems a little overboard to install all this unnecessary desktop things that are needed by blueman. I’ll report back with my findings. :slight_smile:

Just try without bluemon and see if it works for you. I found these instructions somewhere but they might be overkill.

1 Like

I thought ble encryption keys are not stored in the cloud. The FAQ gives instructions on how to get the key

i know you can use mod app or sniff network for this, but it would be just more convenient to fetch keys for all devices from cloud at once.

cloud stores keys for ble gateways. they sync them every 30m, because they need to decrypt data locally to follow data upload scheme (delta/time) for each prop.

@rezmus, I’m not sure what you mean. Do you say it is possible to extract the encryption key from the cloud? How? The only thing I know is Xiaomi Cloud Token Extractor, but that doesn’t extract the encryption key for BLE devices. We tried to see if it contains more that can be extracted with that tool, but the key doesn’t seem to be stored in the cloud (see here). If you have more info, that would be more than welcome.

Can somehow make a step by step guide for the LYWSD03MMC ?

It should be as simple as

  1. install custom ATC firmware
  2. set advertisement type to custom

After that, it should be automatically discovered. If not, check the FAQ for possible solutions for common issues.

token cloud extractor and similar projects (which ported code from openhub mi cloud implementation) usually get devices list only with such data like did, token, ip, etc. there are plenty of other interesting api methods there.

when you have device list already you can call for each ble device (did blt.X) this method

/app/v2/device/blt_get_beaconkey {"did":"blt.X","pdid":1}

to get response with encryption key

{"code":0,"message":"ok","result":{"did":"","beaconkey":"00112233445566778899aabbccddeeff"}}

i installed the ATC firmware and selected the custom type.
then i installed the ble integration with haccs.

After a restart i installed the ble monitor.

Then what do i do next? as nothing seems to happen.

That’s very interesting! Do you have a script or code to run this? All I get is 401 messages. Tried to add it to cloud token extractor,

Did you add the integration in the UI? In the Integrations menu, add a new integration and look for ble monitor

yes its installed
Passive BLE monitor
Bluetooth Low Energy Monitor

i use my own code to talk to the cloud, but for sure it can be added to some existing integrations using mi cloud login.

Please create an issue on github and we figure out why it doesn’t work for you

1 Like

i created it thank you for your advice sofar