-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for the Xiaomi Oclean X Electric Toothbrush #280
Comments
Sure, but we need some data from the device. Please follow the instructions in the FAQ on how to get the data. |
Cool! Just tried to follow the guide. I do not get any logs in the logging section of HA. I have it set up like in the FAQ / Readme and the "report unknown " turned on in the integration . Nothing comes through? |
That might mean that the messages do not follow the structure we expect. There is a second method in the faq with Hcidump which you can try. This shows all BLE messages that are received, not only those from Xiaomi. This method might not work on Hassio, but you can try. If you have a supervised, venv or docker installation, it should work. Furthermore, make sure the toothbrush is connected to MiHome. Close the MiHome app when trying to get the data. |
@Ernst79 thanks for the quick response:) I will try setting up a standalone RPI to get the messages as you say. For information - i have opened an issue under the esphome-github repo here esphome/feature-requests#517 I got some messages using a BLE scanner on my phone. I dont know if any of these values can be used for this integration? All the best Jacob / Denmark |
Its easier if you can get the full messages with HCIDUMP. Especially because they don't follow the Xiaomi MiBeacon format, If I have the full messages, it's much easier to add it without errors. |
@jaccdk Did you had the possibility to collect some data? I'm currently working on another toothbrush, see #319. Just a check, when you tried it with report_unknown, did you enable debug logging as well? |
Hi Ernst. Uhhh - I never came any further - did not have the time. I will try to look into it ASAP:) |
Let me know if you need some help. If you install 1.9.1-beta, it's easier than before to get the data. Set the option
You will find the needed info in the home assistant log. If the toothbrush doesn't follow the Xiaomi format, you can try to use
This last option will collect all messages, so we than need to figure out which ones correspond to your toothbrush. Please note, the above only works with 1.9.1-beta and above. |
I want to help with this. I've the same toothbrush. This is what the "ble" program for Android shows, if it helps: I've enabled the logs too. Under Xiaomi I can't see nothing, under Other I get a lot of info, but I don't know how can I know if it is from my device or not. Here is the log. Some of the hex strings of the raw data from the captures, appear in the log. |
Thanks, I had a first quick look.
I'm not sure about the UUID etc, I'll look into what data is what later. But I didn't find the "long" message, as in your first screenshot. The ones in your log only have the data with length 02, 07 and 07. The data with the extra length 09 as in your first screenshot was not in the txt file. Could you try to create a log while you turn your tooth brush on/off and change the speed? All message are now the same. You can recognize your device by the MAC address . (often reversed per two characters). All messages that have If you can't find any long messages, try again with |
I have tested with and without
I can't find the long message, but I see some shorter. Here you have the log without filtering if it helps. The raw data of the screen capture is what appears in the "identification" screen of the program BLE Scanner. The others are the information that the devices publishes after "connecting" with the BLE Scanner. |
The shorter messages are the messages with length 09. They are apparently send in two different messages. I'll check if it contains something useful. |
I had a look, but as far as I can see, it doesn't contain useful data.
The data I found in these messages are Flags, Service UUID, MAC address and the name. Flags
services UUID
MAC address
Device name
So, unless you can find more/different data messages, I'm afraid the toothbrush doesn't send data. Try to run it for a longer period. Possibly when you open the app, it might send useful data. Edit |
It has it's own app, called Oclean. It is paired with it since more than a year ago, and I open it to sync the data from time to time. I will try to log more time to see if I can find something different. |
I think the Bluetooth toothbrush uses a connection between the toothbrush (called peripheral in Bluetooth terms) and the app/phone (central) for the exchange of more detailed data. This means it isn’t sending (useful) data without setting up a connection. BLE monitor is not able to set up connections, as it is passively listening. you can give it a try to get some logs from a longer period, but I’m a bit afraid that what we have is all we can get passively. |
@McGiverGim any news with the toothbrush? :) |
No, I wasn't able to get something useful so I abandoned some time ago |
Hi:D I managed to get the battery state with ESPHOME and an esp32 dev-board as "gateway" !:) Use this config: esp32_ble_tracker: ble_client:
sensor:
|
I can't see a place where to put the |
Ble monitor doesn’t support sending BLE messages, it can only passively listen to it. Sometimes, a sensor only broadcast with active scan enabled, which is supported. But sending BLE advertisements to ask for data isn’t possible with BLE monitor. There is an issue with that request, but I don’t have plans to look into that soon, due to my limited time at the moment. |
Thanks @jascdk for your post. Found it via Google and got the battery sensor working immediately. My code in ESPHome for a NodeMCU ESP32:
This is the output in the ESPHome log:
Finally in Home Assistant the sensor is automatically discovered and added: |
How did you know the service_uuid and characteristic_uuid value? |
Hi all:)
Firsts of all - just got the HA Integration up and running - what a nifty little integration big thanks to all in here for making it happen.
I just bought an OCLEAN X electric toothbrush from Xiaomi. It has BLE built in. Would it be possible to integrate it in this integration?
I will do my best to give some of the data output from it.
https://oclean.com/products/oclean-x
All The Best
Jacob / Denmark
The text was updated successfully, but these errors were encountered: