Miflora plant sensor, no give data. Status unknown, on state website

Hello to everyone,

I have a raspberry pi 3 running HA. Also i have a xiaomi plant sensor.

Yesterday for a period of time, i linked the miflora plant sensor wih BLE of raspberry using bluetoothctl and i watched values in HA state website. After that i restarted the raspberry.

Today i dunno why, when i see the values of miflora sensors in state website of HA says “unknown”.

If i see the bluetoothctl in the raspberry i see this:

[NEW] Controller B8:27:XX:XX:XX:XX raspberrypi [default]
[NEW] Device C4:7C:XX:XX:XX:XX Flower care
[CHG] Device C4:7C:XX:XX:XX:XX Connected: yes
[CHG] Device C4:7C:XX:XX:XX:XX Connected: no
[CHG] Device C4:7C:XX:XX:XX:XX Connected: yes
[CHG] Device C4:7C:XX:XX:XX:XX Connected: no
[CHG] Device C4:7C:XX:XX:XX:XX Connected: yes
[CHG] Device C4:7C:XX:XX:XX:XX Connected: no
[CHG] Device C4:7C:XX:XX:XX:XX Connected: yes
[CHG] Device C4:7C:XX:XX:XX:XX Connected: no
[CHG] Device C4:7C:XX:XX:XX:XX Connected: yes
[CHG] Device C4:7C:XX:XX:XX:XX Connected: no
[CHG] Device C4:7C:XX:XX:XX:XX Connected: yes
[CHG] Device C4:7C:XX:XX:XX:XX Connected: no
[CHG] Device C4:7C:XX:XX:XX:XX Connected: yes
[CHG] Device C4:7C:XX:XX:XX:XX Connected: no
[CHG] Device C4:7C:XX:XX:XX:XX Connected: yes
[CHG] Device C4:7C:XX:XX:XX:XX RSSI: -90

when i use the instruction:

[bluetooth]# info C4:7C:XX:XX:XX:XX

I have this result:

Device C4:7C:XX:XX:XX:XX
        Name: Flower care
        Alias: Flower care
        Paired: no
        Trusted: yes
        Blocked: no
        Connected: no
        LegacyPairing: no

Then i try to pair and i have this error:

[bluetooth]# pair C4:7C:XX:XX:XX:XX
Attempting to pair with C4:7C:XX:XX:XX:XX
Failed to pair: org.bluez.Error.Failed

Someone has any idea about the problem? other solution?

thanks

Enable logging and check the log:

logger:
  default: warning
  logs:
    homeassistant.components.sensor.miflora: debug
    miflora.miflora_poller: debug

Hi,

Thanks for quick reply.

To enable logger, i need to do it in configuration.yaml file, really?

thanks

Hi,

Yes i see where to enable logger

https://home-assistant.io/components/logger/

thanks

Hi, here you have the log:

2017-05-12 13:16:25 DEBUG (Thread-7) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza
 Moisture
2017-05-12 13:16:25 DEBUG (Thread-7) [miflora.miflora_poller] Enter read_ble (<Thread(Thread-7, started daemon
 1917842528)>)
2017-05-12 13:16:25 DEBUG (Thread-7) [miflora.miflora_poller] Created lock in thread <Thread(Thread-7, started
 daemon 1917842528)>
