Passive BLE Monitor integration (Xiaomi Mijia BLE MiBeacon monitor)

The default advertising interval for the custom firmware is faster (every 60 seconds) so these should appear a lot faster in the dashboard. Alternatively it can be increased/decreased with the flasher.

With the Custom Firmware you completely bypass the Official application (MiHome). I never even had it installed. I literally flashed the sensors with CF, installed HACS and the “Xiaomi passive BLE Monitor Sensor platform” from it, reboted the Raspberyr Pi Z W, edited the Configuration.yaml file with the relevant settings, another reboot, and the sensors appeared in the dashboard straightaway

I do not recall having gone through the logs in detail at the time to be honest.
Tomorrow I will enable logger for custom_components.mitemp_bt; set hci to 0 and reboot to make a log to put it here.

1 Like

Here’s mine as sample:

 sensor:
    - platform: mitemp_bt
      rounding: True
      decimals: 1
      period: 60
      log_spikes: False
      use_median: False
      active_scan: False
      hci_interface: 1
      batt_entities: False
      sensor_names:
       'A4:C1:38:D1:B3:FA': 'LivingRoom'
       'A4:C1:38:6C:BF:7C': 'Kitchen'
       'A4:C1:38:3C:B5:4D': 'Office'
       'A4:C1:38:7D:7F:E8': 'Bedroom'
      report_unknown: False
      whitelist: False

Do I have to put something else in config ?

In the simplest case, just the line - platform: mitemp_bt is enough.

Just to be sure, how do you check for sensors?
Try Configuration → Entities → search by string “mitemp_bt”

Finally I got it working…

Went to github and found firmware that set mi like by default, reflashed it and it’s working fine now, I had nothing to do, sensor appared just after flashing it

For those who want the link: https://github.com/atc1441/ATC_MiThermometer/issues/37#issuecomment-720063545

Anyway thanks for your time !!

And BTW thanks for the compo :stuck_out_tongue:

2 Likes

Soni

You just simply need to install the Custom firmware first. Once it is flashed, you just need to connect to the Sensor again (in the Telink flasher) and select the advertising type to “Mi Like”. I thouhgt it was explained clearly in my origina post above. This is why I mentioned that your most likely cause would be not having activated the “Mi-like” advertising after flashing the CW.

Hello there :slight_smile: I’ve flash my Xiaomi temp sensor with the custom firmware but I can’t find where I can find my MAC adress :confused: Any idea please ?

Edit : Found it using an Android app : https://play.google.com/store/apps/details?id=com.macdom.ble.blescanner very usefull.

It is also visible as an attribute to your entity in home assistant (check e.g. developer tools, states). Or if you only have the following configuration, it will be in the name of the sensor (without the : )


sensor:
  - platform: mitemp_bt

Today we have released a new beta version 0.8.0-beta. This version has some breaking changes, as we have decided to move some configuration parameters to the new devices option. This allows us to define more parameters at device level in the future.

If you are using one of these options, please read the instructions on this page carefully and modify your configuration after updating to 0.8.0-beta.

  • encryptors
  • sensor_names
  • sensor_fahrenheit
  • whitelist

The new format (0.8.0 and above) will become:

sensor:
  - platform: mitemp_bt
    discovery: True
    devices:
      - mac: 'A4:C1:38:2F:86:6C'
        name: 'Livingroom'
        encryption_key: '217C568CF5D22808DA20181502D84C1B'
        temperature_unit: C
      - mac: 'C4:3C:4D:6B:4F:F3'
        name: 'Bedroom'
        temperature_unit: F
      - mac: 'B4:7C:8D:6D:4C:D3'

Explanation of the new options can be found here.

Instructions to convert your old configuration to the new format can be found here

3 Likes

I quite like how active the development on this is.
I don’t suppose this update makes it possible to exclude types of sensors with the devices option? Let’s say I only care about the light level and moisture, but not the temperature or conductivity.

At the moment there is no such possibility, yes. However, this change opens the way for us to expand the number of possible settings per device, and it is quite possible that the possibility you mentioned will appear in the future releases (need to think about it).

One question - why is it not enough to simply not use unnecessary entities? :slight_smile:

1 Like

No you’re right I can of course just disable them/ignore them. I guess I thought it is be better to “disable” anything not in use as close to the source as possible. That was all :slight_smile:

Checking and enumerating such settings at the stage of parsing messages from the device will consume more computing resources. But I’ll think about it, maybe I’m wrong.

1 Like

For standard built in components, the policy is to always add all sensors by the component and let the user decide to exclude certain sensors in Home Assistant by switching them off.

Yes, it seems correct to me too, but I remembered the monitored_conditions setting in the original mitemp_bt.

See this page for more info why they have decided to not allow monitored conditions anymore. Original mitemp_bt hasn’t been updated, but it should be removed there.

1 Like

Interesting reading, thanks.

Just wondering if there had been an update on the Ubuntu 20.10 issue with some NUCs? I believe hcitool was not working, but was working with bluetoothctl.

I’m not sure I understood what issue you mean.
hcitool is deprecated tool, and may not work or may not be present at all in the distro.

So from what I have seen on the repo, some people have had issues when using an Intel NUC on Ubuntu 20.04 and later with this component working. I have not been able to get this component working after moving from an Rpi 4 to an NUC with HA running in Docker.