Mi flora not working on hass.io

Having problem with mi flora on hass.io. Version: 0.77.3
See my config below:

  • platform: miflora
    mac: ‘C4:7C:8D:66:DC:6D’
    name: Bonsai
    force_update: false
    median: 3
    monitored_conditions:
    • moisture
    • light
    • temperature
    • conductivity
    • battery

Having 3 mi flora sensors, this is just one example but all are configured the same way
device_tracker:

  • platform: bluetooth_tracker

Just getting unknown values, any ideas?

I have 10 mi floras and they work well. I dont have bluetooth tracker though.

What is the problem - and do you see anything in the home-assistant.log that could point in direction of your problem ?

Dont know the problem, how do I now that the pi is getting updates from the sensors?
Cant see anything special in logs either.

How did you setup the sensors?

My setup looks like …

- platform: miflora
  mac: C4:7C:8D:61:A8:46
  name: MiFlora Bird Of Paradise
  force_update: true
  timeout: 60
  cache: 60*60
  median: 1
  monitored_conditions:
    - moisture
    - light
    - temperature
    - conductivity
    - battery

Note the lack of quotes round the mac addr. You don’t need the bluetooth device tracker for MiFlora. Also with median: 3 you will have to wait about 1/2 hr before any updates.

Okey, deleted the quotes before and after the Mac addr. Also deleted bluetooth device tracker since I don’t use it. Did know about the 1/2 update time but will try with median 1 now.

Still unknown values… :frowning: don’t understand what I’m doing wrong.
How did you guys get the Mac addr?

Since I’m using hass.io I had to change sd card with preinstalled os to be able to search for the Mac addresses. Then I wrote them down and changed back to my sd card with hass.io.
Is that the problem?

I used my phone to get the mac addresses.

I could not find the Mac addresses using BLE Scanner on iOS, had to use the pi.

Do I need to use any plant component?

No you don’t need a component it’s inherent in the spec. when you created the sensors :slight_smile: You haven’t said what PI you are using the older PI’s don’t have a BT chip so you need a dongle the newer PI’s 3 and 3B+ have an onboard BT chip, so you may need to buy a BT dongle if using PI 1’s and 2’s.

Im using a Pi 3 Model B, so that should not be the problem either

Presumably you have done a complete power off restart? Have you set the logger to debug for miflora…

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

Any indications from the logs?

Also on the host ssh to 22222 (i think) you can use bluetoothctrl to check whats being seen by the the hardware.

Just did a complete power off restart and now it works. Thanks!

Having lots of trouble for months now. Worked fine for about a year with 6 sensors. Then someday my sdcard crashed, I reinstalled everything, added 2 sensors and since then it never worked reliable anymore.

This is what my logfile says:

