question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't see my fake Xiaomi temp sensor

See original GitHub issue

Hi team,

I planned to develop my own BLE sensor, giving temperature and humidity, based on a nRF52 chip. I make my own sensor, just for fun.

I managed to deal with service datas, and get a advertising very similar to the one given in https://github.com/custom-components/ble_monitor/blob/master/protocol.md


> HCI Event: LE Meta Event (0x3e) plen 37                   #31 [hci0] 2.914649
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: FA:BE:32:DD:0D:36 (Static)
        Data length: 25
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        Service Data (UUID 0xfe95): 5020aa0105360ddd32befa0d1004b2007502
        RSSI: -46 dBm (0xd2)

The only difference I can notice is the address type.

I installed ble_monitor through HACS, on a Home installation, in a python virtual env on a ubuntu server.

Here is the HA logs output:


2020-12-27 21:47:23 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: None
2020-12-27 21:47:23 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (before): {'hci_interface': [0], 'period': 60, 'discovery': True, 'active_scan': False, 'report_unknown': True, 'batt_entities': False, 'rounding': True, 'decimals': 1, 'log_spikes': False, 'use_median': False, 'restore_state': False, 'devices': [{'mac': 'FA:BE:32:DD:0D:36', 'temperature_unit': '°C', 'name': 'FABE32DD0D36'}], 'is_flow': True}
2020-12-27 21:47:30 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: {'hci_interface': ['0'], 'period': 60, 'discovery': True, 'active_scan': False, 'report_unknown': True, 'batt_entities': False, 'rounding': True, 'decimals': 1, 'log_spikes': False, 'use_median': False, 'restore_state': False, 'devices': 'FA:BE:32:DD:0D:36'}
2020-12-27 21:47:30 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (after): {'hci_interface': ['0'], 'period': 60, 'discovery': True, 'active_scan': False, 'report_unknown': True, 'batt_entities': False, 'rounding': True, 'decimals': 1, 'log_spikes': False, 'use_median': False, 'restore_state': False, 'devices': 'FA:BE:32:DD:0D:36'}
2020-12-27 21:47:32 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_add_device: {'mac': 'FA:BE:32:DD:0D:36', 'temperature_unit': '°C', 'encryption_key': ''}
2020-12-27 21:47:42 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 MiBeacon BLE ADV messages processed for 0 binary sensor device(s) total. Priority queue = 0
2020-12-27 21:47:42 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 MiBeacon BLE ADV messages processed for 1 measuring device(s).
2020-12-27 21:47:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing
2020-12-27 21:47:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2020-12-27 21:47:42 DEBUG (Thread-8) [custom_components.ble_monitor] 2618 HCI events processed for previous period.
2020-12-27 21:47:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: Run
2020-12-27 21:47:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: connected to hci0
2020-12-27 21:47:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2020-12-27 21:48:42 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 MiBeacon BLE ADV messages processed for 0 binary sensor device(s) total. Priority queue = 0
2020-12-27 21:48:42 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 MiBeacon BLE ADV messages processed for 1 measuring device(s).
2020-12-27 21:48:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing
2020-12-27 21:48:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2020-12-27 21:48:42 DEBUG (Thread-8) [custom_components.ble_monitor] 2473 HCI events processed for previous period.
2020-12-27 21:48:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: Run
2020-12-27 21:48:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: connected to hci0
2020-12-27 21:48:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2020-12-27 21:49:42 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 MiBeacon BLE ADV messages processed for 0 binary sensor device(s) total. Priority queue = 0
2020-12-27 21:49:42 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 MiBeacon BLE ADV messages processed for 1 measuring device(s).
2020-12-27 21:49:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing
2020-12-27 21:49:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2020-12-27 21:49:42 DEBUG (Thread-8) [custom_components.ble_monitor] 2281 HCI events processed for previous period.
2020-12-27 21:49:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: Run
2020-12-27 21:49:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: connected to hci0
2020-12-27 21:49:42 DEBUG (Thread-8) [custom_components.ble_monitor] HCIdump thread: start main event_loop

The sensor is present (FA:BE:32:DD:0D:36), but not data appears in HA. image

I probably missed something, but where?

Thanks for your job and support. Vincent

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
vbelloircommented, Dec 29, 2020

Yes, for sure. Right now, I’m working on a private git repo, but later, I will publish it on a framagit or github.

0reactions
Ernst79commented, Dec 29, 2020

You’re welcome. If you ever think of writing a tutorial how you did this, please give us a link or even better create a PR with a new page on this repository.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use this CHEAP Xiaomi thermometer with an ESP32 and ...
Use this cheap Xiaomi LYWSD03MMC Bluetooth BLE thermometer Hygrometer in Home Assistant to monitor temperature and humidity.
Read more >
Exploring Custom Firmware On Xiaomi Thermometers
If we've learned anything over the years, it's that hackers love to know what the temperature is. Seriously. A stroll through the archives ......
Read more >
Xiaomi BLE Temperature and Humidity sensor no longer ...
Xiaomi BLE Temperature and Humidity sensors no longer discovered and working after upgrade from 0.95.4 to 0.96.5.
Read more >
Xiaomi Temperature Sensors - BLE vs Wifi compatibility?
Hello,. I'm looking to deploy Hass.io with the intent of using temperature & hygrometer sensors in various areas of my home.
Read more >
Xiaomi Mijia BLE Sensors - ESPHome
The new bind key will work with ESPHome, but the Mi Home app will not recognise the sensor anymore once the device has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found