Xiaomi camera integration that acts as a Bluetooth gateway

Hello,
I have a Xiaomi camera with the Bluetooth gateway option, which allows me to see the temperature of my Bluetooth thermometers.
I would like to know if it is possible to integrate it into Gladys. A small detail, I don’t have a gateway, it’s the camera that performs this function, so the Xiaomi hardware tutorial doesn’t work for me.
Thanks in advance

Hello!

I’m not an expert on Bluetooth integration, but why not connect your thermometers directly to Gladys?

I’m not sure if it will work directly (@AlexTrovato will surely tell you better than me), but I think it might work.

Hello Pierre-Gilles,

Thank you for the response. I tried to integrate them via Bluetooth, but they are not recognized by Gladys. My thermometers are LYWSD03MMC. Additionally, I would have liked to be able to integrate the camera, but it’s impossible to get the video stream address with Xiaomi.

Ok, when you say they are not recognized by Gladys, can you still see them in Gladys?

I think it’s just a matter of « categorization » of features to map between the device and Gladys.

I found a piece of code from node-red that supports these devices, using the same lib we use in Gladys: node-red-contrib-xiaomi-ble/xiaomi-ble.js at master · eschava/node-red-contrib-xiaomi-ble · GitHub

@AlexTrovato how does it work to categorize a Bluetooth device in Gladys?

ah, what is the exact model? Have you checked: How to connect to network and IP cameras?

For Bluetooth, each manufacturer uses its own communication protocol, so you need to create a service using the existing Bluetooth service to develop each one’s particularities. And of course, you need to know the communication protocol with the device.
Without the hardware at hand, it’s very complicated.
I had created an external tool for Gladys that allows creating a Gladys-compatible service, using Gladys’s Bluetooth service, to test exchanges with devices.

Thank you for your responses,
I won’t have time this weekend to look at what you told me.
I will look at the beginning of next week and get back to you

Hello Pierre Gilles,
How to integrate this code into Gladys?
The camera is a Xiaomi XM420006

Hello @Viriato_REGO, as @AlexTrovato said, it’s more than just a line to change, we need to develop a complete service for this type of device.

If you’re interested and have development skills, absolutely!

We have documentation here to set up a development environment on Mac/Linux:

Or on Windows:

To develop a service, we have documentation:

If you have any questions, don’t hesitate.

@Viriato_REGO Oh, and I almost forgot, here’s a little link to @AlexTrovato’s tool, it should help you :slight_smile: :blush: