Passive BLE Monitor integration

check this topic.

It seems to use the BLE Mesh format, which is not supported. But I will look into it, but can’t do any promises. I think it will require a connection to be set up, which is out of the scope of our passive BLE monitor.

Unfortunately, it can’t be supported, It doesn’t send data in MiBeacon format, only BLE Mesh format, which requires a connection. this is not supported, due to the passive nature of BLE monitor.

1 Like

I’ve added support for Ruuvitag sensors in 3.3.2-beta, but I’m looking for someone to test.

Especially the motion sensor needs some confirmation if it is working as expected. So, if you want to help with some testing, please post your findings in this issue. Thanks!

Ruuvitag support has been removed in 3.3.4 due to an issue with the pypi package requirements, which apparently broke InfluxDB (ruuvitag_sensor downgraded the rx pypi package). So I’ve reverted the support for this sensor and will write our own parser, independent of ruuvitag_sensor. Sorry for the inconvenience if it broke your installations. there are instructions to fix it on github.

Edit 20-6-2021: 3.4.0-beta has been released which adds Ruuvitag support back. It won’t suffer from the above bug anymore, as I wrote the parser myself, without the need to use ruuvitag_sensor.

I have a single LYWSD03MMC and using Home assistant on Raspberry Pi4. Here is my configuration. I can’t get a single reading even in last 1 hour.

sensor MiBLE:
  - platform: mitemp_bt
    mac: 'A4:C1:38:XX:XX:XX'
    name: Kids Room Temp
    force_update: true
    median: 1
    monitored_conditions:
      - temperature
      - humidity
      - battery

and here is the log file

2021-06-19 21:32:44 WARNING (SyncWorker_4) [homeassistant.components.mitemp_bt.sensor] Did not receive any data from Mi Temp sensor Kids Room Temp Battery
2021-06-19 21:33:14 WARNING (SyncWorker_1) [homeassistant.components.mitemp_bt.sensor] Polling error Could not read data from Mi Temp sensor A4:C1:38:XX:XX:XX
2021-06-19 21:33:14 WARNING (SyncWorker_5) [homeassistant.components.mitemp_bt.sensor] Polling error Could not read data from Mi Temp sensor A4:C1:38:XX:XX:XX

You are showing your mitemp_bt configuration, but the last picture is from ble_monitor. So, you are mixing things. The configuration of BLE monitor can be found here BLE monitor.

Please note that the LYWSD03MMC sensor requires an encryption key, which can be found with e.g. xiaomi cloud token extractor. The FAQ gives many other ways to get this key, including detailed explanation.

I fixed the issue, flashed GitHub - pvvx/ATC_MiThermometer: Custom firmware for the Xiaomi Thermometers and Telink Flasher via USB to Serial converter using a Samsung Galaxy Note 10, and BLE is now working fine with frequent data updates. Don’t know why a Samsung Galaxy S8 or S8 plus can’t connect with this thermometer even with custom firmware.


Hi all,

I’m using the YLKG08YL dimmer and it works great with HA. However, I want my lights to increase/decrease based on the number of steps I turned my dimmer. I can capture this from the ‘dimmer value’ attribute, but it seems that a single right/left rotation is captured as two actions in HA, the first with a single step, and the second one with the actual number of steps.

I can see this behaviour using the Template in Developer tools:

{{state_attr('sensor.dimmer_1','dimmer value').rstrip(' step(s)') | float}}

Has anyone else seen this? any options to capture the steps?

Cheers,
Nick

The state of the dimmer is composed of two “values”, the type of press (e.g. “rotate right”) and the dimmer value “e.g. 10 steps”. The individual components are also reported as device attributes, it should have a “dimmer value” attribute and a “last type of press” attribute.

        self._device_state_attributes["dimmer value"] = data[self._dimmer]
        self._device_state_attributes["last type of press"] = data[self._button]

So, you should be able to extract the number of steps from the device attributes with state_attr.

1 Like

3.4.4 has been released

  • support for Brifit T201 sensor
  • support for Ruuvitag
  • changed the dimmer value to an integer for easier automation
