# Need help to read data from BLE temperature sensor in Node-red (LYWSD03MMC)

**URL:** <https://discourse.nodered.org/t/need-help-to-read-data-from-ble-temperature-sensor-in-node-red-lywsd03mmc/71692>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [4 December 2022 22:24 UTC](https://discourse.nodered.org/t/need-help-to-read-data-from-ble-temperature-sensor-in-node-red-lywsd03mmc/71692 "2022-12-04T22:24:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fnx2k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fnx2k/32/71948_2.png) [@fnx2k](https://discourse.nodered.org/u/fnx2k)\
**Post date:** [4 December 2022 22:24 UTC](https://discourse.nodered.org/t/need-help-to-read-data-from-ble-temperature-sensor-in-node-red-lywsd03mmc/71692/1 "2022-12-04T22:24:42Z")

</div>

Hi,  
_First of all, I am beginning with node-RED, so excuse me if I miss some basic points or do not use the correct vocabulary_

My project is to run replace a broken thermostat of my central heating.

> I need help to be able to read the temperature from the BLE sensor with node-red and inject these data in flows.

_Here are some details of the setup:_  
The thermostat is controlling a 3way-valve on the heater (making it not compatible with most of the thermostats on the market): It needs to send a maintain a signal to open the valve and a signal on a different wire to close the valve.

I am trying to use the hardware I have and I know: Raspberry Pi3, Mi sensors (LYWSD03MMC), 5V relays.

_here is a schematic of the system:_  
`< 3way-valve > --(wires)--<< **Relays >(GPIO)<Rasp.Pi**>> ----(Bluetooth)--- < BLE Temp Sensor >`

I have got most of the pieces to have a prototype but I am stuck with temperature reading.  
My plan was to use small sensors Xiaomi/Mi broadcasting temperature via a Bluetooth low energy signal (BLE)

_Own research_:  
I overcame the connection issue of the sensor to the raspberry Pi, thank to the work of [Aaron Christophe](https://github.com/atc1441/ATC_MiThermometer), and managed to record readings during days with Homeassistant as test.

Scrapping the internet I read many articles using ESP32 to convert the BLE signal into Wifi, which I would like to avoid at this point to avoid additional hardware in the system.

I have seen many nodes in npm dealing with BLE like _noble_. but I am kind of lost in knowing which ones to use and how.  
I have managed to scan and detect the sensor with _node-red-contrib-ble-scan_  
and tested _node-red-contrib-xiaomi-ble_ without being able to get the reading.

I am stuck with getting the temperature signal (probably by lack of knowledge of node-red)

I have read this article [xiaomi-mijia-hygrothermo-v2-sensor-data-on-raspberry-pi](https://zsitko.com/xiaomi-mijia-hygrothermo-v2-sensor-data-on-raspberry-pi/) which gives a way forward but outside node-RED

Sensor:LYWSD03MMC ([datasheet](https://manuals.plus/xiaomi/lywsd03mmc-temperature-and-humidity-monitor-2-manual))  
 ![LYWSD03MMC.png](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3e4f5fe0726144671c621fa620a7e82f41a508c7.png)

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [4 December 2022 23:24 UTC](https://discourse.nodered.org/t/need-help-to-read-data-from-ble-temperature-sensor-in-node-red-lywsd03mmc/71692/2 "2022-12-04T23:24:30Z")

</div>

I can not give you a direct answer as i went through this about a year ago and ended up giving up on getting it directly into NR. In the end i used an ESP32 flashed with (initially) OpenMQTT gateway and then later moved that to using ESPHome.

I have 3 of these around the house now with about a dozen of the Xiaomi units (i used the round ones) and they have been flawless

Craig

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 February 2023 23:25 UTC](https://discourse.nodered.org/t/need-help-to-read-data-from-ble-temperature-sensor-in-node-red-lywsd03mmc/71692/3 "2023-02-02T23:25:19Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