2017-05-12 13:16:25 DEBUG (Thread-7) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:16:31 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or
integer (0-100): event,subirpers
2017-05-12 13:16:34 DEBUG (Thread-7) [miflora.miflora_poller] Finished gatttool
2017-05-12 13:16:34 DEBUG (Thread-7) [miflora.miflora_poller] Released lock in thread <Thread(Thread-7, starte
d daemon 1917842528)>
2017-05-12 13:16:34 DEBUG (Thread-7) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:16:34 DEBUG (Thread-7) [miflora.miflora_poller] Waiting for 10 seconds before retrying
2017-05-12 13:16:35 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.planta_terraza_moisture is taking over
10 seconds
2017-05-12 13:16:44 DEBUG (Thread-7) [miflora.miflora_poller] Created lock in thread <Thread(Thread-7, started daemon 1917842528
)>
2017-05-12 13:16:44 DEBUG (Thread-7) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:16:49 DEBUG (Thread-7) [miflora.miflora_poller] Finished gatttool
2017-05-12 13:16:49 DEBUG (Thread-7) [miflora.miflora_poller] Released lock in thread <Thread(Thread-7, started daemon 191784252
8)>
2017-05-12 13:16:49 DEBUG (Thread-7) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:16:49 DEBUG (Thread-7) [miflora.miflora_poller] Waiting for 20 seconds before retrying
2017-05-12 13:16:49 DEBUG (Thread-7) [miflora.miflora_poller] Created lock in thread <Thread(Thread-7, started daemon 1917842528
)>
2017-05-12 13:16:49 DEBUG (Thread-7) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:16:56 WARNING (MainThread) [homeassistant.components.sensor] Updating miflora sensor took longer than the schedule
d update interval 0:00:30
2017-05-12 13:17:02 DEBUG (Thread-7) [miflora.miflora_poller] Finished gatttool
2017-05-12 13:17:02 DEBUG (Thread-7) [miflora.miflora_poller] Released lock in thread <Thread(Thread-7, started daemon 191784252
8)>
2017-05-12 13:17:02 DEBUG (Thread-7) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:17:02 DEBUG (Thread-7) [miflora.miflora_poller] Waiting for 20 seconds before retrying
2017-05-12 13:17:02 DEBUG (Thread-7) [miflora.miflora_poller] Exit read_ble, no data (<Thread(Thread-7, started daemon 191784252
8)>)
2017-05-12 13:17:02 INFO (Thread-7) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi F
lora sensor %s] C4:7C:XX:XX:XX:XX
2017-05-12 13:17:02 DEBUG (Thread-5) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Light intensity
2017-05-12 13:17:02 DEBUG (Thread-5) [miflora.miflora_poller] Using cache (0:15:00.006369 < 0:20:00)
2017-05-12 13:17:02 INFO (Thread-5) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi F
lora sensor %s] C4:7C:XX:XX:XX:XX
2017-05-12 13:17:02 DEBUG (Thread-3) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Conductivity
2017-05-12 13:17:02 DEBUG (Thread-3) [miflora.miflora_poller] Using cache (0:15:00.010528 < 0:20:00)
2017-05-12 13:17:02 INFO (Thread-3) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi F
lora sensor %s] C4:7C:XX:XX:XX:XX
2017-05-12 13:17:02 DEBUG (Thread-10) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Temperature
2017-05-12 13:17:02 DEBUG (Thread-10) [miflora.miflora_poller] Using cache (0:15:00.017253 < 0:20:00)
2017-05-12 13:17:02 INFO (Thread-10) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi
Flora sensor %s] C4:7C:XX:XX:XX:XX
2017-05-12 13:17:02 DEBUG (Thread-8) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Battery
2017-05-12 13:17:02 DEBUG (Thread-8) [miflora.miflora_poller] Enter read_ble (<Thread(Thread-8, started daemon 1907356768)>)
2017-05-12 13:17:02 DEBUG (Thread-8) [miflora.miflora_poller] Created lock in thread <Thread(Thread-8, started daemon 1907356768
)>
2017-05-12 13:17:02 DEBUG (Thread-8) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:17:10 DEBUG (Thread-8) [miflora.miflora_poller] Finished gatttool
2017-05-12 13:17:10 DEBUG (Thread-8) [miflora.miflora_poller] Released lock in thread <Thread(Thread-8, started daemon 190735676
8)>
2017-05-12 13:17:10 DEBUG (Thread-8) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:17:10 DEBUG (Thread-8) [miflora.miflora_poller] Waiting for 10 seconds before retrying
2017-05-12 13:17:12 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.planta_terraza_battery is taking over 1
0 seconds
2017-05-12 13:17:20 DEBUG (Thread-8) [miflora.miflora_poller] Created lock in thread <Thread(Thread-8, started daemon 1907356768
)>
2017-05-12 13:17:20 DEBUG (Thread-8) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:17:27 WARNING (MainThread) [homeassistant.components.sensor] Updating miflora sensor took longer than the schedule
d update interval 0:00:30
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Killed hanging gatttool
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Released lock in thread <Thread(Thread-8, started daemon 190735676
8)>
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Waiting for 20 seconds before retrying
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Created lock in thread <Thread(Thread-8, started daemon 1907356768
)>
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Finished gatttool
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Released lock in thread <Thread(Thread-8, started daemon 190735676
8)>
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Waiting for 20 seconds before retrying
2017-05-12 13:17:40 DEBUG (Thread-8) [miflora.miflora_poller] Exit read_ble, no data (<Thread(Thread-8, started daemon 190735676
8)>)
2017-05-12 13:17:40 DEBUG (Thread-8) [homeassistant.components.sensor.miflora] Planta_Terraza Battery = 0
2017-05-12 13:17:40 DEBUG (Thread-8) [homeassistant.components.sensor.miflora] Data collected: [0]
2017-05-12 13:17:40 DEBUG (Thread-8) [homeassistant.components.sensor.miflora] Not yet enough data for median calculation
2017-05-12 13:17:58 DEBUG (Thread-1) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Moisture
2017-05-12 13:17:58 DEBUG (Thread-1) [miflora.miflora_poller] Using cache (0:15:56.443086 < 0:20:00)
2017-05-12 13:17:58 INFO (Thread-1) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi F
lora sensor %s] C4:7C:XX:XX:XX:XX
2017-05-12 13:17:58 DEBUG (Thread-4) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Light intensity
2017-05-12 13:17:58 DEBUG (Thread-4) [miflora.miflora_poller] Using cache (0:15:56.451180 < 0:20:00)
2017-05-12 13:17:58 INFO (Thread-4) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi F
lora sensor %s] C4:7C:XX:XX:XX:XX
2017-05-12 13:17:58 DEBUG (Thread-6) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Conductivity
2017-05-12 13:17:58 DEBUG (Thread-6) [miflora.miflora_poller] Using cache (0:15:56.461081 < 0:20:00)
2017-05-12 13:17:58 INFO (Thread-6) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi F
lora sensor %s] C4:7C:XX:XX:XX:XX
2017-05-12 13:17:58 DEBUG (Thread-9) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Temperature
2017-05-12 13:17:58 DEBUG (Thread-9) [miflora.miflora_poller] Using cache (0:15:56.467504 < 0:20:00)
2017-05-12 13:17:58 INFO (Thread-9) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi F
lora sensor %s] C4:7C:XX:XX:XX:XX
2017-05-12 13:17:58 DEBUG (Thread-12) [homeassistant.components.sensor.miflora] Polling data for Planta_Terraza Battery
2017-05-12 13:17:58 DEBUG (Thread-12) [miflora.miflora_poller] Enter read_ble (<Thread(Thread-12, started daemon 1873802336)>)
2017-05-12 13:17:58 DEBUG (Thread-12) [miflora.miflora_poller] Created lock in thread <Thread(Thread-12, started daemon 18738023
36)>
2017-05-12 13:17:58 DEBUG (Thread-12) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:18:02 DEBUG (Thread-12) [miflora.miflora_poller] Finished gatttool
2017-05-12 13:18:02 DEBUG (Thread-12) [miflora.miflora_poller] Released lock in thread <Thread(Thread-12, started daemon 1873802
336)>
2017-05-12 13:18:02 DEBUG (Thread-12) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:18:02 DEBUG (Thread-12) [miflora.miflora_poller] Waiting for 10 seconds before retrying
2017-05-12 13:18:08 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.planta_terraza_battery is taking over 1
0 seconds
2017-05-12 13:18:12 DEBUG (Thread-12) [miflora.miflora_poller] Created lock in thread <Thread(Thread-12, started daemon 18738023
36)>
2017-05-12 13:18:12 DEBUG (Thread-12) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:18:26 DEBUG (Thread-12) [miflora.miflora_poller] Finished gatttool
2017-05-12 13:18:26 DEBUG (Thread-12) [miflora.miflora_poller] Released lock in thread <Thread(Thread-12, started daemon 1873802
336)>
2017-05-12 13:18:26 DEBUG (Thread-12) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:18:26 DEBUG (Thread-12) [miflora.miflora_poller] Waiting for 20 seconds before retrying
2017-05-12 13:18:26 DEBUG (Thread-12) [miflora.miflora_poller] Created lock in thread <Thread(Thread-12, started daemon 18738023
36)>
2017-05-12 13:18:26 DEBUG (Thread-12) [miflora.miflora_poller] Running gatttool with a timeout of 20
2017-05-12 13:18:29 WARNING (MainThread) [homeassistant.components.sensor] Updating miflora sensor took longer than the schedule
d update interval 0:00:30
2017-05-12 13:18:33 DEBUG (Thread-12) [miflora.miflora_poller] Finished gatttool
2017-05-12 13:18:33 DEBUG (Thread-12) [miflora.miflora_poller] Released lock in thread <Thread(Thread-12, started daemon 1873802
336)>
2017-05-12 13:18:33 DEBUG (Thread-12) [miflora.miflora_poller] Got  from gatttool
2017-05-12 13:18:33 DEBUG (Thread-12) [miflora.miflora_poller] Waiting for 20 seconds before retrying
2017-05-12 13:18:33 DEBUG (Thread-12) [miflora.miflora_poller] Exit read_ble, no data (<Thread(Thread-12, started daemon 1873802
336)>)
2017-05-12 13:18:33 DEBUG (Thread-12) [homeassistant.components.sensor.miflora] Planta_Terraza Battery = 0
2017-05-12 13:18:33 DEBUG (Thread-12) [homeassistant.components.sensor.miflora] Data collected: [0, 0]
2017-05-12 13:18:33 DEBUG (Thread-12) [homeassistant.components.sensor.miflora] Not yet enough data for median calculation

