Passive BLE Monitor integration (Xiaomi Mijia BLE MiBeacon monitor)

If the key does not fit, then an error is recorded in the log as you had above.
If there are no errors, then in the case of LYWSD03MMC, before worrying, you have to wait about 10 minutes after rebooting (data may appear earlier).
The status “unknown” will be every time after reboot. If it bothers you, then see the option restore_state.

Great, well … in principle, solved!
There is a battery sensor that does not respond, but it is the least.

Ok, so … to end for today.
Why is it that it did not work for me (to take it into account for future times that I have to integrate it)?
Should I keep the files you have given me to replace them in future installations?

Yes, this archive is specifically intended for HA versions prior to 0.115 due to breaking changes (introduced in HA 0.115).
If you upgrade to a later version of HA, then the current versions of the component will work, and the archive is no longer needed (but will work too). We will think about bringing back support for old HA versions to the current component branch, but I don’t promise anything yet.

Okay @magalex, once again … thank you very much. Congratulations, you do a great job.

@Magalex and it is possible to integrate such a lamp into the ble_monitor component ? - https://aliexpress.ru/item/1005001733233349.html

I did not find the marking of this lamp in the description. At first I wanted to answer “I don’t know”, but now I think that the answer to your question is “no”, since our component does not allow controlling devices, it only listens to the broadcasts. In addition, the Bluetooth Mesh marking is somewhat alarming, since I do not know what the exchange of data between devices in the Mijia ecosystem using this protocol looks like.

they exchange a lot of auth/keys stuff all the time. if you have mgl03 hub you can see the logs.

I’m using the Iphone 6s and cannot find the Stream app in the Store. Is there any alternative Ios App?

The only iOS alternative I know of is Charles proxy (paid).
Checked it now on my phone - the Stream is still available despite not being easy to find. Here is a link to the Russian app store - https://apps.apple.com/ru/app/stream/id1312141691 (try changing the country code in the link).

We have made an amazing new release which is available now. Thanks to @koying, version 0.9.3 has full support for configuration in the UI of Home Assistant, so no need to configure in YAML anymore. And for those who still do want to use YAML for their configuration, don’t worry, you can still use it like before.

Adding the configuration in the UI also added the option for ble_monitor to show devices in the UI, which groups all sensors per device and allows you to rename devices (and corresponding sensor entities) when using the configuration in the UI. Use the cog-wheel image (top right corner) in the device window to rename your device. Note that when you are using YAML, its better to rename devices in your YAML.

image

We also made some improvements for the Kettle devices and added an ext_state attribute, with the following values:

  • 0 - kettle is idle
  • 1 - kettle is heating water
  • 2 - warming function is active with boiling
  • 3 - warming function is active without boiling
4 Likes

ClearGrass CGG1H Temperature & Humidity Sensor, Homekit version is supported?
I have 2pcs, and could not see anything in log from these (in hours).
(booth configured and shows temp/humidity in Apple/Home)

2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] Initializing BLE Monitor entry (config entry): <homeassistant.config_entries.ConfigEntry object at 0xb471bf28>
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: domain {}
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: {'hci_interface': [0], 'period': 60, 'discovery': True, 'active_scan': True, 'report_unknown': True, 'batt_entities': True, 'rounding': True, 'decimals': 2, 'log_spikes': False, 'use_median': False, 'restore_state': True, 'devices': [{'mac': '58:2D:34:11:5C:42', 'temperature_unit': '°C'}, {'mac': '58:2D:34:11:67:0B', 'temperature_unit': '°C'}], 'is_flow': True}
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] HCI interface is [0]
2020-12-18 11:36:37 INFO (MainThread) [custom_components.ble_monitor] Attention! Option report_unknown is enabled, be ready for a huge output...
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] Spawning HCIdump thread
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: Init
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] Attention! Option report_unknown is enabled, be ready for a huge output...
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] 0 encryptors mac:key pairs loaded.
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] whitelist: []
2020-12-18 11:36:37 DEBUG (MainThread) [custom_components.ble_monitor] 0 whitelist item(s) loaded.
2020-12-18 11:36:37 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Run
2020-12-18 11:36:37 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: connected to hci0
2020-12-18 11:36:37 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Starting binary sensor entry startup
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialization
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialized
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary sensor entry setup finished
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary entities updater loop started!
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Starting measuring sensor entry startup
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialization
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialized
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Measuring sensor entry setup finished
2020-12-18 11:36:38 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Entities updater loop started!
2020-12-18 11:37:38 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 MiBeacon BLE ADV messages processed for 0 binary sensor device(s) total. Priority queue = 0
2020-12-18 11:37:39 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 MiBeacon BLE ADV messages processed for 0 measuring device(s).
2020-12-18 11:37:39 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing
2020-12-18 11:37:39 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2020-12-18 11:37:39 DEBUG (Thread-3) [custom_components.ble_monitor] 1893 HCI events processed for previous period.
2020-12-18 11:37:39 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Run
2020-12-18 11:37:39 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: connected to hci0
2020-12-18 11:37:39 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: start main event_loop

No, unfortunately not. We think it uses a different protocol to communicate. We had an issue from another user, but that user decided to buy the other version. So we didn’t look into it further. You might open a new issue and provide the logs with the report_unknown option set to true, but dont expect too much.

Hi

I installed it via HACS but since I restarted my HA HACS is disabled and ask me to check the log.
The log shows the following for HACS

Config entry for hacs not ready yet. Retrying in 5 seconds
Config entry for hacs not ready yet. Retrying in 10 seconds
Config entry for hacs not ready yet. Retrying in 20 seconds
Config entry for hacs not ready yet. Retrying in 40 seconds
Config entry for hacs not ready yet. Retrying in 80 seconds

I also have this in the log

You are using a custom integration for ble_monitor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.```

Looks like an issue with HACS, I don’t think it’s related to ble_monitor. The message regarding ble_monitor is a standard warning message, which is given for each custom component.

I think you have to check your HACS configuration or reinstall HACS.

Thanks for the reply.
I guess you were right, HACS is now fine, I don’t know what really happened.

Anyways, seems like HACS is running but I can’t find the Passive BLE in the UI.
Any advise?

I checked via samba and I can see the ble_monitor folder in the custom_components folder

Try to reinstall it in hacs. Possibly something went wrong. After a restart you should be able to add the integration.

You may not have tried to “activate” the integration. HACS only installs it, it does not include it in the HA configuration - you have to do it yourself.

Thanks, when posted here I couldn’t find it in the Integrations section under new integration.
Later that day I tried again and it appeared… don’t know what changed… but anyways now it works and my BT sensors update more often and more reliable.

Thanks!

Hi all!

I have some questions concerning this integration.
When you say

this custom component is parsing the Bluetooth Low Energy packets payload that is constantly emitted by the sensor.

Do you mean that data are in advertising and not in services?

In fact, I don’t plan to use your integration with Xiaomi sensor but with an home made one, I will create based on a Nordic nRF52 chip, and I plan to copy the Xiaomi sensor behavior, in order to get an Home Assistant integration.

Does it make sense for you?

Hello! Yeah, we’re talking about BLE advertisements.
There will be no problems in implementing support for your device if the payload is in the Mijia BLE MiBeacon format. You don’t have to do anything extra if your device mimics one of the already supported sensors.