1 Like

My MHO-C401 changed itself to Celsius when I had it on Fahrenheit. Is there any way to change it back to F without MiHome?

Did it change in Home Assistant or on the screen. If it is changed in BLE monitor, check your settings in the BLE monitor options menu (C or F can be set at integration level, but also at device level, so check both).

Just on the screen. Home Assistant seems to report correct temperatures. I recently switched to BLE Monitor from xuefer/sensor.mitemp_bt since it quit working for some reason. I’m sure it’s coincidental since my understanding of BLE Monitor is it’s 1-way communication, but that’s about the time the display changed from F to C. Just last night, one of my LYWSD03MMC’s display also randomly changed from F to C.

I’m just curious if MiHome is the only way to toggle the display of these back to F.

BLE monitor is indeed one way communication, so it can’t be caused by BLE monitor. Possibly a firmware update, but as I understand, you don’t have mi Home. I have no idea.

The only way to change it without Mi Home is by installing ATC firmware, I think.

Changes in 4.0.0

It’s time to move to version 4 of BLE monitor with some exiting new enhancements.

BLE device tracker
BLE monitor is now able to :tada: Track Bluetooth devices :tada: with a public MAC address or static (lifetime) MAC address.

To enable tracking of a device, add the Bluetooth MAC address to your devices in the options menu and enable the option track device.

Still using YAML?, you can add your device tracker with the following config, but make sure you first restart Home Assistant one time after installing the update, before adding this to your configuration.yaml:

ble_monitor:
  devices:
    - mac: 'D4:3C:2D:4A:3C:D5'
      track_device: True
      tracker_scan_interval: 20
      consider_home: 180

iNode Energy Meter
We have added support for the iNode Energy Meter

Other changes
This release also adds support for the Dutch language in the option menu.

1 Like

Would it be possible to add the Xiaomi Kettle Pro?

I had a request for this earlier, but this kettle doesn’t send passive BLE advertisements with useful data. It probably needs a connection, which is not supported by BLE monitor (as it is passive).

Hi

I may have muddled some things up and would like some advice with starting over.

I am not sure how I managed to do what I did but I am sure I stuffed something up.

Any how.

I do not have a Xiaomi hub. I originally set up some LYWSD03MMC using ESPhome. This all worked well.

I by mistake purchased some bluetooth Xiaomi Mi Motion Sensor 2 (I thought I had ordered the Zigbee version)

In trying to find a solution I came across this integration. I am using a NUC PC as my home assistant server (I am not sure if it has bluetooth) and most of my devices have shown up.

SO… Are the connected to the NUC (If so how could I work this out) as the bt_interface shows only one mac adress. I do not know if that is from my ESPhome bte hub or from the yet unknown NUC.

So, the end game im after is a few esp32 hubs around the home that I can pick up both the Temp sensors and the motion tracker.

Any guides or is this even possible?

Thanks

Hans

I have worked out that my NUC does have Bluetooth.

which is the same as my BT interface.

So, that solves the mystery.

The question is, can i make a few ESP32 hubs (using for Example esphome) to extend my BT range?

It is actually quite simple, use BLE monitor for the sensors that are within range of your NUC/PI/Etc. If the sensors are out of the (Bluetooth) range of your NUC, use ESPHome. There is also no problem using them both, as they use different Bluetooth radio’s, BLE monitor from the NUC and ESPHome from the ESP32. ESPHome is not using the Bluetooth of the NUC to connect to the ESP32 devices, this is done over WiFi.

Are the connected to the NUC (If so how could I work this out) as the bt_interface shows only one mac adress.

The sensors will show up under the option devices at the bottom of the options window.

Thank you.

That is a simple solution. And I guess it can be done with LYWSD03MMC using ESPhome

But can the Xiaomi Mi Motion Sensor 2 be added to ESPhome?

Ah, sorry, didn’t got that question. No, the Xiaomi Mi Motion Sensor 2 is called the RTCGQ02LM, which is currently not supported by ESPHome, only BLE monitor.

You have 3 options.

1 Like