Skip to content

Getting Xiaomi Mi Flora plant sensors working on HASSio

Xiaomi has a great line of pretty high quality but very inexpensive hardware that you can use in your smart home.  Right now I’m using their plant, door, water, and temperature sensors, as well as their curtain motors.  These plant sensors seem to be the only Xiaomi sensor that I have that is not ZigBee.  So recently, I got another Raspberry Pi (3B+) to be able to pull in my Mi Flora plant sensors from my living room.  There are a ton of tutorials on how to get HASSio loaded on an SD card, so I’ll assume you have Home Assistant up and running.

Here are the steps I used to get my sensors displaying in Home Assistant via the MiFlora component.

  1. If you installed the “SSH server” add-on from the built-in add-on, then remove that one first.
  2. Install the “SSH & Web Terminal” add-on.
    This is in the Official add-ons repository.
  3. Configure the username and password/authorized_keys options.
    Use a complex password here as it checks against Have I Been Pwned database.
  4. Activate ssl on the Web Terminal if you use it.
    If you use this, make sure you have valid keys that you are pointing to.
  5. Start the “SSH & Web Terminal” add-on.
  6. Check the logs of the “SSH & Web Terminal” add-on to see if everything went well.
  7. Open the Web Terminal.  
    https://hassio.local:7681/ if you have not changed anything from default settings.
  8. Reboot the host.
  9. Once rebooted, open the Web Terminal.
  10. Type bluetoothctl to enter the bluetooth controller and then scan on to begin the scanning.
    You will begin to see the list of devices appearing on the scanner.
  11. Now you have everything you need to add the sensors to your config.
  12. Edit you configuration.yaml file and add the following:
  13. Restart your Home Assistant instance and you should get the sensors to appear.
  14. To add them to the UI, I added the following to my lovelace config file:

  15. To make sure I don’t forget about the plants, I’ve added an automation to remind me when it’s time to water my plants:
Published inHome AssistantHome Automation

4 Comments

  1. Charles Caure Charles Caure

    Hi and thanks for your guide!
    I read somewhere that you can install max one mi flora on hassio but I see you have two mi flora installed. How does they work together?

  2. DK DK

    It works fine, I actually have three

  3. eliobou eliobou

    Hello, I run Hassio on Raspberry Pi 3B+ and I have “-bash: bluetoothctl: command not found” when running bluetoothctl command. What can I do ?

  4. DK DK

    Did you follow the instructions and run terminal through elevated privileges?

Leave a Reply

Your email address will not be published.