-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Problem with Mi Flora in 0.94.1 #24453
Comments
Hey there @Danielhiversen, @ChristianKuehnel, mind taking a look at this issue as its been labeled with a integration ( This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people. |
First guess, without analyzing: You do not have the |
Yes, I've seen that in the component code. It is assumed that the Bluepy library comes installed in docker, right? Because it does not appear installed in the 0.94.1 0.93.2:
But in 0.94.1 (since 0.94.0b0) it is not installed:
Can anyone check why this happens? Thanks! |
Hello, good day! Did anyone manage to find a solution to this problem? In my case the failure continues to occur, even in the latest version 0.94.3. |
@eucciferri The issue is the same that #24441 |
Bluepy is not installed in 0.95.4 docker image either. |
That's right, I had started working on version 0.95, but now that I'm realizing it, after version 0.95.4 it stopped working again! |
Hi @repvik, this weekend I managed to solve this problem in the following way. I bought a NodeMcu ESP32, I configured it with the ESPHome firmware and connected Mi Flora to this device. Then the ESP32 sends the data to Home Assistant. You can connect more than one Mi Flora to a single ESP32. You must have the Mi Flora with its latest firmware version, that update with the official App. It works perfect, I recommend it. Instructions: How to use ESPHome in HA: |
I do have the same problem with miflora with Hass.io 0.95.4 |
Still same issue on 0.96.1 @eucciferri A separate ESP gateway is not an option. I don't want another device to power. |
Same for me in 0.96.1. I have a feeling it was working fine in .93, but now most of my Mi Floras either are "unknown" or update about once a week.. |
Same for me in 0.96.5. |
I can't test this at the moment. Can someone please try this: This should tell HA to pull in bluepy as an additional dependency. |
HA pull correctly bluepy but after one hour of correctly working, sensors stop to update.
I just have just this message in the HASSIO info page: But in the log, either with debug level I can't see any request for sensors update. |
@furiaceka87 great, so the problem with the missing library seems to be solved. Can you please create a pull request for this? Concerning the missing updates: They keep being reported, but I haven't been able to locate the source of the problem so far and it does not heppen in my setups. So I have no idea on how to solve this... |
I'm not expert enough in GitHub to create a PR, sorry for this.
Could you please share with us your sensors configuration? |
I'd be happy to help creating debug logs. I have a similar problem, where my miflora sensors (I have 4 of them) work fine for a couple of hours, then just stop reporting until i restart homeassistant ( I tried migrating over to brand new install (from a Pi3-B to a Pi4), the only configuration that I copied was the sensor configuration in my configuration.yaml, otherwise it was a brand new install (to try eliminate configuration as the cause of the problem). My HA version: 0.97.0b1 I've enabled debug logging, and will report back with any findings tomorrow once the issue occurs again:
Here's my sensor config:
Oh, I also seem to have the correct bluetooth library? Here's what my homeassistant is reporting:
(Accessed it through Portainer > Container console) |
I have exactly your same issue @carlmes |
Ist seems bluepy has a Problem with Python 3.7.3 |
I also tried by using an external USB Bluetooth dongle without success. |
Dear, In my case, I did that and I have never had problems again. Bye! |
@eucciferri probably you're right. But Raspberry Pi can handle these sensors, beacuse in the past it was working, so we have to found the solution. @ChristianKuehnel
The issue is always the same, after some succesful update of the sensors after 1 hour more or less I receive the first WARNING "took longer than 10 seconds" and later it stops to work. |
As promised, here’s detailed logs from when the sensors stop working:
|
@carlmes I tried clean installation many times without succeeding. |
+1 for this. Still not working in 0.97.2 |
Same..I guess the docker image still isn't updated with the required Bluetooth dependencies. |
I manually installed all the dependencies, it’s not an issue related to dependencies. Seems that MiFlora sensors take longer time to answer and after 10s there is timeout and no more update come from the sensors. |
@furiaceka87 My HA cannot even connect on startup - back in around 0.90ish, they would at least connect but then lose connection over a few days. Since 0.94+ they don't even connect. |
@timdonovanuk are you in Raspberry? |
At the developer ( @Danielhiversen, @ChristianKuehnel ) |
Would love this to be fixed, I used a spare Raspberry PI with https://github.com/ThomDietrich/miflora-mqtt-daemon to get one of my Mi Flora's working again :-) But the other two are in reach of my Hassio Raspberry, so I would like a direct connection again. |
@furiaceka87 @harrywesterman |
@ChristianKuehnel I try the modification suggested in your comment #24453, however the problem is still there. |
@furiaceka87 For failures after it was working for some time: I have no idea what is causing this or how to debug it. I read rumors that the problem is related to Bluetooth issues on Raspberry Pi 3 and can solved with a firmware update( |
@ChristianKuehnel - this error occurs whenever there is a temporary problem communicating with a sensor (perhaps some Bluetooth radio interference?). Ideally, the error should be ignored and the sensor polled again at the next specified interval (most of us have 1200 or 1800 refresh interval configured), however once one sensor fails to respond correctly, the whole home assistant stack stops polling ALL sensors until it has been rebooted. Here's a suggestion about how the error could be reliably reproduced:
Note - the error seems to exist in the polling logic somewhere, as other sensors (such as the temperature and humidity one) are also experiencing exactly the same problems as us: #19326 (comment) |
I have also updated the bluepy dependency in my docker image but still get "unknown". Previously it would at least connect for a bit. |
Done a bit of poking. I'm running in docker, so I jumped into the shell of the container and tried to manually run a bluetooth scan:
Well of course if my docker image cannot poll bluetooth then miflora is not going to work. So then I tried this command on my host machine, i.e. directly on the Pi. I got a similar result.
So if the Pi cant scan bluetooth, there is no way a docker image running on it will be able to...So I tried restarting bluetooth (directly, not in the docker container):
I then ran hcitool lescan again and got what we're looking for, a list of found bluetooth devices:
I then went back into my HA docker container and hcitool lescan worked again..for a bit. It now seems to sometimes stop and then sometimes start working again... Edit: now that I know bluetooth is actually scanning again, I couldn't find my sensors in the list of BLE mac addresses. I've replaced the battery in them and it's working again. So as I see it I have two problems:
Hurrah! My HA is back to telling me I'm incapable of taking care of my houseplants :) I should mention I'm running on 0.98 released today. Now if only the plant card was not quite so damned ugly... |
I just filed that PR for the dependency problem. But to be honest, I'm really disappointed that nobody bothered to spend 10 minutes in the last month to fix this 1 line change! This is an open source project, so YOU (yes you in front of this screen!) are expected to contribute! |
Hi, Even with HA 0.100.2 containing @ChristianKuehnel s fix, I'm still facing the 10s limit issue. |
If you use ssh-addon, you login into homeassistant docker container, when you just type Try this to log in into host machine:
But looks like down and up hci0 does not help... |
Just wondering, is there a fix for this? |
Home Assistant release with the issue:
from 0.94.0b0 to 0.94.1
Last working Home Assistant release (if known):
0.93.2
Operating environment (Hass.io/Docker/Windows/etc.):
docker
Component/platform:
https://www.home-assistant.io/components/miflora/
Description of problem:
Not updating and showing Unknown sensors value.
Rolled back to 0.93.2 and all working fine.
(similar problem that this with Xiaomi BLE Temperature and Humidity sensor: #24313)
I could see that in version 0.93.2 Bluepy was used and in version 0.94 Gatttool. Why?
Traceback (if applicable):
0.93.2:
0.94.1:
The text was updated successfully, but these errors were encountered: