Xiaomi Mija Sensor Tempetature, Bluetooth (console data)

Tags: #<Tag:0x00007f5ca577f610>

Good afternoon. I bought a Xiaomi Mijia temperature sensor that works via Bluetooth. I found on the Internet a code for a program that scans Bluetooth packets from a sensor (USB 4.0) (passively) and displays them in the console.

{ "id": 238, "mac":"7811dcc1cffc", "type": 9 }
{ "id": 238, "mac":"7811dcc1cffc", "type": 9 }
{ "id": 245, "mac":"582d34399adf", "type": 6, "humidity": 52.2 }
{ "id": 238, "mac":"7811dcc1cffc", "type": 9 }
{ "id": 238, "mac":"7811dcc1cffc", "type": 9 }
{ "id": 238, "mac":"7811dcc1cffc", "type": 9 }
{ "id": 242, "mac":"582d34399adf", "type": 10, "battery": 100 }
{ "id": 238, "mac":"7811dcc1cffc", "type": 9 }
{ "id": 238, "mac":"7811dcc1cffc", "type": 9 }
{ "id": 241, "mac":"582d34399adf", "type": 13, "temperature": 24.0, "humidity": 52.4 }
{ "id": 238, "mac":"7811dcc1cffc", "type": 9 }

The program prints data constantly doing a survey and displaying the result. I can change the original program.

  1. I can use the executeCommandLine command and get the data. Regular expressions? And the launch of the crown?
  2. I can set up a timer start outside OpenHub, but how and where to save this data?
  3. Please tell me more options?

For the rest of the sensors I use MQTT broker.

I’ll post all the codes here as a lesson when there will be a ready-made solution and useful

I guess, the devices you are talking about are among these:

@cpmeister put quite some effort in the official Bluetooth binding recently and wrote, that he will likely bring some GATT parsing feature too for Bluetooth devices like yours and mine. Might be we’ll get a direct integration into openHAB soon (again).

I understood, this is something among a lot of other stuff he is working on. So you (we) need to be patient…

But: It’s “on the list” :wink:

1 Like