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.
- I can use the executeCommandLine command and get the data. Regular expressions? And the launch of the crown?
- I can set up a timer start outside OpenHub, but how and where to save this data?
- 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