Passive BLE Monitor integration (Xiaomi Mijia BLE MiBeacon monitor)

Hi,

Thanks for the feedback! I have not thought about the encryption part. I missed that when reading the documentation and that was the main issue. I manage now to make it work, 2/3 out of 4 sensors, as depends on the moments 3 are working and 2 are working, but maybe they are defective and maybe I have to still play around to make them work, but if 2 work, it means that the problem is another. The data collection is very slow and update it’s very slow, over 10 min, so maybe I need to be more patient.

Thanks again for the support and for helping me on this! Enjoy the weekend!

Hi, repo description shows experimental support of YM-K1501.(Xiaomi Mijia Smart kettle). I am trying to setup it, but object doesn’t appear. What I’m doing wrong?

ble_monitor:
      devices:
      - mac: 'B8:7C:6F:84:xx:xx'
        name: 'Kettle'

Hello. Kettle support in public releases is very crude and doesn’t work well. Check out this github issue. Try to install the code (manually) as I wrote here.
In this github issue, we seem to have come to a good result, and full support for the kettle seem to be included in the next public release.

What’s the best way of increasing bluetooth range - can you have a network of dongles.

Hi Stepea,

I think this video will help you. It’s partially using this specific system and it has the answer on an economycal way on how to increase BT range. With my PI I’m surprised about the big range it has.

The video is interesting for your question from about min 10 : https://www.youtube.com/watch?v=K-HG7qs9hK0&t=371s

Hope it helps.

As pointed out in the video link from @juansa, ESPHome is a good option for building a large distributed system. However, many refuse this option (me, for example) because of the need to have several devices tied to power sockets.
The first thing that, in my opinion, is worth trying (if you haven’t tried it yet) is an external USB BT dongle, and preferably with a full-size antenna (like on WiFi routers and adapters). Even a small dongle usually performs better than the built-in raspberry.
Next, you should try to take this dongle away from the host (or other interfering devices) using a USB extension cable.
Since our component allows receiving data from several interfaces (hci_interface option), you can try to use several dongles, spaced apart. Our FAQ provides an example of an RJ-45 extension adapters (taken from a review by one of the users). But I myself have not tried this. The dongles carried out on two-meter usb extension cords were enough for me.

Thanks for fast reply. Well I found the problem for my kettle. It uses device ID: 1301 .
Thats original YM-K1501 MiKettle global version. Now I have two sensors (binary & temperature)

Looks like in const.py (integration 0.9.1-beta) used value for chinese version of the kettle with ID 8300

2020-12-06 20:55:16 DEBUG (Thread-3) [custom_components.ble_monitor] BLE ADV from UNKNOWN: RSSI: -73, MAC: B87C6F842B4D, ADV: 043e24020100004d2b846f7cb81802010614 1695fe 7120 1301 294d2b846f7cb8 09 0510 02 0034 b7
2020-12-06 20:55:46 DEBUG (Thread-3) [custom_components.ble_monitor] BLE ADV from UNKNOWN: RSSI: -74, MAC: B87C6F842B4D, ADV: 043e24020100004d2b846f7cb81802010614 1695fe 7120 1301 2e4d2b846f7cb8 09 0510 02 0034 b6

kettle

Hello everybody

talking about BT range, I’ve been having some weird issues with that lately. I said weird because I have the Xiaomi BT temp sensor which used to work pretty well with my BT antenna for a good while, but after few months it just decided to keep disconnecting. I tried everything I could from a “software perspective” (been thinking it was some sort of issues with the custom component or BT drivers and so on) when I realized that just by placing the sensor closer to the antenna fixed the issue. I moved it closer to the antenna for this reason, when again it started to drop the connection. And it’s always the same, if I put it closer, it reports data, as soon as I place it where it should be, it drops.

I might want to increase the BT range for this reason with a dongle or something like this, but the overall situation sounds weird to me… Do you have a suggestion before I buy the dongle?

Yes, there was some confusion with these IDs, in the end there are now 3 of them :slight_smile: All three IDs are already included in the kettle branch and will be included in the next beta release of the component.

There is probably nothing to add to the said above.

There are too many potential causes of poor reception to explain all of them, and not to ignore any aspect of the problem. It could be a change in the workload of the 2.4GHz band, the appearance of new interfering devices, the possible dependence of the transmitter power of the device on the battery charge, degradation of some cheap elements of the device, temperature, humidity and moon phase :slight_smile: I can only say that an external dongle usually works better than a built-in adapter.

1 Like

Yeah that’s why I always prefer to have everything wired I guess :sweat_smile:

Thank you!

1 Like

thanks, i am already install kettle branch. Just one question about branch description:

The switch entity has an extra ext_state attribute. Cant find ext_state. In switch attributes I see only

Oh… Thank you for your attentiveness and for the report. I added a fix to the branch.

Good Morning,

I don’t know why, but it is impossible for me to configure this integration in Home Assistant. I have tried to install it through HACS, manually … with stock firmware, with custom firmware … and there is no way it works. I put everything according to the repository instructions:

ble_monitor:
  rounding: True
  decimals: 1
  period: 60
  log_spikes: False
  use_median: False
  active_scan: False
  hci_interface: 0
  batt_entities: False
  discovery: True
  report_unknown: False
  devices:
    - mac: 'XX:XX:XX:XX:XX:XX'
      name: 'Termohigrometro 1'
      encryption_key: 'XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx'
    - mac: 'XX:XX:XX:XX:XX:XX'
      name: 'Termohigrometro 2'
      encryption_key: 'XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx'

But I always end up with the same message: “Invalid config. The following integrations and platforms could not be set up: ble_monitor.sensor. Please check your config.”

I am running Home Assistant on a Raspberry Pi 3B + through a docker container.
Can anyone give me any ideas? Is there a way to see, somewhere, why it won’t install?

Hi,

I had a similar error. Remove the Caps in “True” and “False” and leave without them, so change them to “true” and “false”

Regards,

Hmmm… Do you know the details of why this happens? In my configuration all True and False are capitalized and I have no problem with that. And I have never heard of such a thing before…

@mesoulrock, which version of the component are you trying?

Hi @magalex, to me maybe was a coincidence, but after that, the debug message of error dissapeared. By the way the RJ-45 extension that you shared in a previous message I think are great, cheaper and in the future I’ll purchase one of those. Thanks for that suggestion.

1 Like

Have you tried doing a configuration check before restarting? (Advanced mode must be enabled in your HA profile).

Good evening everyone, and thanks for replying.

@juansa, I have tried to make the changes that you tell me and unfortunately the problem has not been solved, in my case.

@magalex, right now I’m on HA version 0.114.4, and I’m testing with BLE Monitor integration 0.8.5.

By the way, thank you very much for telling me how to activate the advanced options, I had been wondering for a long time why I was not able to verify the configuration … :slight_smile: I was always restarting HA and seeing if it gave me errors in Notifications.
The configuration as I have it gives me as correct, but it still does not work for me.

Hm. 0.114… Perhaps the point is some kind of incompatibility, introduced since 0.114… I usually test with the current at the moment release version.
@Ernst, do you have any ideas on this?