Most of the common problems are covered in our FAQ.
Read it carefully (if you haven’t already), and try to exclude possible problems from the described ones that fit your case.
At the end of the FAQ it is written how to enable the debug log for a component. In the case of LYWSD03MMC, it is worth accumulating more than 10 minutes of log. Drop the log here - we’ll see if there is anything suspicious.
Nothing in the log about mitemp except “not tested it might be not working”
what is weird is “hcitool dev” is command not found for me
Have you turned on the debug logging as described at the bottom of the FAQ?
Yep here it is:
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] Starting
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:51:32 DEBUG (Thread-3) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] 0 encryptors mac:key pairs loaded.
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] 6 whitelist item(s) loaded.
2020-11-02 15:51:32 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] whitelist: [b"\xd3\xd8]\xeb'\xb8", b'\xcb\xb4\xda\xd7\xc1\\', b'\xaf\x0f^\xe5\xfc$', b"\xd3\xd8]\xeb'\xb8", b'\xcb\xb4\xda\xd7\xc1\\', b'\xaf\x0f^\xe5\xfc$']
2020-11-02 15:51:32 DEBUG (Thread-3) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:51:33 DEBUG (Thread-3) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:51:33 DEBUG (Thread-3) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:51:33 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:51:33 DEBUG (SyncWorker_10) [custom_components.mitemp_bt.sensor] First run, skip parsing.
2020-11-02 15:51:36 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get capabilities from 192.168.1.16: timeout
2020-11-02 15:51:36 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 192.168.1.16: cannot connect
2020-11-02 15:51:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/shelly/__init__.py", line 194, in start_up
pys.start()
File "/usr/local/lib/python3.8/site-packages/pyShelly/__init__.py", line 130, in start
self._mqtt.start()
File "/usr/local/lib/python3.8/site-packages/pyShelly/mqtt.py", line 98, in start
self._init_socket()
File "/usr/local/lib/python3.8/site-packages/pyShelly/mqtt.py", line 104, in _init_socket
sock.bind((self._root.bind_ip, self._root.mqtt_port))
OSError: [Errno 98] Address in use
2020-11-02 15:51:43 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook
2020-11-02 15:52:33 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:52:33 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 15:52:33 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 15:52:33 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 15:52:33 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 15:52:33 DEBUG (Thread-3) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 15:52:34 DEBUG (Thread-3) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 15:52:34 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 15:52:34 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:52:34 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:52:34 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:52:34 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:52:34 DEBUG (Thread-12) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:52:34 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:52:34 DEBUG (Thread-12) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:52:34 DEBUG (Thread-12) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:52:34 DEBUG (Thread-12) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:52:34 DEBUG (SyncWorker_19) [custom_components.mitemp_bt.sensor] Finished. Parsed: 739 hci events, 0 xiaomi devices.
2020-11-02 15:52:37 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.18355330840d8e5f4fa6_1 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 255, in update
self._tuya.update()
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/switch.py", line 16, in update
return self._update(use_discovery=True)
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/base.py", line 84, in _update
devices = self.api.discovery()
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 188, in discovery
response = self._request("Discovery", "discovery")
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 267, in _request
self._raise_frequently_invoke(
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 292, in _raise_frequently_invoke
raise TuyaFrequentlyInvokeException(message)
tuyaha.tuyaapi.TuyaFrequentlyInvokeException: Method [Discovery] fails 1 time(s) using poll interval 60.0 - error: you can discovery once in 600 seconds
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 15:53:34 DEBUG (Thread-12) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 15:53:34 DEBUG (Thread-12) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:53:34 DEBUG (Thread-13) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:53:34 DEBUG (Thread-13) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:53:34 DEBUG (Thread-13) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:53:34 DEBUG (Thread-13) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:53:34 DEBUG (SyncWorker_42) [custom_components.mitemp_bt.sensor] Finished. Parsed: 679 hci events, 0 xiaomi devices.
2020-11-02 15:54:07 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.18355330840d8e5f4fa6_1 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 255, in update
self._tuya.update()
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/switch.py", line 16, in update
return self._update(use_discovery=True)
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/base.py", line 84, in _update
devices = self.api.discovery()
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 188, in discovery
response = self._request("Discovery", "discovery")
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 267, in _request
self._raise_frequently_invoke(
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 292, in _raise_frequently_invoke
raise TuyaFrequentlyInvokeException(message)
tuyaha.tuyaapi.TuyaFrequentlyInvokeException: Method [Discovery] fails 2 time(s) using poll interval 60.0 - error: you can discovery once in 600 seconds
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 15:54:34 DEBUG (Thread-13) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 15:54:34 DEBUG (Thread-13) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:54:34 DEBUG (Thread-14) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:54:34 DEBUG (Thread-14) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:54:34 DEBUG (Thread-14) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:54:34 DEBUG (Thread-14) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:54:34 DEBUG (SyncWorker_33) [custom_components.mitemp_bt.sensor] Finished. Parsed: 611 hci events, 0 xiaomi devices.
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 15:55:34 DEBUG (Thread-14) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 15:55:34 DEBUG (Thread-14) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:55:34 DEBUG (Thread-15) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:55:34 DEBUG (Thread-15) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:55:34 DEBUG (Thread-15) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:55:34 DEBUG (Thread-15) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:55:34 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Finished. Parsed: 634 hci events, 0 xiaomi devices.
2020-11-02 15:55:37 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.18355330840d8e5f4fa6_1 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 255, in update
self._tuya.update()
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/switch.py", line 16, in update
return self._update(use_discovery=True)
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/base.py", line 84, in _update
devices = self.api.discovery()
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 188, in discovery
response = self._request("Discovery", "discovery")
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 267, in _request
self._raise_frequently_invoke(
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 292, in _raise_frequently_invoke
raise TuyaFrequentlyInvokeException(message)
tuyaha.tuyaapi.TuyaFrequentlyInvokeException: Method [Discovery] fails 3 time(s) using poll interval 60.0 - error: you can discovery once in 600 seconds
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 15:56:34 DEBUG (Thread-15) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 15:56:34 DEBUG (Thread-15) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:56:34 DEBUG (Thread-16) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:56:34 DEBUG (Thread-16) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:56:34 DEBUG (Thread-16) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:56:34 DEBUG (Thread-16) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:56:34 DEBUG (SyncWorker_8) [custom_components.mitemp_bt.sensor] Finished. Parsed: 635 hci events, 0 xiaomi devices.
2020-11-02 15:57:07 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.18355330840d8e5f4fa6_1 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 255, in update
self._tuya.update()
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/switch.py", line 16, in update
return self._update(use_discovery=True)
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/base.py", line 84, in _update
devices = self.api.discovery()
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 188, in discovery
response = self._request("Discovery", "discovery")
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 267, in _request
self._raise_frequently_invoke(
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 292, in _raise_frequently_invoke
raise TuyaFrequentlyInvokeException(message)
tuyaha.tuyaapi.TuyaFrequentlyInvokeException: Method [Discovery] fails 4 time(s) using poll interval 60.0 - error: you can discovery once in 600 seconds
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 15:57:34 DEBUG (Thread-16) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 15:57:34 DEBUG (Thread-16) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:57:34 DEBUG (Thread-17) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:57:34 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:57:34 DEBUG (Thread-17) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:57:34 DEBUG (Thread-17) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:57:34 DEBUG (Thread-17) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:57:35 DEBUG (SyncWorker_40) [custom_components.mitemp_bt.sensor] Finished. Parsed: 577 hci events, 0 xiaomi devices.
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 15:58:35 DEBUG (Thread-17) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 15:58:35 DEBUG (Thread-17) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:58:35 DEBUG (Thread-18) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:58:35 DEBUG (Thread-18) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:58:35 DEBUG (Thread-18) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:58:35 DEBUG (Thread-18) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:58:35 DEBUG (SyncWorker_15) [custom_components.mitemp_bt.sensor] Finished. Parsed: 599 hci events, 0 xiaomi devices.
2020-11-02 15:58:37 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.18355330840d8e5f4fa6_1 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 255, in update
self._tuya.update()
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/switch.py", line 16, in update
return self._update(use_discovery=True)
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/base.py", line 84, in _update
devices = self.api.discovery()
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 188, in discovery
response = self._request("Discovery", "discovery")
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 267, in _request
self._raise_frequently_invoke(
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 292, in _raise_frequently_invoke
raise TuyaFrequentlyInvokeException(message)
tuyaha.tuyaapi.TuyaFrequentlyInvokeException: Method [Discovery] fails 5 time(s) using poll interval 60.0 - error: you can discovery once in 600 seconds
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 15:59:35 DEBUG (Thread-18) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 15:59:35 DEBUG (Thread-18) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 15:59:35 DEBUG (Thread-19) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 15:59:35 DEBUG (Thread-19) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 15:59:35 DEBUG (Thread-19) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 15:59:35 DEBUG (Thread-19) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 15:59:35 DEBUG (SyncWorker_6) [custom_components.mitemp_bt.sensor] Finished. Parsed: 582 hci events, 0 xiaomi devices.
2020-11-02 16:00:07 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.18355330840d8e5f4fa6_1 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 255, in update
self._tuya.update()
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/switch.py", line 16, in update
return self._update(use_discovery=True)
File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/base.py", line 84, in _update
devices = self.api.discovery()
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 188, in discovery
response = self._request("Discovery", "discovery")
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 267, in _request
self._raise_frequently_invoke(
File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 292, in _raise_frequently_invoke
raise TuyaFrequentlyInvokeException(message)
tuyaha.tuyaapi.TuyaFrequentlyInvokeException: Method [Discovery] fails 6 time(s) using poll interval 60.0 - error: you can discovery once in 600 seconds
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
2020-11-02 16:00:35 DEBUG (Thread-19) [custom_components.mitemp_bt.sensor] HCIdump thread: main event_loop stopped, finishing
2020-11-02 16:00:35 DEBUG (Thread-19) [custom_components.mitemp_bt.sensor] HCIdump thread: Run finished
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] HCIdump thread: joined
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] Spawning HCIdump thread(s).
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] HCIdump thread: Init
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] HCIdump thread: Init finished
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] Starting HCIdump thread for hci0
2020-11-02 16:00:35 DEBUG (Thread-20) [custom_components.mitemp_bt.sensor] HCIdump thread: Run
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] HCIdump threads count = 1
2020-11-02 16:00:35 DEBUG (Thread-20) [custom_components.mitemp_bt.sensor] HCIdump thread: Connection
2020-11-02 16:00:35 DEBUG (Thread-20) [custom_components.mitemp_bt.sensor] HCIdump thread: Connected
2020-11-02 16:00:35 DEBUG (Thread-20) [custom_components.mitemp_bt.sensor] HCIdump thread: start main event_loop
2020-11-02 16:00:35 DEBUG (SyncWorker_21) [custom_components.mitemp_bt.sensor] Finished. Parsed: 581 hci events, 0 xiaomi devices.
2020-11-02 16:01:35 DEBUG (SyncWorker_28) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 16:01:35 DEBUG (SyncWorker_28) [custom_components.mitemp_bt.sensor] Discovering Bluetooth LE devices
2020-11-02 16:01:35 DEBUG (SyncWorker_28) [custom_components.mitemp_bt.sensor] Time to analyze...
2020-11-02 16:01:35 DEBUG (SyncWorker_28) [custom_components.mitemp_bt.sensor] Getting data from HCIdump thread
2020-11-02 16:01:35 DEBUG (SyncWorker_28) [custom_components.mitemp_bt.sensor] HCIdump thread: joining
According to the log, the component is working fine.
If I understand correctly, you have several LYWSD03MMC type sensors with custom firmware. I have been away for a long time, so I am not aware of the specifics of working with custom firmware - I will need time to study this. So far, I have noticed only one important nuance - sensors must be flashed with the MiLike
option enabled, and it may be necessary to reapply the settings after resetting the sensor (when replacing the battery, for example). Discussion here.
Tell me if in the course of your experiments there was at least one time when everything worked well. To paraphrase - everything worked and broke after some changes, or have you never seen the sensors readings in HomeAssistant?
Also, tell us more about your hardware - what kind of platform and what kind of bluetooth module is used.
Hi, I just wanted to thank all people involved in making this possible.
I am new to Home Assistant.
I been fighting over the weekend to get 4 Humidity & Temperature sensors from Xiaomi (LYWSD03MMC models) to play nice with a HA installation on a Raspberry Pi zero W (Yes, I know it is quite limited and -painfully- slow for HA, but for my purposes is more than I need).
For the sake of clarity, as there are different ways to get HA running in Raspberry Pi; the method I used for installing it was by flashing the Home Assistant OS image (not the manual installation in a Raspbian OS system).
Since I learned of some of the issues, the hard way, I thought I would just mention a few of the key points here for those who are in a similar position:
-
I flashed all the sensors with the custom firmware available [HERE] (https://github.com/atc1441/ATC_MiThermometer) and the Telink flasher made by the Custom Firmware author. Kudos to the guy who made it possible as he made it super simple (OTA) and secure.
-
It is extremely important that the advertising type for the sensor is set to “Mi Like”, after flashing the CF, or otherwise the HA will not pick the BT data signal at all and the sensors will not appear in the HA dashboard…
-
The “Encryptors” variables from the configuration.yaml file in HA needs to be removed completely or commented out. Leaving the encryptors variable and the MAC addresses assigned to a blank value ("") will still make the configuration file invalid.
-
The " hci_interface" variable must be set to 1 as the default value (“0”) will not work for the Pi Zero W. This is extremely important and probably the issue which took longest to figure out.
And that is pretty much it. I hope this can save some headaches to those of you trying this out on a Raspberry Pi Zero W.
By the way, on a not-so-much related matter, I think i fckd the BT emitter from one of the Temp/Humidity sensors. I wanted to fit one of it to the side of my fridge usina a flat neodymium magnet (the type that can be harvested from a 2.5" HD) inside of the back cover of the sensor. After testing this fixing method for a few seconds I realised the sensor had stopped being picked up by the HA. I also tried a BLE scanner / sniffer on my android phone and I am unable to find the original MAC address of the sensor. The sensor still displays the data as expected and seems to work normally otherwise, but I do not seem to be able to pick its BT signal in any way, which makes me think the magnet has done some permanent damage to the BT emitter module. Has anyone had a similar experience?
Thank you @wakaru for sharing your interesting experience. Tell me, what happened with default hci_interface value (zero)? Was there some kind of error in the log, or was there silence, and just nothing worked?
By the way, about the magnets. Personally, I have not heard of cases of failure of electronic devices due to exposure to a constant magnetic field. The only thing, it seems to me, that the reason for the breakdown may not be the presence of a magnet, but its rapid movement relative to the sensor. An alternating magnetic field can induce a current in the conductor for which this section of the circuit is not designed.
And LYWSDCGQ sensors come with a magnetic mount included. It is very convenient to change the battery (no need to tear anything off, and no need to change the double-sided tape).
Thanks for all your advices I’ll give it a try
I’ll try to enable MiLike option didn’t knew it was resetting after replacing battery
Well for no reason it works once with one sensor, I wanted to reload it because I had a bug on my lovelace’s card so I deleted the entity and since now nothing is working
Tried to put hci to 1, here’s what I got
2020-11-02 22:05:45 ERROR (Thread-3) [custom_components.mitemp_bt.sensor] HCIdump thread: OS error: [Errno 19] error while attempting to bind on interface 1: No such device
2020-11-02 22:05:46 DEBUG (SyncWorker_7) [custom_components.mitemp_bt.sensor] update_ble called
2020-11-02 22:05:46 DEBUG (SyncWorker_7) [custom_components.mitemp_bt.sensor] First run, skip parsing.
Yep already tried. Just tried MiLike option, restarted HA and still not working.
Returning to your log: as far as I can tell, the component is working correctly, it receives data from the bluetooth module, but does not find messages from known devices among them. There may be several reasons: incorrect addresses in the whitelist, the signal from the sensors does not reach the bluetooth module, the received data does not correspond to the Xiaomi protocol.
After restarting the HA, some time should pass, due to the fact that the sensors send data at regular intervals (in the case of the original LYWSD03MMC, this is about 10 minutes). Also, the sensors of the Xiaomi Mija ecosystem do not send their readings until the sensor is added to the official application (MiHome). I do not know how this point is solved in custom firmware. Maybe some additional actions are required after reflashing? I have not yet found anything indicating this.
Do I have to put something else in config ?
sensor:
- platform: mitemp_bt
hci_interface: 0
As far as I know the battery replacement resets the encryption key for the sensors running Official Firmware.
For custom Firmware, since the encryptors values are no longer needed to decrypt the encrypted broadcasted data; nothing is reset; so this should not be the problem. Most likely your issue is with not having set the advertisement type to “Mi Like” in the Telink Flasher.
I did set to Mi Like, still the same. And for to be sure, I reflashed it and set it up to Mi Like.
The default advertising interval for the custom firmware is faster (every 60 seconds) so these should appear a lot faster in the dashboard. Alternatively it can be increased/decreased with the flasher.
With the Custom Firmware you completely bypass the Official application (MiHome). I never even had it installed. I literally flashed the sensors with CF, installed HACS and the “Xiaomi passive BLE Monitor Sensor platform” from it, reboted the Raspberyr Pi Z W, edited the Configuration.yaml file with the relevant settings, another reboot, and the sensors appeared in the dashboard straightaway
I do not recall having gone through the logs in detail at the time to be honest.
Tomorrow I will enable logger for custom_components.mitemp_bt; set hci to 0 and reboot to make a log to put it here.
Here’s mine as sample:
sensor:
- platform: mitemp_bt
rounding: True
decimals: 1
period: 60
log_spikes: False
use_median: False
active_scan: False
hci_interface: 1
batt_entities: False
sensor_names:
'A4:C1:38:D1:B3:FA': 'LivingRoom'
'A4:C1:38:6C:BF:7C': 'Kitchen'
'A4:C1:38:3C:B5:4D': 'Office'
'A4:C1:38:7D:7F:E8': 'Bedroom'
report_unknown: False
whitelist: False
Do I have to put something else in config ?
In the simplest case, just the line - platform: mitemp_bt
is enough.
Just to be sure, how do you check for sensors?
Try Configuration → Entities → search by string “mitemp_bt”
Finally I got it working…
Went to github and found firmware that set mi like by default, reflashed it and it’s working fine now, I had nothing to do, sensor appared just after flashing it
For those who want the link: https://github.com/atc1441/ATC_MiThermometer/issues/37#issuecomment-720063545
Anyway thanks for your time !!
And BTW thanks for the compo