Xiaomi Mija Sensor Tempetature, Bluetooth (console data)

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:

2 Likes

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