Xiaomi Mijia LYWSD03MMC ESP32 support

hi, i bought this sensors https://www.gearbest.com/home-gadgets/pp_009542841338.html?wid=1433363 i can connet it to OMG but only i see via mgtt is :
{“id”:“a4:c1:38:xx:xx:xx”,“rssi”:-79,“distance”:8.651812,“servicedata”:“30585b052bc9642c38c1a408”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“a4:c1:38:xx:xx:xx”,“rssi”:-73,“distance”:4.756481,“servicedata”:“30585b0527c9642c38c1a408”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}
someone use them too and can halp me to recognize the values ?

Hi,

I bought it to , but I didn’t succeed in reverse engineering it for the moment.

To help me integrated it, could you post at least 5 servicedata extract as you already did with the corresponding humidity and temperature values please?

sure, but it doesnt look fine :confused:
hum 38
temp 26,9
{
“id” : “a4:c1:38:”,
“rssi” : -61,
“distance” : 1.274439,
“servicedata” : “30585b053cc9642c38c1a408”,
“servicedatauuid” : “0000fe95-0000-1000-8000-00805f9b34fb”
}

hum 39
temp 24,6

{
“id” : “a4:c1:38:”,
“rssi” : -81,
“distance” : 10.46739,
“servicedata” : “30585b0540c9642c38c1a408”,
“servicedatauuid” : “0000fe95-0000-1000-8000-00805f9b34fb”
}

hum 39
temp 21,2

{
“id” : “a4:c1:38:2c:64:c9”,
“rssi” : -86,
“distance” : 16.54559,
“servicedata” : “30585b0544c9642c38c1a408”,
“servicedatauuid” : “0000fe95-0000-1000-8000-00805f9b34fb”

Hi,

It is the same thing with mine, the changing part of the service data looks more like a time counter rather a sensor value :
3c
40
44

I hope an update would enable to have the same level of service data compared to other xiaomi products but for the moment we can’t retrieve the sensor values. It’s a pity because this sensor was small and cheap…

yes i get 3pcs for 14$ thats why i bough them. i dont have gateway so we have to wait.

Sorry for my English (google translate)
I think there is a solution in this project:

Yes, the solution is to generate a connection to the device as this ones doesn’t seem to broadcast its values.

I also ordered few these sensors (as the newest and as the most power saving).
What is the chance that the python script will be implemented in OpenMQTT?

Hi :slight_smile:
So I’m the next one with hand full of this sensors, looking for hope :wink:

Was there ever an update on these? Should I buy some or avoid?

@floyddotnet is working on it but encountered several issues, once implemented it generates instability.
It’s currently a work in progress

2 Likes

Maybe it’s worth to look at:

and:

Does someone could test this implementation and see if it is working:

The one you refer doesn’t seem to work for me. However the one below did work, but very unreliable as of my 3 temp sensors only 1 was read and very sporadically the other 2. https://github.com/polclota/esp32lywsd03mmc As I have only 1 esp32 around, it could be I have a bad unit and others might have better results.

Thanks for the link and your test! If somebody else can provide feedback on both links it would be helpfull.

The link from polclota works

Attempting MQTT connection as: esp32BleHub_84F574AE11_6717, connected!
i: 2 s: 3, done.
Status topic: esp32blehub_84f574ae11/status/on
{"Timestamp":"2020-07-21T17:47:29.000Z","MAC":"4C:11:AE:74:F5:84","Bootcount":1,"Option":0,"On_secs":20,"Updatetime":180,"SensorName":"Eetkamer","SensorAddress":"A4:C1:38:C9:BC:21","SSID":"dd-wrt","BSSID":"00:14:C1:38:CD:CC","IP":"10.0.0.57","RSSI":-61}, done.
Subscribed to: esp32BleHub_84F574AE11/cmd
Updating BLE device: Eetkamer (1), A4:C1:38:C9:BC:21
Connected!
-Found our service: ebe0ccb0-7a0a-4b0c-8a1a-6ff2997da3a6
-Found our characteristic: ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6
Waiting for notifications!
Notify callback from: Eetkamer (1), characteristic ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6
esp32blehub_84f574ae11/sensor/eetkamer_temperature/state: 24.46, published!
esp32blehub_84f574ae11/sensor/eetkamer_humidity/state: 56.00, published!
esp32blehub_84f574ae11/sensor/eetkamer_battery/state: 69.40, published!
esp32blehub_84f574ae11/sensor/eetkamer_voltage/state: 2.79, published!
Status topic: esp32blehub_84f574ae11/status/off
{"Timestamp":"2020-07-21T17:47:46.000Z","MAC":"4C:11:AE:74:F5:84","Bootcount":1,"Option":0,"On_secs":37,"Result":"published!"}, done.
...
Attempting MQTT connection as: esp32BleHub_84F574AE11_118e, connected!
Status topic: esp32blehub_84f574ae11/status/on
{"Timestamp":"2020-07-21T17:50:58.000Z","MAC":"4C:11:AE:74:F5:84","Bootcount":2,"Option":1,"On_secs":50,"Updatetime":180,"SensorName":"Keuken","SensorAddress":"A4:C1:38:50:68:61","SSID":"dd-wrt","BSSID":"00:14:C1:38:CD:CC","IP":"10.0.0.57","RSSI":-60}, done.
Subscribed to: esp32BleHub_84F574AE11/cmd
Updating BLE device: Keuken (2), A4:C1:38:50:68:61
Connected!
-Found our service: ebe0ccb0-7a0a-4b0c-8a1a-6ff2997da3a6
-Found our characteristic: ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6
Waiting for notifications!
Notify callback from: Keuken (2), characteristic ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6
esp32blehub_84f574ae11/sensor/keuken_temperature/state: 24.43, published!
esp32blehub_84f574ae11/sensor/keuken_humidity/state: 56.00, published!
esp32blehub_84f574ae11/sensor/keuken_battery/state: 86.70, published!
esp32blehub_84f574ae11/sensor/keuken_voltage/state: 2.97, published!
Status topic: esp32blehub_84f574ae11/status/off
{"Timestamp":"2020-07-21T17:51:06.000Z","MAC":"4C:11:AE:74:F5:84","Bootcount":2,"Option":1,"On_secs":58,"Result":"published!"}, done.

The first one is not a full program, and my knowledge of platformio is not so great that I could create one :frowning:

Thanks for the feedback @francisp

For info this integration is making big progress, I’m expecting to publish a PR this week.

Here is the implementation for tests purposes:
https://github.com/1technophile/OpenMQTTGateway/tree/BLEConnect

Now during the scan OMG store the different models of devices, after the scan if we have found a LYWSD03MMC we connect to it and retrieve the data. The time between each connect is BLEinterval

This implementation helped me, thanks to @jschaeke and @francisp for the identification and the tests.

It is now integrated into development: