custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.89k stars 243 forks source link

[Bug]: Sensors not updating as frequent as they did #850

Closed JohanEikelenboom closed 2 years ago

JohanEikelenboom commented 2 years ago

What happened?

I’m using the BLE_Monitor for a long time now and my temperature sensors (Xiaomi LYWSDCGQ) were updating every minute. Since some time (a couple of weeks), the update is very irregular. This varies between 4 minutes and over an hour. They used to update every minute.

The home-assistant.log gives the error message below every minute.

I'm running the latest HassOS with all the latest updates installed

Since I’m also using these sensors to controle my heating, this is kind of annoying…

Does anyone know what is going on here?

If more information is needed, please let me know. Currently I have no clue in where to start looking…

Sensor type

Xiaomi LYWSDCGQ

Relevant log output

2022-04-29 20:03:57 ERROR (Thread-3) [homeassistant] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 870, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.9/site-packages/aioblescan/aioblescan.py", line 1855, in data_received
    self.process(packet)
  File "/config/custom_components/ble_monitor/__init__.py", line 662, in process_hci_events
    sensor_msg, tracker_msg = self.ble_parser.parse_data(data)
  File "/config/custom_components/ble_monitor/ble_parser/__init__.py", line 293, in parse_data
    sensor_data = parse_inkbird(self, man_spec_data, complete_local_name, mac, rssi)
  File "/config/custom_components/ble_monitor/ble_parser/inkbird.py", line 137, in parse_inkbird
    "type": device_type,
UnboundLocalError: local variable 'device_type' referenced before assignment
JohanEikelenboom commented 2 years ago

Looks like the issue is solved. The steps I took to solve the issue is to go to the configuration of the BLE Monitor integration, select the unknown devices (or not owned) devices and unchecking "Discover devices and sensors automatically". This, at least for now, seems to solve the issue