Passive BLE Monitor integration (Xiaomi Mijia BLE MiBeacon monitor)

Do you search exactly by bitbind? You must search by bltbind. Small L instead of i.

That helps alot I got the file now I need something to read it notepad ++ shows all the html characters

Hmm getting invalid option for batt_entities and rounding from config checker?

According to the latest info IN HACS these are valid options
Acting like its is still seeing the built-in mitemp_bt
Never mind apparently I forgot to restart after install HACS
All is Good

Hi, it is just me or are the others having problems with the integration since last HA update Supervisor/OS

?

Details journal (ERROR)

Logger: custom_components.mitemp_bt.sensor
Source: custom_components/mitemp_bt/sensor.py:131
Integration: mitemp_bt (documentation)
First occurred: 10:02:53 (4 occurrences)
Last logged: 10:05:57

HCIdump thread: OS error: [Errno 19] error while attempting to bind on interface 0: No such device Detalii jurnal (ERROR)

Same issue here On Rpi 3B+ with HassOS.
Last version working was 2.12 (HomeAssistant versione doesn’t matter).
After that I always receive this message:

ERROR (Thread-101) [custom_components.mitemp_bt.sensor] HCIdump thread: OS error: [Errno 19] error while attempting to bind on interface 0: No such device

I tried also to install on the same hardware:

  1. Home Assistant Core on Raspberry Pi OS
    Raspberry Pi OS (32-bit) Lite (ex Raspbian)
    Linux raspberrypi 4.19.118-v7+ #1311 SMP Mon Apr 27 14:21:24 BST 2020 armv7l GNU/Linux
    Kernel version: 4.19
    Home Assistant 0.110.7
    and worked fine

  2. Hass.io on Docker (Docker version 19.03.11, build 42e35e6)
    Raspberry Pi OS (32-bit) Lite (ex Raspbian)
    Linux raspberrypi 4.19.118-v7+ #1311 SMP Mon Apr 27 14:21:24 BST 2020 armv7l GNU/Linux
    Kernel version: 4.19
    Home Assistant 0.111.0
    System Raspbian GNU/Linux 10 (buster)
    Supervisor Version 227
    docker_version 19.03.11
    and worked fine

So I think that the issue is due to Hass.OS after 2.12 version.

@schilea @ilfandango
I’m on a business trip right now. I’ll be able to see your situation in a few days…

Hi @Magalex thank you for this great work! Do you think it will be possible to activate/deactivate WX08ZM from HA? Thank you.

2 Likes

@schilea @ilfandango I am not aware of such cases of denial of work. The essence of your problem is that the operating system does not have the bt-interface hci0.
Yes, the problem is at the operating system level… The only thing I can add to this is the fact that on my test system (RPi3b+) with HassOS 3.13 I did not experience any problems. In addition, as I understood from the changelog, in HassOS 4 there was something fixed regarding bluetooth. Have you tried version 4.10 (it also had a kernel version rollback)?

Due to the passivity of the component (it only receives data), at the moment it cannot control devices (I think this situation will not change in the near future).
The only potential way that I see at the moment is to use external scripts or utilities. I think it’s worth looking at github for a script or utility that can work with this device and trying to implement it in HA through Shell Command.

Thanks @Magalex. My RPi4 is in HassOS 4.10. This happened after upgrading from 3 to 4.

First of all, thanks for your effort and support :slight_smile:

Today I started again with some test and I tried (with another SD) a new installation Raspbian buster lite and HA and they worked.
I tried also a middle ground solution with a docker HassIO on the same Raspbian write above and worked.
I was going crazy so I throw in the towel and I’ve removed the SD with Raspbian and install the old SD with HassOs… and magic is happened… the same SD with HassOS 4.10 that did not work before… now work.
Really, I had done at least 10 reboots in the past days and it never worked. Thanks again!

Seems this could be a solution but I don’t have the nerve to reinstall all again, even with a snapshot. Fortunately I have a back up solution with ESPHome that works and keep using this until the next upgrade. Who knows, maybe it will be solved by then.

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.