thanks,

Hello,

At the end the problem was on the device. I took out battery and put again. Then i configured bluetooth on raspberry pi (pari, trust and connect) and then i begin to have values in HA.

thanks

Hi guys

I have a similar issue and cannot find a solution for it…

I am trying to set up my Mi Floor Plant Sensors (working with Bluetooth LE). I tried like its described within the manual (https://www.home-assistant.io/integrations/mitemp_bt/). According to this BLE should be enabled by default on the hass.io image. But I do not have hcitool or bluetoothctl available from command line in hass.io raspberry pi. Does anyone knows what I have to do to enable them?

Although the bluetooth tools mentioned where not available I was able to get the MAC address using BLE Scanner on Android. But if i put in the corresponding MAC to configuration.yml I do not get any updates/values from the sensor although it is within 2-3m from the raspberry pi. Is there anything else that I need to configure on either hass.io/raspberry pi/homeassistant?

sensor:
  - platform: miflora
    mac: 'XX:XX:XX:XX:XX:XX'
    force_update: true
    monitored_conditions:
      - moisture
      - light
      - temperature
      - conductivity
      - battery

I would appreciate it if someone of you could help me on this.

Best & thx in advance,
mooonli

Yesterday, after 2 weeks of proper functioning, Hassio stopped receiving data from Miflora sensor