There are multiple options available to create a Xiaomi Flower Care plant sensor card for a Home Assistant dashboard. This article describes setting up a plant information card which looks as shown below.
This card is based on the Lovelace Flower Card by Olen, which embeds additional functionality. This plant sensor card can make use from the Open Plantbook database to fetch plant information via the OpenPlantBook integration. Additionally the Alternative Plant Component is used, also called Plant monitor.
- The Flower Care Plant Sensor from Xiaomi
- Integrating the Xiaomi Flower Care plant sensor with Home Assistant
The following is required to setup the plant sensor card:
- A working Home Assistant
- Xiaomi Flower Care plant sensor(s) integrated in Home Assistant
See our article ‘Integrating the Xiaomi Flower Care plant sensor with Home Assistant‘.
- The Lovelace Flower Card by Olen installed
- The OpenPlantbook integration by Olen installed
- The Alternative plants component for Home Assistant by Olen installed, will be shown as ‘Plant monitor’.
The next sections assume above requirements have been met.
3. Assure you have an Open Plantbook account
Although not necessary for using the Lovelace Flower Card we make use of Open Plantbook in this article to automatically fetch plant data, plant image and bandwidth of the plant sensor measurements in which the plant will be happy.
If no Open Plantbook account yet follow the steps below:
- Go to the Open Plantbook website.
- At the upper tight click on “Sign in” and then on “Create account”.
- Enter your credentials and click register.
- You can now immediately login. No confirmation emails are sent.
4. Install the OpenPlantbook integration
To make it possible to fetch data from the Open Plantbook database the OpenPlantbook integration needs to be installed in Home Assistant and configured.
- See the OpenPlantbook integration instructions how to install. The integration will be shown as follows:
- Setup and configure the integration as indicated by the instructions.
- Remember the path where the images are stored (click on configure in the integration to see the image path). In our case the path is ‘/config/www/images/miflora/’
5. Adding the plant to Home Assistant
Before we can create a Lovelace plant sensor card with plant information we need first to setup a Home Assistant device with the plant properties.
- Check if plant info is available on Open Plantbook
- In Home Assistant go to Settings > Devices & Services and click on the ‘Add integration’ button.
- Type ‘plant’ in the ‘Search for a brand name’ field and select ‘Plant Monitor’
- The ‘Configure a plant dialog’ will be shown.
a. Enter the plant name (usual name of the plant)
b. Enter the species (the latin name, also used to search inf in Open Plantbook
c. Enter the Xiaomi Flower Care Plant Sensor to use
d. Enter optionally a humidity sensor nearby as the plant sensor does not measure this.
Click the submit button.
- If one or more species are found on Open Plantbook it can be chosen which one is correct
Click on submit.If no species found the ‘Set limits’ dialog described in the next step will be shown.
- The ‘Set limits’ dialog will be shown. In this case with data pre-filled from Open Plantbook, including the image.
For every property it has a min and max value stated. These will be use to flag warnings if the measured values are outside the range. The image from Open Plantbook will be copied to the image folder configured in the OpenPlantBook integration.
Click on submit.
If the plant has not been found at Open Plantbook you need to enter the requested data by yourself. It will be pre-populated with default data for you to change if needed. Search the web for plant info and modify the default settings.
The plant image needs to be stored in the folder configured in the Openplantbook API integration. In our case it is the folder path ‘\local\images\miflora\<image name>.jpg’. The image size used in the Lovelace flower card is small, so to speed up the performance of the dashboard it is wise to compress the image (we used jpeg 60%) and scale the image down. When ready click on submit.
- Add the area of the plant and click on Finish.
Note: initially ‘Unknown device’ might be shown. When selecting the area drop down it will update the dialog with thew plant name.
- The plant has now been setup for use in the lovelace card and automations.
6. Rename the plant to include the sensor number
To make it easier to see which plant sensor is used for a plant we rename the plant device to include ‘(sensor x)’ and have this also shown on the Lovelace Flower Card.
This sounds straightforward, but there are 3 locations where you can change the plant name, each having a different impact:
- the device name of the plant
Will be shown on the first line of the Lovelace Flower Card, see item 1 in the image below. Additionally this gives also the option to include the plant sensor number in the device entity IDs, making it easier to find the correct entities when creating dashboards and automations.
- embedded in the plant monitor device options
Will be shown on the second line of the Lovelace Flower Card, see item 2 in the image below.
- as shown in the plant monitor integration
Only shown in the Plant monitor integration as shown in image above. No impact on the Lovelace flower card.
We have chosen to go for only option one in this article, for which the following steps need to be followed:
- Select the plant from the plant monitor integration.
- Update the device name by clicking on device
- Select & copy the name in the header
- Click on the edit settings button in the upper right
- Paste the name with Ctrl-V or right mouse button into the name field and add ‘(sensor x)’. Click on the update button.
- Click rename to change the entity IDs to include also the plant sensor number
- Refresh the device screen to show the updated info. Measurements will be shown shortly. The device sensors will now have an entity ID like for example:
The device overview screen will now show the sensor number included also for the device name.
- The Lovelace flower card will also show this device name:
If you change the name later it might not be reflected in the Flower Card. A reload of the Plant monitor integration for the plant will give an error:
The only way to reset this error we have found is to restart Home Assistant.
7. Create the Lovelace Flower Care card
Perform the steps below to create a Flower Card card similar as shown above.
- Go to the Home Assistant dashboard where you want to add the Flower Care card and put it into edit mode.
- Click on the add card button and type manual in the ‘Search cards’ field.
- Remove existing info from the code editor and copy/paste the yaml code below.
YAML123456789type: custom:flower-cardentity: plant.canna_cannova_bronze_scarlet_sensor_4show_bars:- moisture- conductivity- temperature- dli- humidity- illuminance
The order of the bars can be changed by changing the order in the Yaml code above.
- Replace the entity marked red above by your plant entity name. You can find this for example by searching for your plant on the entity overview screen (Settings > Devices & Services > Entities).
- If correctly done the preview shows how your card will look. Click on Save.
- Exit the dashboard edit mode.
8. Useful links
Below are links to sites or the Home Assistant community forum which might help you in creating your own dashboard cards with plant sensor information.
- Lovelace flower card by Olen
Dependencies (not required, but fetches plant properties from the web:
Alternative plants compontent
- Plant monitor
Lets you merge moisture, conductivity, light intensity, temperature and battery level for a plant into a single Home Assistant UI element. It also supports setting minimum and maximum values for each measurement and will change its state to “problem” if it is not within those limits.
- MiFlora Card by OscarHanzely, which is slightly improved version of the original MiFlora Card by RodBr.
- MiFloraDB a rip of the HHCC Xiaomi Mi Flora Flower Care plant database. Site has also links to large set with plant images.
- Home Assistant community forum; MiFlora Sensor Plant Database:
- Home Assistant community forum; New version of the plant integration
- Home Assistant community forum; Light accumulation for xiaomi flower sensor