core: xiaomi ble temperature and humidity sensor polling error

Home Assistant release with the issue:

0.84.2

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io

Component/platform:

https://www.home-assistant.io/components/sensor.mitemp_bt/

Description of problem: Polling error Could not read data from Mi Temp sensor 4C:65:A8:DA:89:E3

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

   - platform: mitemp_bt
     mac: '4C:65:A8:DA:**:**'
     monitored_conditions:
      - temperature
      - humidity
      - battery

Traceback (if applicable):

Polling error Could not read data from Mi Temp sensor 4C:65:A8:DA:**:**

Additional information: even if the sensor is at 2cm from pi3 don’t work. i’ve tried everything my config was ok (triple check) and the mac was the right one.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 45

Most upvoted comments

With the following command you can edit systemd unit files. sudo systemctl edit bluetooth.service There just insert those lines… Further Info on systemd: https://manpages.debian.org/jessie/systemd/systemd.service.5.en.html https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

Home Assistant release with the issue: 0.92.0

Last working Home Assistant release (if known): Not known, as I was using xiaomi_hygrothermo in the past.

Operating environment (Hass.io/Docker/Windows/etc.): Linux (Armbian)

Component/platform: https://www.home-assistant.io/components/sensor.mitemp_bt/

Description of problem: After new start of Home Assistant, everything is working nice. After 2-4 hours the Polling error [Errno 32] Broken pipe is visible in the log and there there is no readout any more. The line on the graph stays flat. Home assistant restart is required (but, all other bluetooth devices work, so even if there are some BT issues, the other subsystems keep working). I have two such devices, which behave in the same way,

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

 - platform: mitemp_bt
    name: p0 floor
    mac: '4C:65:A8:xx'
    scan_interval: 60
    median: 2
    timeout: 60
    retries: 3

Traceback (if applicable):

_Polling error
12:32 AM components/mitemp_bt/sensor.py (WARNING)_
and later
_Polling error [Errno 32] Broken pipe
1:14 AM components/mitemp_bt/sensor.py (WARNING)_

Additional information: In the past I was using the xiaomi_hygrothermo custom component, which was working fine, but stopped working (at all - does not start with “not found” error) with the latest update (unknown reason). Therefore I switched to mitemp_bt, which is built in and provides nice features (like median).

Extra info: My system consists of ~10 bluetooth devices (BT and BLE), and one USB BT transmitter with self made antenna. There are always issues with the BT (on linux and windows), but there is no other way for me. I have low signal, connection losses, etc, but other subsystems catch the errors properly and do not die like this 😃

At the moment I will try to switch back to hygrothermo.

The problem still persists even with 0.99.3 Works for couple of hours and then there are no updates.

I was follwing this issue for some time and also tried other solutions to narrow down the cause of the instabilities. for me it seems that this issue and #24313 and #24792 are about the same cause… My installation (raspbian, docker, hass 0.100.3) finally seems to be running stable IF I restart the bluetooth.service on the host (raspbian) regulary (like every day). Therefore I adjusted the systemd file with:

[Service]
Restart=always
RuntimeMaxSec=86400

I know, not a final solution, but a workaround I can live with…

I confirm: looks like it’s not fixed on the latest 0.97 release 😦

looks like it’s not fixed on the latest 0.97 release 😦

seems to be getting worse too, some don’t even update on reboot now.

I have the same issue. Time until failure is completely variable, sometimes it seems to work for a few days other times a few hours. I’ve tried both the Pi3 internal Bluetooth and a USB Bluetooth adapter, with the device ~20cm away. The device is still visible and connectable from bluetoothctl in the HassOS 2.12 host / developer SSH.