Passive BLE Monitor integration (Xiaomi Mijia BLE MiBeacon monitor)

Thank you I’ll see if I can find something.

1 Like

If you do, please share, I’d be interested in it too…

Hi @Magalex . Thanks for sharing your nice work. I really liked the idea of faster temperature updates. Unfortunately, in my case, the battery consumption of the sensor (LYWSDCGQ) was significantly increased after I enabled your component. It got from 34% to 2% in two and a half days. Take a look at this chart from Grafana:

The yellow line is the battery level after I enabled your component (tracked through the battery_level attribute of the mi_h_xxxxxxxx sensor). The preceding green line is the battery sensor from the official integration which is clear that did not have this issue. I changed the battery and enabled back the official integration and seems to be steady at 73% now.

I am on HassOS 4.10 (HA 0.111.4) hosted on a Rasbberry PI 4 (4GB) and I installed version 0.6.8 of your component through HACS. The sensor is placed very close (50cm) to the PI and I got about 23 readings per minute according to the “last mean/median of” attribute.

My configuration:

  - platform: mitemp_bt
    rounding: True
    decimals: 2
    period: 30
    log_spikes: False
    use_median: True
    active_scan: False
    hci_interface: 0
    batt_entities: False
    report_unknown: False
    whitelist: 
      - 'XX:XX:XX:XX:XX:XX'

Have you (or anyone else) seen this before? It seems like it performs an active scan in my case.

Hello everyone, I registered here because this is the only forum in which the Xiaomi sensors LYWSD03MMC are discussed.
I don’t run a home assistant but a homebridge, but maybe there is someone here who is also familiar with homebridge.
I try to integrate the sensors into my homekit via Homebridge but unfortunately without success.
I managed to determine the bindKey and also inserted it into the config.jason together with the MAC address.
But unfortunately the sensors do not show me any values or have no answer.
Maybe someone has advice for me and can help me.
Thanks in advance.

Hello, I have updated HA to the latest version and since then I find this problem in the LOG and the batt or temperature sensor does not work, but does the Humidity sensor?

Any solution?? Thank you!!

image

same errors for me and some devices refuse to appear in HA despite sudo hcitool lescan seeing them loud and clear.

2020-07-02 11:56:14 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/mitemp_bt/sensor.py", line 775, in update_ble
    discover_ble_devices(config, aeskeys, whitelist)
  File "/config/custom_components/mitemp_bt/sensor.py", line 683, in discover_ble_devices
    sensors[t_i], mac, config, temp_m_data[mac]
  File "/config/custom_components/mitemp_bt/sensor.py", line 499, in calc_update_state
    entity_to_update.schedule_update_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 416, in schedule_update_ha_state
    assert self.hass is not None
AssertionError
  - platform: mitemp_bt 
    rounding: True
    decimals: 0
    period: 60
    log_spikes: False
    use_median: False
    encryptors:
      '58:2D:34:52:4F:09': '9D0B1D00841E8067B3D7A10790EBA896'

was working a week ago before a rebuild

Hi to all! Unfortunately, I will not be able to take a close look at this problem, as I am on a business trip, and I will not have access to my system for several more days (maybe a week). As said in this topic, the latest beta works with 0.112. There are a lot of serious changes in it - let’s hope that there are no other problems… But I can say that before leaving on a business trip, this beta was pretty stable on my system.

Thanks for all your work, if it helps you in my case of the three sensors, only the humidity one is working for me, neither temperature nor battery level gives me information.

We await your news or updates. Thank you!

take your time we appreciated everything you do.

yeah latest beta work

Guide Time.
in HACS uninstall this and reinstall but flip switch and choose beta.

Ok, Now I will try when I get home! Thank you

image

OK!!! Work´s fine for me, but battery sensor still does not show me information, with the previous version the BETA did not take long to give me battery information but at the moment it is not updated.

But it is true that the error no longer appears in the Home Assistant log.

Did you wait for at least two hours? I read this on Github:

Well, it can take up to an hour for battery-status to show up. It is in the documentation!
The way this plugin works, is that it just listens, it never interacts with the sensors. The sensors broadcast temp and humidity every 10 minutes, and battery every hour. So, if you just missed the last broadcast for battery, you will have to wait an hour for the next one!
This way, the battery will not get drained every 3 months or so, as it can with repeated interaction with the sensors, like the app does, or some other plugins.

Source: Lost Connection with LYWSDCGQ after upgrade to HA 0.112 · Issue #88 · custom-components/ble_monitor · GitHub

Ok, thanks!!

Work, for me.

Why can my sensors have missing history?
Integrated and showing temp/hum/bat without problem, but when i try to check history - data not found.
i am using 2 LYWSD03MMC

Missing history normally means, you have excluded / included specific domains. :slight_smile: As I see, you’re new here, so let me explain that a bit further.

There are three components in HA that take care of all the saved data: recorder, history and logbook. Check the documentation for recorder on how to include/exclude specific entries.
You can find it here:

Exactly! My fault, sorry newbie mistakes i forgot about recorder setup.
Now everything up and running!
Thank you very much!

You’re very welcome! :slight_smile: If just all problems could be solved that easily. :smiley: :smiley: :smiley:

I too can confirm that after the 112 update, our add-on was broken but a simple uninstall and reinstall of the beta has fixed it - all is well again :smiley:.

After been busy with this for 2 whole days and trying a lot of different things I have found a solution and I wish to share it with you guys.
I have attached my tutorial in this PDF. Let me know if you find any issues.

This document is for the LYWSD03MMC with it’s encryptors, but might also work for other devices with encryptors.

Thanks! Tycho Werner :star_struck:

2 Likes