it took about 4-5sek to spam the Notfication handle… and when i send the command Primary
i got
attr handle: 0x0001, end grp handle: 0x0009 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x000f uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0010, end grp handle: 0x0022 uuid: 0000fe95-0000-1000-8000-00805f9b34fb
attr handle: 0x0023, end grp handle: 0x0030 uuid: 0000fef5-0000-1000-8000-00805f9b34fb
attr handle: 0x0031, end grp handle: 0x0039 uuid: 00001204-0000-1000-8000-00805f9b34fb
attr handle: 0x003a, end grp handle: 0x0042 uuid: 00001206-0000-1000-8000-00805f9b34fb
i enabled the debugmode for the MiFlora sensor and it post this errors in the log:
2017-10-10 11:13:25 DEBUG (SyncWorker_0) [homeassistant.components.sensor.miflora] Polling data for Pflanze1 Moisture
2017-10-10 11:13:25 INFO (SyncWorker_0) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi Flora sensor %s] xx:xx:xx:xx
2017-10-10 11:13:25 DEBUG (SyncWorker_9) [homeassistant.components.sensor.miflora] Polling data for Pflanze1 Conductivity
2017-10-10 11:13:25 INFO (SyncWorker_9) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi Flora sensor %s] xx:xx:xx:xx:xx
2017-10-10 11:13:25 DEBUG (SyncWorker_11) [homeassistant.components.sensor.miflora] Polling data for Pflanze1 Light intensity
2017-10-10 11:13:25 INFO (SyncWorker_11) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi Flora sensor %s] xx:xx
2017-10-10 11:13:25 DEBUG (SyncWorker_5) [homeassistant.components.sensor.miflora] Polling data for Pflanze1 Temperature
2017-10-10 11:13:25 INFO (SyncWorker_5) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi Flora sensor %s] xx:xx:xx:xx:xx
2017-10-10 11:13:25 DEBUG (SyncWorker_13) [homeassistant.components.sensor.miflora] Polling data for Pflanze1 Battery
2017-10-10 11:13:35 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.pflanze1_battery is taking over 10 seconds
2017-10-10 11:13:35 DEBUG (SyncWorker_13) [homeassistant.components.sensor.miflora] Pflanze1 Battery = 0
2017-10-10 11:13:35 DEBUG (SyncWorker_13) [homeassistant.components.sensor.miflora] Data collected: [0, 0, 0, 0]
2017-10-10 11:13:35 DEBUG (SyncWorker_13) [homeassistant.components.sensor.miflora] Median is: 0
so any one an idea how i could fix that?
thanks budys =)
I’ve been using MiFlora component with 5 sensors. They worked more or less ok before. After upgrading my RPi3 to Stretch and Python 3.5 since HASS 0.55.x, the component doesn’t update sensors which are not close enough to the RPi3 (literally 1-2 meeters). I use integrated bt module on RPi3.
Then the easiest way to get gatttool would be to download the package, unpack it (it’s just a gzipped archive containing two more archives) and copy gatttool from there to /usr/bin
plus I would file a bug report that gatttool is not being installed when installing the bluez package, because if the maintainer doesn’t know, he can’t fix it.
edit: the linked package is for ARM hard float (suitable for e.g. raspis)
You could get a better BT adapter for the raspberry pi. Or you could get yourself a pi zero w, plug it in close to the outside wall and load it up with this:
When setting my sensors up I always used hcitool lescan to test the range. Since I have 2 of my Miflora sensors in my green house i had to do some testing before i found a good position for both sensors and receiving Pi3. So if lescan can find your sensor address then you’re good.
Otherwise, reposition.
I have about 30 m to my greenhouse but there are only windows in the way. It’s also a good idea to know where the antenna for Bluetooth is on your Pi3.
Also, since you have added a median to your sensor it will take 3 readings before a value is displayed in HA (FYI).
Another tip is to make sure the sensor is updated. You can do that with the Xiaomi plant app, but before any data can be read by HA it must be unpaired from the app.
Figured I’d chime in here, as I’ve got the same issue a lot of people are reporting: Updating miflora sensor took longer than the scheduled update interval 0:00:30
Last time I checked, I had 782 entries in my current log file, which is absurd IMO.
Found this awesome project called OpenMQTTGateway, which can be used for connecting lots of sensors to MQTT, via an ESP8266. I should mention, it also supports BT presence detection, 933mhz sensors, IR, and a plethora of other devices. It’s a great project, and the credit should go to the devs of said project.
Then I found this issue. Which (at the time of this writing) was committed 17 days later. Here’s a post by the dev, explaining how he implemented the Mi Flora sensor into the OpenMQTTGateway.
Long story short, the OpenMQTTGateway can now read the values from the Mi Flora sensors, and rebroadcast them via MQTT, which can then be pulled into HA; all running on an arduino platform (ESP8266).
For anyone who takes this route, please keep in mind, you’ll probably need to be familiar with programming and electronics; I wouldn’t recommend trying to implement this as your first Arduino project. Also, the firmware on the HM10/11 needs to be updated to at least v601 (This had me scratching my head for a bit). Instructions for this can be found here.
Hopefully this is a good alternative for a few of you (like myself) suffering from enormous, unnecessary log file entries caused by the above “sensor took longer than …” messages.
Has someone been able to pinpoint where to problem lies in this case? Is it that everyone is using raspbi with integrated bluetooth chipset, which breaks it? Or is the problem somewhere in homeassistant / some library used to communicate with these devices?