Request support for Miband from Xiaomi

Fitbit is a Home Assistant component… why not a component for Mi Band 3 Xiaomi?

1 Like

+1 vote for support Miband 3

3 Likes

Would love to see a Fitbit like component for Mi Band too.

Just got the new mi band 3 to use with room-assistant, would really love to see this supported

1 Like

+1 Mi Band 3

+1 Mi band 3

Hey guys if you’re still interested I have cobbled together something for the Mi Band 3

1 Like

For anyone interested, I set up an ESP32 for another project (there are good instructions if you aren’t familiar, it’s not too scary) with ESPHome component I was very surprised that it is tracking my Mi Band 3 via the BLE tracker (I looked at this quite long and hard)!

The ESP32 I got:

ESPHome page: https://esphome.io/

Component:

I’m still doing reliability testing, I have it on a 5 sec scan interval and it’s typically less than 20 sec lag for a detection. State and rssi below.

2 Likes

Have you got some more info (or config files) to share with us?
It would be great… :slightly_smiling_face:

The bulk of the set-up is really in installing ESPHome, and then just configuring some YAML that gets translated into firmware.

  1. Get an ESP32
  2. Install ESPHome and follow set-up instructions on the relevant Home Asssisstant and ESPHome site (https://esphome.io/)
  3. Look at the configuration for the BLE RSSI & ESP32 BLE Device components on the ESPHome site.

Once it’s running, the scanner has a log file where you can see what BLE devices it can see.

Below is an (working) example of the yaml that gets turned into ESPHome firmware.

esphome:
      name: esp_door_lock
      platform: ESP32
      board: fm-devkit

wifi:
  ssid: "XXXXXXX"
  password: "XXXXXX"

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

esp32_ble_tracker:
  scan_interval: 600s


sensor:
  - platform: wifi_signal
    name: "12 BLE Bridge WiFi Signal"
    update_interval: 60s
  - platform: uptime
    name: "12 BLE Bridge Uptime"
  - platform: ble_rssi
    id: mibandrssi_1
    mac_address: C1:DE:8E:DB:YY:XX
    name: "RSSI MiBand EntryESP"
    
text_sensor:
  - platform: version
    name: "12 ble bridge ESPHome Version"

binary_sensor:
  - platform: ble_presence
    mac_address: C1:DE:8E:DB:YY:XX
    id: mibandpresence_1
    name: "Presence MiBand EntryESP"
  - platform: ble_presence
    mac_address: C1:DE:8E:DB:ZZ:XX
    name: "Presence BlueCat EntryESP"

Short scan intervals worked, but really killed my wifi though, like others have experienced, so I’m looking at other options, with my primary goal to get really quick “arrive at front door detection”. See here:

1 Like

Thanks Mahko!!
I’m looking the esphome doc right now…

Could you explain your “wifi issues” with this solution?
What are the odds on this?

Thanks again

I can’t say I’m much of an expert. In summary, bluetooth scans interfere with wifi. https://www.goldtouch.com/stop-bluetooth-interfere nce-messing-devices/
Clever implementations like this cool one implement approaches to minimize this.
[monitor] Reliable, Multi-User, Distributed Bluetooth Occupancy/Presence Detection

The monitor developers seems like a bit of a guru on the topic. [monitor] Reliable, Multi-User, Distributed Bluetooth Occupancy/Presence Detection

Ok…so the problem is wifi & bluetooth frequency…but we have only 5.0GHz wifi band so we should be half way down!

Yeah you might be alright then. Some of my smart devices only do 2.4ghz. But I think esp32 only does 2.4ghz.

You’re right…I have just been thinking exactly the same…wondering how this “wifi degradation” is in real term

The problem is that the ESP32 only has one 2.4ghz radio, so if you’re always scanning BLE you can’t use WiFi. Maybe use ESP32 for BLE with UART connection to ESP8266 with both running ESPHome?

Hi guys, I would like try to integrate my Mi Band 4 in Hassio (installed on my raspberry pi 4).
So, the question is: can I use my Bluetooth module of the raspberry4 to to discover the presence of my Mi band 4 or I need some other hardware like an esp32?
i’ve tryed some add-on like Happy Bubbles unsucessflully :frowning: could someone clarify and help me?

Hi @carnighi,

The built-in Home Assistant BLE integration seems to work with the Mi Band.

Check out a Reddit post about it here. :grinning: