Theengs Gateway not decoding incoming data (Xiaomi Mi thermometers)

Maybe there is a fundamental misunderstanding on my part on how the whole Theengs setup is supposed to work but at least a hint would be appreciated:

I have a PC with a USB Bluetooth device. I’ve set up Docker and have a running Theengs Gateway container.

it’s doing “something”, i.e. it “detects” BT devices and sends MQTT messages (tons of them in active mode, moderately in passive mode)

I have 3 XIaomi Mi thermometers. One of them is running the latest stock firmware (because stupid thought it would be a good idea to update), two of them running the PVVX firmware.

So while stock firmware is apparently complicated (though not impossible), I at least somewhat expected to get meaningful (as in human readable) date from the other to in the MQTT messages.

I don’t, I get something like this:

“servicedatauuid”: “fcd2”,
“servicedata”: “40001d0cbf0b1000”

(along with MAC, RSSI etc.)

Is “servicedata” the actual payload containing e.g. the room temp? If yes, why does it not get decoded? If no, how do I access it?

I played with the advertising type (PVVX (Custom), BThome v2, …). That doesn’t really change what I’m getting.

Thanks for any help!


Yes, this is the payload. Should it be decoded, it depends on the sensor model and firmware.

Could you share your gateway parameters ? And some full sample payload that you are expecting to be decoded ?(anonymize the mac address)

Hey there, thanks for the reply. The devices are a LYWSD03MMC respectively.

From a device with the PIVVX firmware (currently set to advertise with pivvx):

  "name": "ATC_XXXXXX",
  "id": "XX:XX:XX:XX:XX:X",
  "rssi": -34,
  "servicedatauuid": "fcd2",
  "servicedata": "40009e016402b10a033f0b"

I understand that with the original firmware there is another hoop to jump through first but this should work right?

Thanks again.

Hi @odb1337

While the name in your sample message starts with ATC_ it doesn’t seem to be the officially stated ATC advertising format, which should have a “servicedatauuid” of 181A

It looks like you chose the BTHome format for your LYWSD03MMCs. A format Theengs Decoder, the BLE decoder library Theengs Gateway uses, does not currently support. That’s why you don’t see any decoded properties in your messages.

From the above link of the PVVX site we do support the atc1441 format and the native PVVX Custom format - the PVVX format also in its encrypted version with Theengs Gateway, which requires the bindkey to be entered into the Gateway settings.

The native format requires active connections to the LYWSD03MMC which Theengs Gateway is not able to achieve, but OpenMQTTGateway can do. It is not recommended though as repeated connections to fetch the data takes a high toll on the battery life of the device.

I hope this clarifies the issues you are experiencing.

Thanks for your help. I had BThome v2 enabled and then switch to PIVVX - at least, that’s my feeble finger tapped on and the flasher showed afterwards.

I switched to atc1441 now though (the one setting I did not try) and now I do see the decoded values. Great stuff (and great project!)