This integration can automatically fetch data from OpenPlantBook if you are a registered user. Registration is free.
Warning
This integration is not compatible with the original plant integration in HA.
Note
This integration will try to convert all
plant:
entries fromconfiguration.yaml
to the new format. After migration, you can (and should) remove yourplant:
entries from your YAML-configuration.
If something goes wrong during migration, delete all the plants from the UI, and correct any problems in your yaml config. Then they will be migrated again at next restart. Auto migration will not be done if there are existing plants of the new format already registered in HA.
Warning
Please notice that the
entity_id
of the plants will NOT be preserved during auto-migration. Also, since the "layout" of the new integration is completely different from the old one, you probably have to update and modify any automations, scripts, blueprints etc. you have made based on the old version.Make sure you check you plant settings after the first restart. You can find the configuration options in the Integrations page under Settings in Home Assistant.
Plants are set up in the UI and all configuration of your plants can be managed there or by automations and scripts.
All existing entries in configuration.yaml
from version 1 will be migrated to the new format automatically. Notice that some options (like warn_low_brightness
) will not be migrated over, but can be easily changed in the UI configuration after migration.
This means that the main plant entity references other entities, and they are grouped togheter in the GUI as a single device.
This also means that this version is not compatible with earlier releases from this repository, or with the "plant" integration that is part of your default Home Assistant installation
- Config Flow is used to set up the plants
- This works both with and without OpenPlantbook
- All thresholds and plant images are fetched automatically from OpenPlantbook if available
- All thresholds now are their own entities and their values can be changed from the UI or by scripts and automations.
- These changes are instantly reflected in HA. No need to restart to change the thresholds.
- Max and min temperature is now dependent on the unit of measurement - currently °C and °F is supported.
- The values will be updated if you change your units in the Home Assistant settings
- You can use a service call to replace the different sensors used to monitor the plant
What I personally do, to make a clearer separation between the physical sensor and the sensor that is part of the plant, is that all my physical sensors (e.g BLE-devices) have generic entity_ids like sensor.ble_sensor_1_moisture
, sensor.ble_sensor_1_illumination
, sensor.ble_sensor_2_conductivity
etc.
And all my plants sensors have entity_ids like sensor.rose_moisture
, sensor.chili_conductivity
etc.
That way, if I need to replace a (physical) sensor for e.g. my "Rose" plant, it is very easy to grasp the concept and use
service: plant.replace_sensor
data:
meter_entity: sensor.rose_illumination
new_sensor: sensor.ble_sensor_12_illumination
- The new sensor values are immediately picked up by the plant integration without any need to restart
- If you change the species of a plant in the UI, new data are fetched from OpenPlantbook
- You can optionally select to force a refresh of plant data from OpenPlantbook, even if you do not change the species.
- Image can also be updated from the UI
- You can chose to disable problem triggers on all sensors.
These updates are immediately reflected in HA without restarting anything.
- A new Daily Light Integral - DLI - sensor is created for all plants.
See https://en.wikipedia.org/wiki/Daily_light_integral for what DLI means
- I have upgraded the Lovelace flower card to make use of the new integration, and made it more flexible.
- The flower card also handles both °C and °F
OpenPlantbook is not a strict requirement, but a strong recommendation. Without the OpenPlantbook integration, you need to set and adjust all the thresholds for every plant manually. With the OpenPlantbook integration added, all data is fetched from OpenPlanbook automatically, and it makes setting up and maintaining plants much, much easier.
Not required, but strongly recommended
- Upgrade to the latest version of the OpenPlantbook integration: https://github.com/Olen/home-assistant-openplantbook
- Set it up, and add your client_id and secret, and test it by using e.g. the
openplantbook.search
service call to search for something.
Currently this is the only card in lovelace that support this integration. Feel free to fork and update - or create PRs - for other lovelace cards.
- Install verson 2 of the Flower Card from https://github.com/Olen/lovelace-flower-card/
- Add this repo as a "Custom repository" with type "Integration"
- Click "Install" in the new "Home Assistant Plant" card in HACS.
- Install
- Restart Home Assistant
- Copy the entire
custom_components/plant/
directory to your server's<config>/custom_components
directory - Restart Home Assistant
The first restart might take some time, as it tries to convert all your plants from your configuration.yaml to the new format. You can follow this process in the log-file.
After Home Assistant is restarted, you will find all your plants under "Settings" - "Devices and Services" - "Devices". It will take a minute or two before the current values start to update.
Warning The
entity_id
of your plants will probably have changed from the old integration to the new one. This means that any automations, scripts etc. that use the entity_id or reacts to changes in your plants status will need to be updated. You probably also need to change the way you read data from the plant device in any such components.
Warning This integration is NOT compatible with the built in original plant component. This means that e.g. the plant cards etc. in the UI, and any blueprints etc. that are built for the original plant intergation wil NOT work with this version.
When the integration is first installed, and HomeAssistant is restarted for the first time, all old plant:
entries will be migrated.
The migration will set up all sensors, thresholds etc. from your yaml-config, and if species is set and OpenPlantbook is set up, it will fill in missing data with data from Openplantbook, or from default values if OpenPlantbook is not set up.
By default, all problems (e.g. every time a sensor reports a value that is above or below the threshold set in "limits"), the plant state will be set to "problem".
This can be adjusted under "Settings" -> "Devices and Services" -> "Plant Monitor" -> "Your Plant Name" and "Configure".
Here you can select what kind of threshold violations should trigger a "problem" state of the plant entity.
This requires the OpenPlantbook integration to be installed.
When you set up a new plant, the configuration flow will search OpenPlantbook for the species you enter. If any matches are found, you are presented with a list of exact species to choose from. Be aware that the OpenPlantbook API does currently not include any of your private user defined species, so you will not find them in the list. See below for how to refresh data from OpenPlantbook. If no matches are found, the configuration flow will continue directly to the next step.
In the following step, the threshold values from OpenPlantbook for the chosen species is pre filled and the image from OpenPlantbook is also displayed. If you chose the incorrect species, you can uncheck the "This is the plant I was looking for" checkbox, and you will be directed back to the dropdown of species to select another one. If no match is found in OpenPlantbook, the thresholds are pre filled with some default values that you probably want to adjust.
If the species is found in OpenPlantbook, the image link is pre filled with the URL to the image there. You may overrride this with your own links. Both linkst starting with http
and local images in your "www"-folder, e.g. /local/...
are supported.
If you later want to change the species of a plant, you do that under "Configuration" of the selected device.
"Settings" -> "Devices and Services" -> "Plant Monitor" -> "Your Plant Name" and "Configure".
From there, you have the option to set a new species. If you change the species, data for the new species will be automatically fetched from OpenPlantbook. The species will have to be entered exactly as the "pid" in OpenPlantbook (including any punctations etc.). If the species is found in OpenPlantbook, the thresholds are updated to the new values. Also, if the current image links to OpenPlantbook or the image link is empty, the URL to the image in OpenPlanbook is added. If the current image points to a local file, or a different URL, the image is not replaced unless "Force refresh" is checked. The "Species to display" is not changed if you change the species unless "Force refresh" is checked. If no species are found in OpenPlantbook, the thresholds and image will be retained with their current values.
If you just want to refresh the data from OpenPlantbook, without changing the species - for instance if you have private species defined in OpenPlantbook that are not found during setup, you check the "Force refresh" checkbox, and data will be fetched from OpenPlantbook without needing to change the species. If this checkbox is checked, both the image and the "Species to display" is updated if the species is found in OpenPlantbook. If no species is found in OpenPlantbook, nothing is changed.
I added the wrong sensors, and after removing and adding the plant again with the correct sensor, I can still see the wrong values from the old sensor.
Home Assistant is very good at remembering old configuration of entities if new entities with the same name as the old ones are added again. This means that if you first create e.g. a moisture-sensor for your plant that reads the data from sensor.bluetooth_temperature_xxxx
, and the remove the plant and add it back again with the same name, but with moisture-sensor set to sensor.xiaomi_moisture_yyyy
you might experience that the plant will still show data from the old sensor. Instead of removing and re-adding a plant, you should just use the replace_sensor
service call to add the new sensor.