2018-09-17 20:15:52 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.mi_flora_5_moisture is taking over 10 seconds
2018-09-17 20:16:13 INFO (Thread-14) [homeassistant.components.sensor.miflora] Polling error Exit read_ble, no data (<Thread(Thread-14, started daemon 1842029680)>)
2018-09-17 20:16:13 DEBUG (Thread-16) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 1 Moisture
2018-09-17 20:16:13 DEBUG (Thread-16) [miflora.miflora_poller] Using cache (0:18:36.750007 < 0:20:00)
2018-09-17 20:16:13 INFO (Thread-16) [homeassistant.components.sensor.miflora] Polling error Could not read data from Mi Flora sensor C4:7C:8D:64:46:77
2018-09-17 20:16:13 DEBUG (Thread-22) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 2 Moisture
2018-09-17 20:16:13 DEBUG (Thread-22) [miflora.miflora_poller] Using cache (0:16:01.673919 < 0:20:00)
2018-09-17 20:16:13 INFO (Thread-22) [homeassistant.components.sensor.miflora] Polling error Could not read data from Mi Flora sensor C4:7C:8D:64:42:27
2018-09-17 20:16:13 DEBUG (Thread-22) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 7 Moisture
2018-09-17 20:16:13 DEBUG (Thread-22) [miflora.miflora_poller] Using cache (0:17:03.382222 < 0:20:00)
2018-09-17 20:16:13 INFO (Thread-22) [homeassistant.components.sensor.miflora] Polling error Could not read data from Mi Flora sensor C4:7C:8D:65:BA:DB
2018-09-17 20:16:13 DEBUG (Thread-7) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 3 Moisture
2018-09-17 20:16:13 DEBUG (Thread-7) [miflora.miflora_poller] Using cache (0:15:31.073260 < 0:20:00)
2018-09-17 20:16:13 INFO (Thread-7) [homeassistant.components.sensor.miflora] Polling error Could not read data from Mi Flora sensor C4:7C:8D:64:45:C7
2018-09-17 20:16:13 DEBUG (Thread-3) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 6 Moisture
2018-09-17 20:16:13 DEBUG (Thread-3) [miflora.miflora_poller] Using cache (0:19:38.729210 < 0:20:00)
2018-09-17 20:16:13 INFO (Thread-3) [homeassistant.components.sensor.miflora] Polling error Could not read data from Mi Flora sensor C4:7C:8D:65:BA:EB
2018-09-17 20:16:13 DEBUG (Thread-18) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 8 Moisture
2018-09-17 20:16:13 DEBUG (Thread-18) [miflora.miflora_poller] Using cache (0:18:06.497845 < 0:20:00)
2018-09-17 20:16:13 INFO (Thread-18) [homeassistant.components.sensor.miflora] Polling error Could not read data from Mi Flora sensor CC4:7C:8D:66:1E:6C
2018-09-17 20:16:13 DEBUG (Thread-19) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 1 Moisture
2018-09-17 20:16:13 DEBUG (Thread-19) [miflora.miflora_poller] Using cache (0:18:37.064728 < 0:20:00)
2018-09-17 20:16:13 INFO (Thread-19) [homeassistant.components.sensor.miflora] Polling error Could not read data from Mi Flora sensor C4:7C:8D:64:46:77
2018-09-17 20:16:13 DEBUG (Thread-6) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 3 Moisture
2018-09-17 20:16:13 DEBUG (Thread-6) [miflora.miflora_poller] Using cache (0:15:31.591010 < 0:20:00)
2018-09-17 20:16:14 INFO (Thread-6) [homeassistant.components.sensor.miflora] Polling error Could not read data from Mi Flora sensor C4:7C:8D:64:45:C7
2018-09-17 20:16:14 DEBUG (Thread-21) [homeassistant.components.sensor.miflora] Polling data for Mi Flora 8 Moisture
2018-09-17 20:16:14 DEBUG (Thread-21) [miflora.miflora_poller] Using cache (0:18:07.015284 < 0:20:00)

I tried deleting 2 sensors as well, timeout set to 30 seconds.

Are you running any other BTLE devices from the same PI? If so try disabling the other devices in your config.

No I don’t. I just updated to 0.78.0 and now get the following errors:

2018-09-17 21:34:27 ERROR (MainThread) [homeassistant.components.sensor.miflora] Unable to connect to C4:7C:8D:64:46:77
2018-09-17 21:34:28 ERROR (MainThread) [homeassistant.components.sensor.miflora] Unable to connect to C4:7C:8D:64:42:27
2018-09-17 21:34:28 ERROR (MainThread) [homeassistant.components.sensor.miflora] Unable to connect to C4:7C:8D:64:45:C7
2018-09-17 21:34:28 ERROR (MainThread) [homeassistant.components.sensor.miflora] Unable to connect to C4:7C:8D:64:45:D3
2018-09-17 21:34:28 ERROR (MainThread) [homeassistant.components.sensor.miflora] Unable to connect to C4:7C:8D:64:45:9C
2018-09-17 21:34:28 ERROR (MainThread) [homeassistant.components.sensor.miflora] Unable to connect to C4:7C:8D:65:BA:EB
2018-09-17 21:34:28 ERROR (MainThread) [homeassistant.components.sensor.miflora] Unable to connect to C4:7C:8D:65:BA:DB
2018-09-17 21:34:28 ERROR (MainThread) [homeassistant.components.sensor.miflora] Unable to connect to C4:7C:8D:66:1E:6C

P.S. all sensors are working fine in the MiFlora app.

1 Like

Can you check that your bluetooth h/w is up and running? (hciconfig hci0)


pi@hassbian:~ $ hciconfig hci0
hci0:   Type: Primary  Bus: UART
        BD Address: B8:27:EB:47:B2:12  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING
        RX bytes:10500 acl:10 sco:0 events:1338 errors:0
        TX bytes:15727 acl:9 sco:0 commands:1305 errors:0

Try bringing it down and then up again. hciconfig hci0 down/up

I just did. Now lets wait and see what happens, I’ll report back. Thanks for your help (Y)