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
Test and add support for Xiaomi Mi Flora Monitor #19
Comments
Let me know if you need any help testing this, I've got three Mi Floras. Successfully installed the Bluetooth Binding and the TinyB Binding yesterday, and they were discovered and added to my test-system. The following channels were detected/added: Would be awesome getting them supported, so I don't have to bother with external scripts and stuff for getting the data. |
hi @jerano, I'm working on this at the moment. It will be supported in the next release. I've got one sensor, so it is easier for me now. |
awesome! then I can hold off on using some alternative way to get the sensors into my OH system. keep up the good work! |
Unfortunately MiFlora sensor (and probably other Mi sensors) uses a proprietary authentication mechanism that involves a handshake, security token generation/exchange.
Unfortunately there is not any easy way to generate security tokens, the Flower Care android mobile app uses a JNI library to generate/encrypt tokens. If authentication token is not validated by device, device drops connection. However, fortunately it is still possible to quickly read data characteristic before it disconnects. In other words, we won't be able to create a proper binding for Mi devices (unless someone figures out how to encrypt security tokens), however we still can create a binding that periodically connects to the device and fetches data while it is in authentication process (like other python scripts do). |
There's no checking of firmware version before that? I mean, it might be something they've implemented later, and us lucky ones with earlier versions (not using the app at all!) aren't affected by this!(?) Just speculating though... I think I've noticed the sensor disconnecting after a while, when playing around with gatttool and other bluetooth tools. Anyways, if it's possible to implement a small binding for them, I think lots of people would be happy, but if not... we'll just have to stick to scripts scraping the info and updating OH from outside. Thanks for the work you put into this!! |
Indeed it might be like that. Unfortunately I have upgraded the device I have and I can't check now. Would you @jerano be able to double check this theory? E.g. use a gattool or bluetoothctrl to connect to the device and see if it disconnects after 5-10 secs? |
Hey @vkolotov ! With bluetoothctl, connection to a sensor seems to disconnect after 5-10secs, unfortunately. Can read characteristics from sensor with gatttool, ie. like: Oh well, it seems there are some decent ways to get the sensor data into OH via ie. MQTT, so if no specific binding for these sensors are created, I guess we'll survice... |
I'm planning to create a bluetooth extension for this device anyway, it will allow us to use miflora with no issues, like if there was not that stupid auth mechanism, it just won't be efficient implementation-wise. |
Support for this device has been added in v1.1 |
https://github.com/aprosvetova/xiaomi-kettle is getting really close to the solution to your problem |
Check if the device conform to standard GATT specifications and works out of the box.
The text was updated successfully, but these errors were encountered: